I am integrating google maps sdk. Its all work fine. But how to remove particular Marker(Pin Point) when second will appear.(I am not using Mapkit)
I want the following:
I made like this:
GMSMarker *myMarker;
- (void)mapView:(GMSMapView *)mapView didTapAtCoordinate:(CLLocationCoordinate2D)coordinate
{
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
if (myMarker) {
myMarker.map = nil;
myMarker = nil;
}
myMarker = [[GMSMarker alloc] init];
myMarker.position = CLLocationCoordinate2DMake(coordinate.latitude, coordinate.longitude);
myMarker.title = @"title";
myMarker.map = mapView_;
}];
}
and worked well for me !