iosgoogle-mapsxamarinxamarin.ios

How to get coordinates about a point in Google Maps API iOS?


How I can get the coordinates (CLLocationCoordinate2D) of a PointF in Google maps API Xamarin for iOS

Previously used:

PointF location = reticula.Center;                  
CLLocationCoordinate2D coordinate = MapaApple.ConvertPoint (location, this.View);

CLLocationCoordinate2D I did return, but now with Google API

I use something like this:

PointF location = reticula.Center;
CLLocationCoordinate2D coordinate = new CLLocationCoordinate2D (MapaGoogle.ConvertPointFromView(CLLocation,this.View);

But one PointF me back.

I need CLLocationCoordinate2D any ideas?


Solution

  • You could use something like this:

    CLLocationCoordinate2D coordinate = mapView.Projection.CoordinateForPoint(location);
    

    Note: The point should be relative to the map view.