]> dev.renevier.net Git - syj.git/blob - patches/openlayers/0002-xyz-wrapdateline-fixes-2246.patch
make installation process more simple
[syj.git] / patches / openlayers / 0002-xyz-wrapdateline-fixes-2246.patch
1 From f738bc5fed1dbc67177cdd7066713ee68bcf8df8 Mon Sep 17 00:00:00 2001
2 From: arno <arno@renevier.net>
3 Date: Mon, 21 Mar 2011 19:57:20 +0100
4 Subject: [PATCH 2/5] xyz-wrapdateline: fixes #2246
5
6 ---
7  openlayers/lib/OpenLayers/Layer/XYZ.js |    6 ++++++
8  1 files changed, 6 insertions(+), 0 deletions(-)
9
10 diff --git a/openlayers/lib/OpenLayers/Layer/XYZ.js b/openlayers/lib/OpenLayers/Layer/XYZ.js
11 index d8cbf53..95769bb 100644
12 --- a/openlayers/lib/OpenLayers/Layer/XYZ.js
13 +++ b/openlayers/lib/OpenLayers/Layer/XYZ.js
14 @@ -147,6 +147,12 @@ OpenLayers.Layer.XYZ = OpenLayers.Class(OpenLayers.Layer.Grid, {
15          var z = this.serverResolutions != null ?
16              OpenLayers.Util.indexOf(this.serverResolutions, res) :
17              this.map.getZoom() + this.zoomOffset;
18 +        var limit = Math.pow(2, z);
19 +
20 +        if (this.wrapDateLine)
21 +        {
22 +            x = ((x % limit) + limit) % limit;
23 +        }
24  
25          return {'x': x, 'y': y, 'z': z};
26      },
27 -- 
28 1.7.4.1
29