Search code examples
objective-cskobbler-maps

How to check if a point is inside Skobbler map?


With MapKit there's MKMapRectContainsPoint(self.mkMapView.visibleMapRect, MKMapPointForCoordinate(coordinate)); and I need to do something similar with a Skobbler map instance.


Solution

  • Here's a solution that works pretty well:

    CGPoint point = [self.skobblerMapView pointForCoordinate:yourCoordinate];
    BOOL containsCoordinate = CGRectContainsPoint(self.skobblerMapView.bounds, point);