I\'m trying to figure out a straightforward way to determine in Google Maps for iOS if a given GMSMarker is within the bounds of the visible map. There seems to be solution
I have written on method to find GMSMarker is in particular frame. Set your rectangle frame (x,y,maxX,maxY). You can set any frame from screen it tell find marker is in that frame or not..
- (BOOL)isGoogleMapMarkerVisible:(GMSMarker*)marker {
//Marker point
CGPoint markerpoint = [self.mapview.projection pointForCoordinate:marker.position];
//Maximum visible region from x and y axis
float x = 0.0;
float y = o.o;
float maxX = self.mapview.frame.size.width;
float maxY = self.mapview.frame.size.height;
//If marker point is on visible region return true else return false
if (markerpoint.x > x && markerpoint.y > y && markerpoint.x < maxX && markerpoint.y < maxY) {
return YES;
}
else {
return NO;
}
}