简体   繁体   中英

Is MapKit's scaling behavior broken in the iOS simulator?

I'm working on an app that tries to keep two MKMapView's synchronized with respect to scale. I spent a few days debugging on the iOS simulator, and was getting increasingly frustrated that attempts to set a map view's scale, whether by setting the region or the MapRect, yielded results wildly different than I expected.

When I tried the app on the most convenient iOS device at hand (iPad mini), MapKit was working mostly as expected and I was able to resolve the remaining nuances quickly. At this point, I can get both maps on the device to display identical areas (down to 10m or less in each dimension); on the simulator, setting a map's scale yields a result sometimes off as much as 2x the scale expected.

Has anybody else experienced this disparity between the simulator and the device? If so, any explanation?

Thanks in advance.

the scale of mapkit cannot be set accuratley, neither for one view, nor for both. At least this is valid before ios 6. The reason is that mapkit zooms to the next suitable google resoultion, if you want lets say a scale 5% bigger than the next google map, it will still snap to the google resol.
so up to and including ios 5 it is not possible to programatically zoom to an exact value. (i saw no post that mentioned the behavior in ios 6 apple maps)

So in your case, one view could match one of the 16 google zoom levels, while the other view falls in another zoom level.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM