[OpenLayers-Trac] [OpenLayers] #3360: TMS getTILEURL evaluatesto same image for different tile bounds when layer extent used and grid crosses dateline

OpenLayers trac-20090302 at openlayers.org
Mon Jun 13 21:34:28 EDT 2011


#3360: TMS getTILEURL evaluatesto  same image for different tile bounds when layer
extent used and grid crosses dateline
----------------------+-----------------------------------------------------
 Reporter:  scaddenp  |       Owner:              
     Type:  bug       |      Status:  new         
 Priority:  major     |   Milestone:  2.12 Release
Component:  general   |     Version:  2.10        
 Keywords:            |       State:              
----------------------+-----------------------------------------------------
 This has a problem if Layer MaxExtent is set (as it needs to be to prevent
 pink tiles), and this is different from baselayer maxExtent, AND dateline
 is present within the grid tiles.

 When a tile is drawn by the SpiralTileLoad which is on the other side of
 the dateline, adjustBounds uses the LAYER maxExtent to adjust the bounds
 rather than BaseLayer. This results in a tile bounds that creates is
 calculated to be same as a real one in the TMS but in completely the wrong
 place.

 Example.
 var mapBounds2 = new OpenLayers.Bounds( 159.999999951, -55.9974599525,
 179.9999999, -29.9999999997);

 var tmsoverlay2 = new OpenLayers.Layer.TMS( "TMS Overlay", "data",
                             {serviceVersion: '', layername: "mage1",
                                                 type: 'png',
  wrapDateLine:true, alpha: true, displayOutsideMaxExtent:true,
 maxExtent:mapBounds2,
 isBaseLayer: false      });




 Looking at getTileURL, I have:

 this.tileOrigin.lon = -20037508.331657
 res = 9783.939619140625
 w = 256

 A good tile with left/right margins of
 left    17532819.703647
 right   20037508.246147

 translates to the correct image.

 However, bounds of:
 left    -25046885.416657
 right   -22542196.874157

 gets turned into:
 left    17254520.971025
 right   19759209.513525

 by the call to adjustBounds.

 This then translates into exactly the image.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3360>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list