I'm trying to use google maps version 2 by this code:
public void setMapData()
{
try {
if (mapView == null && _mapFragment != null)
{
mapView = _mapFragment.Map;
if (mapView != null)
{
CameraPosition currentPlace = new CameraPosition.Builder()
.Target (currentProperty.Location)
.Bearing (0)
.Zoom (((RPLApp)pshowAct.Application).typeOfShow .PropertyZoomLevel) //apply zoom here
.Build ();
mapView.AnimateCamera (CameraUpdateFactory.NewCameraPosition (currentPlace));
mapView .Clear ();
MarkersHelperClass.DrawMarkerOnLocation (pshowAct , mapView, currentProperty.Location);
}
}
} catch (Exception ex) {
RltLog .HandleException (ex);
}
}
but mapView = _mapFragment.Map;
always return null
. at below url has a solution for java codes but it is not working for monodroid. How can we use it at monodroid or c#? It is not suitable because the code defined a new class inside and activity. How we can make it friend with C# syntax?