-convertPoint:toCoordinateFromView: method for Google Maps SDK for iOS
google-maps-sdk-ios, objective-c
Solution
You could use something like this:
GMSMapView* mapView = ...;
CGPoint point = ...;
...
CLLocationCoordinate2D coordinate =
[mapView.projection coordinateForPoint: point];
In this case `point` should be relative to the map view.
If you have a point relative to another view (eg `pinView` in your case), you'd need to convert that into a point relative to the map view first. You could do that with the following:
UIView* pinView = ...;
CGPoint pinViewPoint = ...;
...
CGPoint mapViewPoint = [pinView convertPoint: pinViewPoint toView: mapView];
So combining it all together:
GMSMapView* mapView = ...;
UIView* pinView = ...;
CGPoint pinViewPoint = ...;
...
CGPoint mapViewPoint = [pinView convertPoint: pinViewPoint toView: mapView];
CLLocationCoordinate2D coordinate =
[mapView.projection coordinateForPoint: mapViewPoint];
Problem
How do I implement the MapKit method ``` [googleMapView convertPoint:nePoint toCoordinateFromView:pinView]; ``` in Google Maps SDK for iOS?