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:
Yes, I got that solution. Add pin like the following:
- (void)mapView:(GMSMapView *)mapView didTapAtCoordinate:(CLLocationCoordinate2D)coordinates {
pCoordinate.latitude =coordinates.latitude;
pCoordinate.longitude =coordinates.longitude;
[[GMSGeocoder geocoder] reverseGeocodeCoordinate:CLLocationCoordinate2DMake(coordinates.latitude, coordinates.longitude) completionHandler:^(GMSReverseGeocodeResponse *resp, NSError *error)
{
[currLocMarker setTitle:NSLocalizedString(@"current_location_title", nil)];
currLocMarker.icon = [UIImage imageNamed:@"pin.png"];
currLocMarker.position = CLLocationCoordinate2DMake(coordinates.latitude, coordinates.longitude);
currLocMarker.map = self.mapView;} ] ;}
Please remove the following line if you used in the above:
GMSMarker *currLocMarker = [[GMSMarker alloc] init];