Ticket #2987 (closed bug: fixed)

Opened 4 years ago

Last modified 4 years ago

Bing layer's zoom level may be incorrect

Reported by: ahocevar Owned by: euzuro
Priority: minor Milestone: 2.11 Release
Component: Layer Version: SVN
Keywords: Cc:
State: Complete


Because the Bing layer may set its final resolutions array after it is added to the map and the map is rendered, there is a chance that, if it is a base layer, overlays won't align because they are still rendered at a different zoom level. The solution is to call map.zoomTo in the initLayer method, as soon as we have the final resolutions.


openlayers-2987.patch Download (5.5 KB) - added by ahocevar 4 years ago.

Change History

Changed 4 years ago by ahocevar

  • state set to Review
  • version changed from 2.10 to SVN

The above patch fixes the issue. It comes with comprehensive tests that show the issue. Tests pass after applying the patch. Thanks for any review.

Changed 4 years ago by ahocevar

Changed 4 years ago by ahocevar

Note that this patch also simplifies the way we set the resolutions: instead of maintaining a resolutions array, we just need the maxResolution, because we can calculate each resolution from the maxResolution: maxResolution / Math.pow(2, zoomLevel)

Changed 4 years ago by ahocevar

  • type changed from feature to bug
  • summary changed from Bing layer displays at incorrect zoom level with overlays to Bing layer's zoom level may be incorrect

Changed 4 years ago by tschaub

  • state changed from Review to Commit

Thanks for the continued work on this. Assuming tests pass, please commit.

Changed 4 years ago by ahocevar

  • status changed from new to closed
  • state changed from Commit to Complete
  • resolution set to fixed
Note: See TracTickets for help on using tickets.