Shangari C
Shangari C

Reputation: 772

iOS Google Map Marker with a photo inside round bubble with arrow

I need a custom marker in google maps,I found a link which is in Android How to make a Google Map Marker with a photo inside round speech-bubble?. Can anyone give me idea how I can do in objective - c.

Upvotes: 0

Views: 307

Answers (2)

Sateesh Yemireddi
Sateesh Yemireddi

Reputation: 4409

Use iconView property of GMSMarker to render the customized view as marker.

Code:

UIImage *picture = [UIImage imageNamed:@"Your Picture"];
picture = [picture imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
UIImageView *pictureView = [[UIImageView alloc] initWithImage: picture];
pictureView.tintColor = [UIColor redColor];

CLLocationCoordinate2D position = CLLocationCoordinate2DMake(51.5, -0.127);
GMSMarker *marker = [GMSMarker markerWithPosition:position];
marker.iconView = pictureView;
marker.tracksViewChanges = YES;
marker.map = self.mapView;

For more, please visit https://developers.google.com/maps/documentation/ios-sdk/marker

enter image description here

Upvotes: 1

Ramprasath Selvam
Ramprasath Selvam

Reputation: 4458

Try this

CLLocationCoordinate2D position = CLLocationCoordinate2DMake(51.5, -0.127);
GMSMarker *london = [GMSMarker markerWithPosition:position];
london.title = @"London";
london.icon = [UIImage imageNamed:@"house"];
london.map = mapView;

Upvotes: 0

Related Questions