Adding wrapDateLine support for XYZ layers. The OSM layer now wraps the date line by default. p=tomh, r=me (Closes #2246)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11864 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -148,6 +148,12 @@ OpenLayers.Layer.XYZ = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
OpenLayers.Util.indexOf(this.serverResolutions, res) :
|
||||
this.map.getZoom() + this.zoomOffset;
|
||||
|
||||
var limit = Math.pow(2, z);
|
||||
if (this.wrapDateLine)
|
||||
{
|
||||
x = ((x % limit) + limit) % limit;
|
||||
}
|
||||
|
||||
return {'x': x, 'y': y, 'z': z};
|
||||
},
|
||||
|
||||
@@ -199,5 +205,6 @@ OpenLayers.Layer.OSM = OpenLayers.Class(OpenLayers.Layer.XYZ, {
|
||||
obj = OpenLayers.Layer.XYZ.prototype.clone.apply(this, [obj]);
|
||||
return obj;
|
||||
},
|
||||
wrapDateLine: true,
|
||||
CLASS_NAME: "OpenLayers.Layer.OSM"
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user