سؤال

How to get CGPoint of location with google maps sdk for iOS ? I need add pinview on user location.

هل كانت مفيدة؟

المحلول

It's basically the opposite of this question, for example:

GMSMapView* mapView = ...;
CLLocationCoordinate2D coordinate = ...;
...
CGPoint point = [mapView.projection pointForCoordinate: coordinate];

نصائح أخرى

Ok, according to your question do you want to convert the userlocation into the cgpoint, is that.. try use this.

CGPoint newCenter = [self.map convertCoordinate:coord toPointToView:self.map];

Regards.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top