[OpenLayers-Trac] Re: [OpenLayers] #3338: No way to restrict zoom levels

OpenLayers trac-20090302 at openlayers.org
Fri Jun 3 14:08:23 EDT 2011


#3338: No way to restrict zoom levels
------------------------+---------------------------------------------------
 Reporter:  ahocevar    |       Owner:  ahocever    
     Type:  feature     |      Status:  new         
 Priority:  minor       |   Milestone:  2.11 Release
Component:  Layer.Bing  |     Version:  2.10        
 Keywords:              |       State:  Review      
------------------------+---------------------------------------------------
Changes (by ahocevar):

  * state:  Needs More Work => Review


Comment:

 There is no need to introduce a restrictedMinZoom property - we have
 {{{zoomOffset}}} and {{{serverResolutions}}} on the {{{Layer.XYZ}}}
 prototype, and we can make use of it. Well, almost. When calling
 {{{Layer::addOptions}}}, we currently don't make sure that the map is
 reinitialized with the correct options. By adding a new argument to the
 {{{addOptions}}} method, and using this in the {{{Layer.Bing::initLayer}}}
 method, we can always be sure that we get a correct map view. The same
 applies to {{{Layer.GoogleNG}}}, so this patch makes the same changes
 there.

 Note to users: to restrict zoom levels, set a {{{maxResolution}}} and
 {{{numZoomLevels}}} on the layer. This is shown in the new bing-tiles-
 restrictedzoom.html example.

 Note to reviewers: The flesh of this patch is the removal of anything
 related to {{{restrictedMinZoom}}} throughout the library, and a new code
 block in {{{Layer::addOptions}}}. The other important thing is that the
 patch for #3342 needs to be applied before this patch - I guess back then
 when I came up with restrictedMinZoom, #3342 was the issue I wanted to
 work around with it.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3338#comment:3>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list