X-Git-Url: https://dev.renevier.net/?p=syj.git;a=blobdiff_plain;f=patches%2Fopenlayers%2F0002-xyz-wrapdateline-fixes-2246.patch;fp=patches%2Fopenlayers%2F0002-xyz-wrapdateline-fixes-2246.patch;h=9ff45dd6fd0b4038e8fda480d76ad22973b90730;hp=0000000000000000000000000000000000000000;hb=b602b39eea6db7f6d9b912eb6d7c680156ac9d97;hpb=b27131a4de0a72fad65ac9ad370163dba5fce1ad diff --git a/patches/openlayers/0002-xyz-wrapdateline-fixes-2246.patch b/patches/openlayers/0002-xyz-wrapdateline-fixes-2246.patch new file mode 100644 index 0000000..9ff45dd --- /dev/null +++ b/patches/openlayers/0002-xyz-wrapdateline-fixes-2246.patch @@ -0,0 +1,29 @@ +From f738bc5fed1dbc67177cdd7066713ee68bcf8df8 Mon Sep 17 00:00:00 2001 +From: arno +Date: Mon, 21 Mar 2011 19:57:20 +0100 +Subject: [PATCH 2/5] xyz-wrapdateline: fixes #2246 + +--- + openlayers/lib/OpenLayers/Layer/XYZ.js | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) + +diff --git a/openlayers/lib/OpenLayers/Layer/XYZ.js b/openlayers/lib/OpenLayers/Layer/XYZ.js +index d8cbf53..95769bb 100644 +--- a/openlayers/lib/OpenLayers/Layer/XYZ.js ++++ b/openlayers/lib/OpenLayers/Layer/XYZ.js +@@ -147,6 +147,12 @@ OpenLayers.Layer.XYZ = OpenLayers.Class(OpenLayers.Layer.Grid, { + var z = this.serverResolutions != null ? + 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}; + }, +-- +1.7.4.1 +