<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi,</p>
    <p>Did you try to add the layer in QGIS and set it as a base layer
      in Lizmap plugin?<br>
    </p>
    <div class="moz-cite-prefix">Le 26/03/2021 à 13:10,
      <a class="moz-txt-link-abbreviated" href="mailto:igor.buczak@envirosolutions.pl">igor.buczak@envirosolutions.pl</a> a écrit :<br>
    </div>
    <blockquote type="cite"
      cite="mid:e89abc46876fd9e161301c77675523c1@envirosolutions.pl">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div><span>Hi, </span></div>
      <div><span>I'm using LizMap in versions 3.4.0 to 3.4.2 and I would
          like to add a WMS/WMTS baselayer using JavaScript. </span></div>
      <div><span>The problem is when I set projection for the layer
          other than lizMap.map.projection ('EPSG:3857') - I can't see
          requested WMS/WMTS image, because map object send request
          using coordinates from map projection.</span></div>
      <div><span> </span></div>
      <div><span>For example, adding WMS baselayer:</span></div>
      <div dir="ltr" style="padding-left: 40px;"><span style="color:
          #ff0000;"><em>wmsLayer = new OpenLayers.Layer.WMS("testWMS",</em></span></div>
      <div dir="ltr" style="padding-left: 40px;"><span style="color:
          #ff0000;"><em>    <a class="moz-txt-link-rfc2396E" href="http://vmap0.tiles.osgeo.org/wms/vmap0">"http://vmap0.tiles.osgeo.org/wms/vmap0"</a>, {</em></span></div>
      <div dir="ltr" style="padding-left: 40px;"><span style="color:
          #ff0000;"><em>        layers: 'basic'</em></span></div>
      <div dir="ltr" style="padding-left: 40px;"><span style="color:
          #ff0000;"><em>    }, {</em></span></div>
      <div dir="ltr" style="padding-left: 40px;"><span style="color:
          #ff0000;"><em> isBaseLayer: true</em></span></div>
      <div dir="ltr" style="padding-left: 40px;"><span style="color:
          #ff0000;"><em> , projection : new
            OpenLayers.Projection('EPSG:4269')</em></span></div>
      <div dir="ltr" style="padding-left: 40px;"><span style="color:
          #ff0000;"><em> , gutter: 5</em></span></div>
      <div dir="ltr" style="padding-left: 40px;"><span style="color:
          #ff0000;"><em> , buffer : 0</em></span></div>
      <div dir="ltr" style="padding-left: 40px;"><span style="color:
          #ff0000;"><em> , singleTile : true</em></span></div>
      <div dir="ltr" style="padding-left: 40px;"><span style="color:
          #ff0000;"><em> , ratio : 1</em></span></div>
      <div dir="ltr" style="padding-left: 40px;"><span style="color:
          #ff0000;"><em> });</em></span></div>
      <div dir="ltr" style="padding-left: 40px;"><span style="color:
          #ff0000;"><em>lizMap.map.addLayer(wmsLayer);</em></span></div>
      <div dir="ltr" style="padding-left: 40px;"><span style="color:
          #ff0000;"><em>lizMap.baselayers.push(wmsLayer)</em></span></div>
      <div dir="ltr" style="padding-left: 40px;"><span style="color:
          #ff0000;"><em>var newOption = $(`<option
            value="testWMS">testWMS</option>`)</em></span></div>
      <div dir="ltr" style="padding-left: 40px;"><span style="color:
          #ff0000;"><em>$('#switcher-baselayer-select').append(newOption);</em></span></div>
      <div dir="ltr" style="padding-left: 40px;"><span style="color:
          #ff0000;"><em>var blName =
            lizMap.map.getLayersByName('testWMS')[0];</em></span></div>
      <div dir="ltr" style="padding-left: 40px;"><span style="color:
          #ff0000;"><em>lizMap.map.setBaseLayer(blName);</em></span></div>
      <div dir="ltr" style="padding-left: 40px;"> </div>
      <div><span>When added baselayer is active, map request for the
          image:</span></div>
      <div style="padding-left: 40px;"><em><a
href="http://vmap0.tiles.osgeo.org/wms/vmap0?LAYERS=basic&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&FORMAT=image%2Fjpeg&SRS=EPSG%3A4269&BBOX=2167809.179245145,6482785.2942039985,2167846.6513039283,6482820.48957395&WIDTH=1004&HEIGHT=943"
            moz-do-not-send="true">http://vmap0.tiles.osgeo.org/wms/vmap0?LAYERS=basic&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&FORMAT=image%2Fjpeg&SRS=EPSG%3A4269&BBOX=<span>2012355.2261495434,6338336.899867127,2323301.0571703566,6627268.866744874</span>&WIDTH=1004&HEIGHT=943</a></em></div>
      <div style="padding-left: 40px;"> </div>
      <div>But it won't work, because requested BBOX (<span
          style="text-decoration: underline;"><em>2012355.2261495434,6338336.899867127,2323301.0571703566,6627268.866744874</em></span>)
        is wrong, it should be (<span><span style="text-decoration:
            underline;">18.0772944,49.3726875,20.87056861,51.03376694</span>):</span></div>
      <div style="padding-left: 40px;"><span><a
href="http://vmap0.tiles.osgeo.org/wms/vmap0?LAYERS=basic&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&FORMAT=image%2Fjpeg&SRS=EPSG%3A4269&BBOX=18.0772944,49.3726875,20.87056861,51.03376694&WIDTH=1004&HEIGHT=943"
            moz-do-not-send="true">http://vmap0.tiles.osgeo.org/wms/vmap0?LAYERS=basic&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&FORMAT=image%2Fjpeg&SRS=EPSG%3A4269&BBOX=18.0772944,49.3726875,20.87056861,51.03376694&WIDTH=1004&HEIGHT=943</a></span></div>
      <div style="padding-left: 40px;"> </div>
      <div>Is there any way to add WMS/WMTS served in a different
        coordinate system?</div>
      <div> </div>
      <div>Thanks in advance for any help,<br>
        Igor</div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Lizmap mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Lizmap@lists.osgeo.org">Lizmap@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/lizmap">https://lists.osgeo.org/mailman/listinfo/lizmap</a>
</pre>
    </blockquote>
  </body>
</html>