Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
352 views
in Technique[技术] by (71.8m points)

ios - Customize Google Maps blue dot for current location

I'm using a 2013 version of Google Maps SDK for iOS. I would like to customize the default blue dot for current location with another icon or pulsing circles around.

I know we can do that with mapView:viewForAnnotation: in MKMapView, but I can't found out how to do it with Google Maps.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There is no way to do this with current version of the SDK (1.4.3), and actually there is an open issue with this request: Look here.

As a work around, you can hide the default button with:

 _map.myLocationEnabled = NO;

Then create a custom GMSMarker

 GMSMarker *pointMarker = [GMSMarker markerWithPosition:currentPosition];
 pointMarker.icon = [UIImage imageNamed:@"YourImage"];
 pointMarker.map = _map;

And change the position of it using a CLLocationManager, so it always show the current position. It's a bit tricky but is the only way, I could think, that you can achieve this. If you need a more complete example let me know.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...