[OpenLayers-Users] OpenLayers.Control.Swipe

Arnd Wippermann arnd.wippermann at web.de
Mon Feb 11 12:34:03 PST 2013


I used a second way to persuade the SwipeControl to work with 
OpenLayers 2.10 and above in a simple example.

I changed Line 402 and 404 in Swipe.js, function clipFirstLayer,

from

var top = -this.map.layerContainerOriginPx.y;
...
var left = -this.map.layerContainerOriginPx.x;

to
var top = -parseInt(this.map.layerContainerDiv.style.top);
...
var left = -parseInt(this.map.layerContainerDiv.style.left);

Perhaps it's not the solution, that will work for more complex maps.

Arnd

 

-----Ursprüngliche Nachricht-----
Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von
Sergeant_york
Gesendet: Montag, 11. Februar 2013 20:48
An: openlayers-users at lists.osgeo.org
Betreff: Re: [OpenLayers-Users] OpenLayers.Control.Swipe

Actually with a bit javascript hackish method you can also make it works
great for 2.11 and 2.12 after initializing map:
       /*map initialization here*/
	map.layerContainerOriginPx=new Object();
	map.layerContainerOriginPx.x=0;//these x and y are the starting
point of your map's div I guess
	map.layerContainerOriginPx.y=0;//if it is fullscreen map then x and
y should be 0
       /*codes like in above example*/



--
View this message in context:
http://osgeo-org.1560.n6.nabble.com/OpenLayers-Control-Swipe-tp5032742p50335
46.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list