Alpstein/route-me — Issue #28: setConstraintsSouthWest: NorthEast:
Author: plancalculus
Created: 2012-02-22 18:08:57+00:00
State: open

I have trouble setting constraints to prevent the user from scrolling outside a specific area. I use the following code, where all variables are set to reasonable values.

#define Latitude 47.56
#define Longitude 10.22

self.mapView = [[RMMapView alloc] initWithFrame: fullscreen
andTilesource: tileSource
centerCoordinate: CLLocationCoordinate2DMake(Latitude, Longitude)
zoomLevel: InitialZoom
maxZoomLevel: MaxZoom
minZoomLevel: MinZoom
backgroundImage: nil];

[self.mapView setConstraintsSouthWest: CLLocationCoordinate2DMake(Latitude-0.1, Longitude-0.1)
northEeast: CLLocationCoordinate2DMake(Latitude+0.1, Longitude+0.1)];

With this code I am not able to move the map at all. Am I doing something utterly wrong?

If I use the original route-me implementation and invoke setConstraintSW: NE: with the same arguments the map is constraint as I would expect.