Ticket #3025 (closed feature: fixed)

Opened 2 years ago

Last modified 2 years ago

Use restrictedMinZoom in Layer.Bing

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

Description

In Layer.XYZ, we have serverResolutions and zoomOffset to only expose a subset of server resolutions to the OpenLayers client. For Layer.Bing, we need the opposite: the server resolutions don't contain all the resolutions that we have in OpenLayers, but we want to keep the zoom level numbering scheme to have the same zoom levels we have for third-party api layers.

This ticket suggests using the new restricedMinZoom property (introduced with #3024) to accomplish this.

Attachments

openlayers-3025.patch Download (2.3 KB) - added by ahocevar 2 years ago.

Change History

Changed 2 years ago by ahocevar

Changed 2 years ago by ahocevar

  • state set to Review

Note that this patch also allows us to get rid of the hack we used to change the resolution in case initLayer needed to reconfigure the layer with a different maxResolution - we don't change the maxResolution any more:

// adjust zoom level to match the previous resolution - this triggers a
// moveTo on all layers.
resolution && this.map.zoomTo(this.getZoomForResolution(resolution));

With this patch applied, tests still pass in Safari5. Thanks for any review.

Changed 2 years ago by ahocevar

  • owner set to euzuro
  • component changed from general to Layer

Changed 2 years ago by ahocevar

To review this patch, make sure that the patch attached to #3024 is applied first.

Changed 2 years ago by flavour

Thanks ahocevar - these 2 patches fixed the weird behaviour I was seeing with Bing interoperating with OSM/Google layers...haven't seen any new oddnesses...all smooth now :)

Changed 2 years ago by bartvde

  • state changed from Review to Commit

This looks much cleaner now.

When I run Layer.Bing tests in Firefox and IE I am getting the following error, btw this is not caused by this patch it was already there:

this.metadata.resourceSets[0] is undefined
http://localhost/ol_trunk/lib/OpenLayers/Layer/Bing.js
Line 120

However the Bing tests still pass.

The patch looks good, please commit if you can fix the above issue.

Changed 2 years ago by ahocevar

  • status changed from new to closed
  • state changed from Commit to Complete
  • resolution set to fixed

I fixed the test issue by using longer timeouts - seems the Bing metadata service takes longer to respond sometimes.

In w/ r11059

Note: See TracTickets for help on using tickets.