[OpenLayers-Trac] [OpenLayers] #1243: allow for non-discrete resolution/zoom levels (fractional zoom)

OpenLayers trac at openlayers.org
Thu Jan 10 10:16:49 EST 2008


#1243: allow for non-discrete resolution/zoom levels (fractional zoom)
----------------------+-----------------------------------------------------
  Reporter:  tschaub  |       Owner:  tschaub 
      Type:  feature  |      Status:  assigned
  Priority:  minor    |   Milestone:          
 Component:  Map      |     Version:  2.5     
Resolution:           |    Keywords:          
     State:           |  
----------------------+-----------------------------------------------------
Comment (by elemoine):

 Replying to [comment:6 tschaub]:
 > I think this is a fairly non-invasive change to get this functionality.
 The things it does change aren't liable to haunt us (in my opinion).  If
 an app designer sets map.fractionalZoom to true, they should know not to
 access layer.resolutions[zoom] directly.
 >
 > I added a map.allowFracZoom method.  I don't necessarily like this, but
 it makes things degrade well for commercial layers.  The part I don't like
 is the check for a RESOLUTIONS constant.  But I like less the alternative
 of modifying anything in the FixedZoomLevels layers.
 >
 > (As an aside, I'm also curious about the this.resolutions != null checks
 in FixedZoomLevels.  Since all the classes in our lib that inherit from
 FZL have a RESOLUTIONS constant, and initResolutions sets resolutions, I
 don't immediately see when this condition would ever be met.  But I'll
 leave that for elsewhere.)

 ----

 Tim,

 Some questions/comments on your patch:

  * the getResolutionForZoom method of the Map class checks whether that a
 method of the same name is defined on the base layer. Since the
 getResolutionForZoom method is part of the generic Layer class, I don't
 see how this condition wouldn't be met.

  * I'm also not a big fan of the RESOLUTIONS check in allowFracZoom. Why
 not define the new property allowFracZoom in the Layer class and have the
 !FixedZoomLevels class set this property to false? In that way, layers
 that don't permit fractional zoom can advertize it - the !TileCache layer
 might be of those classes by the way, and this isn't caught by your
 RESOLUTIONS check (I'm not too familiar with the !TileCache layer and be
 cautious with my assessments :-)

  * Line 820 of the patch, you use the i variable while it was defined
 outside the current scope in the for loop above.

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


More information about the Trac mailing list