This article has been archived and is no longer updated by Apple.

iAd Producer 3: MapView region may not have correct centerpoint

Trying to set the visible region on a map might not establish a correct centerpoint.

This depends on a combination of:

  • The size of the MapView in use (pixels wide by pixels tall)

  • The requested visible region

When this issue occurs, the requested visible region's longitudeDelta is larger than what can be displayed by the map in use. This maximum longitudeDelta will change depending on what section of geography is in the region.

If an author is affected by the issue, there is a potential workaround for their specific content, but the workaround must be tailored to the size of the map in use. There are a couple of ways to determine the workaround's specific maximum value in content:

  • Monitor the MapView's "mapViewRegionDidChange" notification to inspect the resulting region when content is visibly affected by this issue. The longitudeDelta value of the map's region has been automatically limited by the view, and this value should be used as a maximum limit for subsequent region changes.

  • Investigate the MapView manually via JavaScript and the Remote Web Inspector while authoring the content. This requires manually changing the visible region in the MapView (with your fingers on a device or via the pinch/zoom keyboard modifiers on iOS Simulator). Change the visible region so that it is zoomed out all the way (displaying the most geography), and panned all the way to either the North or South polar boundary. The MapView's region property's longitudeDelta value will be at its upper limit for this pixel size, and this value should be used as a maximum limit for subsequent region changes.

Published Date: