Search code examples
iosobjective-cskmaps

How to zoom to current location on map with Skobbler


I want to zoom to current user's location upon initialising SKMap. Right now I don't know if it's even possible (even though it's impossible that it's impossible) but I fail to find the way through documentation.

Only thing I found is method for android

mapView.setZoom(int);

But there is nothing like it for iOS.

How can I zoom to the users current location then?


Solution

  • Simply create a region for your map to focus onto:

    SKCoordinateRegion region;
    region.center = CLLocationCoordinate2DMake(52.5233, 13.4127);
    region.zoomLevel = 17;
    mapView.visibleRegion = region;