Senõr Ganso
Senõr Ganso

Reputation: 1734

How to remove an arrow from Google Maps geolocation marker (iOS)?

How do you remove an arrow from Google Maps geolocation marker (iOS)?

This is an arrow I'm talking about

enter image description here

Upvotes: 1

Views: 1077

Answers (2)

Lukas Kukacka
Lukas Kukacka

Reputation: 7704

If you really want to remove that arrow everywhere in your app from Google Maps SDK, it might be easiest to modify asset in GoogleMaps.framework.

Just navigate (cd) to GoogleMaps.framework/Versions/A/Resources/GoogleMaps.bundle/GMSCoreResources.bundle/ and notice the following files:

  • GMSSprites-0-1x.png
  • GMSSprites-0-2x.png
  • GMSSprites-0-3x.png

If you open these files, you can notice the arrow is there. So just edit directly in the asset by replacing arrow by nothing (transparent pixels).


Note: I haven't test it myself and this is not tested solution, but I believe it should work.

Disclaimer: I'm not sure, but I think this modification might violate Terms & Conditions for using the SDK. I don't get any responsibility for such modification, it's your call...

Upvotes: 3

Adam Fallon
Adam Fallon

Reputation: 61

There is no way to do this with current version of the SDK (1.9.1), 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.

Upvotes: 2

Related Questions