2
votes

I am trying to get the current zoomScale for mapview. I was using

zoomScale = self.mapView.bounds.size.width/ self.mapView.visibleMapRect.size.width;

But the zoomScale does not equal to the one passed to

  • (void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context

if i use zoomScale = 2*self.mapView.bounds.size.width/ self.mapView.visibleMapRect.size.width, it can euqal to the one in drawMapRect method on retina iphone but not for any ipad.

So I am still not sure how to get the correct zoomScale for any device, the zoomScale should match the one n drawMapRect.

Thanks in advance,

James

1

1 Answers

0
votes

I don't think you DO get the zoom scale. Maps are scaled by the map region, which is type MKCoordinateRegion.