I have an activity that the user switches to after logging in that has a Google Maps fragment and I want to change the default location that the map loads too, however, the Map seems to not be responding to any commands. Below is the code for the whole activity, I don't have much yet.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.Gms.Maps;
using Android.Gms.Maps.Model;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
namespace TriTrack
{
[Activity(Label = "MapsActivity")]
public class MapsActivity : Activity, IOnMapReadyCallback
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Map);
MapFragment mapFragment = (MapFragment)FragmentManager.FindFragmentById(Resource.Id.map);
mapFragment.GetMapAsync(this);
}
public void OnMapReady(GoogleMap googleMap)
{
LatLng latlng = new LatLng(Convert.ToDouble(13.0291), Convert.ToDouble(10.2083));
CameraUpdate camera = CameraUpdateFactory.NewLatLngZoom(latlng, 15);
googleMap.MoveCamera(camera);
MarkerOptions options = new MarkerOptions().SetPosition(latlng).SetTitle("Chennai");
googleMap.AddMarker(options);
}
}
}
The map does not move nor does it place a marker. Any ideas? Thanks in advance.