Hi, - The swipe control is working only with the ol 2.13 dev, since map.layerContainerOriginPx has been introduced recently by https://github.com/openlayers/openlayers/commit/f0ad48597fec4bbf4d1b882235e21cf787fb77ec - The top layer is always "swiped" (and only the top layer) Best regards, Cédric
On Mon, Feb 11, 2013 at 11:07 AM, Gabriel Vatin < [email protected]> wrote: > ** > Hi Cédric, > > Thank you for this amazing control ! Yet I have a few questions about it : > > - in you examples, you use OpenLayers 2.13 (dev branch of OL). I tried it > with my local copy of OL, the 2.11 version, and the 2.12 version, but I > still have the same error : *this.map.layerContainerOriginPx is undefined* > Have you tried it with these versions of OL ? > > - I don't really undestand which layers it shows / hide : is it all the > visible layers on the left side, and just the base layer on the right side, > or can we select the layers to hide ? > > Thanks for this ! > > Gabriel > > > On 10/02/2013 06:06, Cédric MOULLET wrote: > > Hi, > A pure OpenLayers example can be shown here: > http://mf-chsdi0i.bgdi.admin.ch/main/wsgi/GeoAdmin.ux/Swipe/examples/openlayers_swipe.html > > The source code is here: > http://docs.google.com/uc?export=download&id=0B_gmqEgDEiu5WGRGVDRQd281UVE > > Swipe can be used in the following way: > > var map = new OpenLayers.Map("map"); > > var ol_wms = new OpenLayers.Layer.WMS( > "OpenLayers WMS", > "http://vmap0.tiles.osgeo.org/wms/vmap0", > {layers: "basic"} > ); > > var dm_wms = new OpenLayers.Layer.WMS( > "Canadian Data", > "http://www2.dmsolutions.ca/cgi-bin/mswms_gmap", > { > layers: "bathymetry,land_fn,park,drain_fn,drainage," + > "prov_bound,fedlimit,rail,road,popplace", > transparent: "true", > format: "image/png" > }, > {isBaseLayer: false, visibility: true} > ); > > map.addLayers([ol_wms, dm_wms]); > var swipe = new OpenLayers.Control.Swipe({map: map}); > map.addControls([new OpenLayers.Control.LayerSwitcher(),swipe]); > swipe.activate(); > map.zoomToMaxExtent(); > > Swipe control works also on mobile. > > Hope this helps, > Cédric > > > > > > > _______________________________________________ > Users mailing > [email protected]http://lists.osgeo.org/mailman/listinfo/openlayers-users > > -- Political blog: http://cedricmoullet.blogspot.com/ Welcome to my world: http://www.cedricmoullet.com/ My Linked In profile: http://www.linkedin.com/in/cedricmoullet Twitter: http://twitter.com/cedricmoullet Home sweet home: http://map.geo.admin.ch/?crosshair=bowl&zoom=11&X=185241.24219&Y=561288.90625&bgOpacity=0&selectedNode=node_ch.swisstopo.fixpunkte-lage1
_______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
