<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body 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
        role="presentation" class="objectBox objectBox-errorMessage
        hasBreakSwitch "><span class="errorMessage ">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<br>
    <br>
    On 10/02/2013 06:06, Cédric MOULLET wrote:
    <blockquote
cite="mid:CABcS5EHwYwMrNb4Bm2taOR24eCi1RqtuH-YKMmRUNdut8_VnLg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Hi,<br>
          A pure OpenLayers example can be shown here: <a
            moz-do-not-send="true"
href="http://mf-chsdi0i.bgdi.admin.ch/main/wsgi/GeoAdmin.ux/Swipe/examples/openlayers_swipe.html">http://mf-chsdi0i.bgdi.admin.ch/main/wsgi/GeoAdmin.ux/Swipe/examples/openlayers_swipe.html</a><br>
          <br>
          The source code is here: <a moz-do-not-send="true"
href="http://docs.google.com/uc?export=download&id=0B_gmqEgDEiu5WGRGVDRQd281UVE">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 moz-do-not-send="true"
              href="http://vmap0.tiles.osgeo.org/wms/vmap0">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 moz-do-not-send="true"
              href="http://www2.dmsolutions.ca/cgi-bin/mswms_gmap">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>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a>
</pre>
    </blockquote>
  </body>
</html>