rams
rams

Reputation: 49

How to set custom markers (image) on GMSMapView

I tried this

GMSMarker *marker = [[GMSMarker alloc]init];
marker.icon = [UIImage imageNamed:@"pin2.png"];
marker.position = CLLocationCoordinate2DMake(lati, longi);
marker.groundAnchor = CGPointMake(0.5, 0.5);
marker.draggable = YES;
marker.map = mapView;

but I did not get the image.

Upvotes: 1

Views: 3300

Answers (1)

Anonymous
Anonymous

Reputation: 11

I think you are missing this line:

[mapView setSelectedMarker:marker];

Upvotes: 1

Related Questions