<div dir="ltr"><div><div>Hi,<br>- The swipe control is working only with the ol 2.13 dev, since map.layerContainerOriginPx has been introduced recently by <a href="https://github.com/openlayers/openlayers/commit/f0ad48597fec4bbf4d1b882235e21cf787fb77ec">https://github.com/openlayers/openlayers/commit/f0ad48597fec4bbf4d1b882235e21cf787fb77ec</a><br>

</div>- The top layer is always "swiped" (and only the top layer)<br></div>Best regards,<br>Cédric<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 11, 2013 at 11:07 AM, Gabriel Vatin <span dir="ltr"><<a href="mailto:gabriel.vatin@mines-paristech.fr" target="_blank">gabriel.vatin@mines-paristech.fr</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>

  
    
  
  <div text="#000000" bgcolor="#ffffff">
    Hi Cédric,<br>
    <br>
    Thank you for this amazing control ! Yet I have a few questions
    about it :<br>
    <br>
    - 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 : <i><span><span>this.map.layerContainerOriginPx
          is undefined</span></span></i><br>
    Have you tried it with these versions of OL ?<br>
    <br>
    - 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 ?<br>
    <br>
    Thanks for this !<br>
    <br>
    Gabriel<div><div class="h5"><br>
    <br>
    On 10/02/2013 06:06, Cédric MOULLET wrote:
    </div></div><blockquote type="cite"><div><div class="h5">
      <div dir="ltr">
        <div>Hi,<br>
          A pure OpenLayers example can be shown here: <a href="http://mf-chsdi0i.bgdi.admin.ch/main/wsgi/GeoAdmin.ux/Swipe/examples/openlayers_swipe.html" target="_blank">http://mf-chsdi0i.bgdi.admin.ch/main/wsgi/GeoAdmin.ux/Swipe/examples/openlayers_swipe.html</a><br>


          <br>
          The source code is here: <a href="http://docs.google.com/uc?export=download&id=0B_gmqEgDEiu5WGRGVDRQd281UVE" target="_blank">http://docs.google.com/uc?export=download&id=0B_gmqEgDEiu5WGRGVDRQd281UVE</a><br>


          <br>
          Swipe can be used in the following way:<br>
          <br>
          <span style="font-family:courier new,monospace">var map =
            new OpenLayers.Map("map");<br>
            <br>
            var ol_wms = new OpenLayers.Layer.WMS(<br>
                "OpenLayers WMS",<br>
                "<a href="http://vmap0.tiles.osgeo.org/wms/vmap0" target="_blank">http://vmap0.tiles.osgeo.org/wms/vmap0</a>",<br>
                {layers: "basic"}<br>
            );<br>
            <br>
            var dm_wms = new OpenLayers.Layer.WMS(<br>
                "Canadian Data",<br>
                "<a href="http://www2.dmsolutions.ca/cgi-bin/mswms_gmap" target="_blank">http://www2.dmsolutions.ca/cgi-bin/mswms_gmap</a>",<br>
                {<br>
                    layers: "bathymetry,land_fn,park,drain_fn,drainage,"
            +<br>
                            "prov_bound,fedlimit,rail,road,popplace",<br>
                    transparent: "true",<br>
                    format: "image/png"<br>
                },<br>
                {isBaseLayer: false, visibility: true}<br>
            );<br>
            <br>
            map.addLayers([ol_wms, dm_wms]);<br>
            var swipe = new OpenLayers.Control.Swipe({map: map});<br>
            map.addControls([new
            OpenLayers.Control.LayerSwitcher(),swipe]);<br>
            swipe.activate();<br>
            map.zoomToMaxExtent();<br>
          </span><br>
          Swipe control works also on mobile. <br>
          <br>
        </div>
        Hope this helps,<br>
        Cédric<br>
        <div><br>
          <br>
          <br>
          <br>
          <br>
        </div>
      </div>
      </div></div><pre><fieldset></fieldset>
_______________________________________________
Users mailing list
<a href="mailto:Users@lists.osgeo.org" target="_blank">Users@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a>
</pre>
    </blockquote>
  </div>

</blockquote></div><br><br clear="all"><br>-- <br><div>Political blog: <a href="http://cedricmoullet.blogspot.com/" target="_blank">http://cedricmoullet.blogspot.com/</a><br>Welcome to my world: <a href="http://www.cedricmoullet.com/" target="_blank">http://www.cedricmoullet.com/</a><br>

My Linked In profile: <a href="http://www.linkedin.com/in/cedricmoullet" target="_blank">http://www.linkedin.com/in/cedricmoullet</a><br>Twitter: <a href="http://twitter.com/cedricmoullet" target="_blank">http://twitter.com/cedricmoullet</a></div>


<div>Home sweet home: <a href="http://map.geo.admin.ch/?crosshair=bowl&zoom=11&X=185241.24219&Y=561288.90625&bgOpacity=0&selectedNode=node_ch.swisstopo.fixpunkte-lage1" target="_blank">http://map.geo.admin.ch/?crosshair=bowl&zoom=11&X=185241.24219&Y=561288.90625&bgOpacity=0&selectedNode=node_ch.swisstopo.fixpunkte-lage1</a></div>


</div>