<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<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>    "http://vmap0.tiles.osgeo.org/wms/vmap0", {</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">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">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>

</body></html>