[OpenLayers-Users] OpenLayers.Control.Swipe

Gabriel Vatin gabriel.vatin at mines-paristech.fr
Tue Feb 12 01:03:59 PST 2013


This change in Swipe.js code works great, thank you !

Gabriel

On 11/02/2013 21:34, Arnd Wippermann wrote:
> 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
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users


More information about the Users mailing list