2

can any one help, how can we restrict map view zoom level to city leavel(user need not enter to the street level while zooming the mapview) ..

here is following code m using to set the zoom level...

- (void) setMapRegionForMinLat:(double)minLatitude minLong:(double)minLongitude maxLat:(double)maxLatitude maxLong:(double)maxLongitude
{

MKCoordinateRegion region;
region.center.latitude = (minLatitude + maxLatitude) / 2;
region.center.longitude = (minLongitude + maxLongitude) / 2;
region.span.latitudeDelta = (maxLatitude - minLatitude);
region.span.longitudeDelta = (maxLongitude - minLongitude);

if (region.span.latitudeDelta < 0.059863)
    region.span.latitudeDelta = 0.059863;

if (region.span.longitudeDelta < 0.059863)
    region.span.longitudeDelta = 0.059863;


  }
VSN
  • 2,361
  • 22
  • 30
  • 1
    If you are going to copy code from another SO question it would be nice if you included the link - http://stackoverflow.com/questions/3434020/mkmapview-zoom-to-bounds-with-multiple-markers/ – Jonathan King Aug 09 '12 at 10:00

1 Answers1

0

You could manually intercept touches from a layer about which has pinchRecognisers, then if the pinch was not going to zoom it out too far you would pass it down to the mapp view. However you would need to work out how far the map zooms out per pinch size, but you could probably get close testing with NSLogs.

Edit - What's not working with your current code?

Jonathan King
  • 1,528
  • 14
  • 25
  • by using the current code m able to enter to the street level, m comparing max and min value, m not sure weather it is correct or not..m new to mapkit.. thank you – VSN Aug 09 '12 at 08:47