[Lizmap] Adding external WMS/WMTS to lizMap.map object

Nicolas Boisteault nboisteault at 3liz.com
Mon Mar 29 00:38:27 PDT 2021


Hi,

Did you try to add the layer in QGIS and set it as a base layer in 
Lizmap plugin?

Le 26/03/2021 à 13:10, igor.buczak at envirosolutions.pl a écrit :
> Hi,
> 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.
> 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.
> For example, adding WMS baselayer:
> /wmsLayer = new OpenLayers.Layer.WMS("testWMS",/
> /    "http://vmap0.tiles.osgeo.org/wms/vmap0", {/
> /        layers: 'basic'/
> /    }, {/
> /isBaseLayer: true/
> /, projection : new OpenLayers.Projection('EPSG:4269')/
> /, gutter: 5/
> /, buffer : 0/
> /, singleTile : true/
> /, ratio : 1/
> /});/
> /lizMap.map.addLayer(wmsLayer);/
> /lizMap.baselayers.push(wmsLayer)/
> /var newOption = $(`<option value="testWMS">testWMS</option>`)/
> /$('#switcher-baselayer-select').append(newOption);/
> /var blName = lizMap.map.getLayersByName('testWMS')[0];/
> /lizMap.map.setBaseLayer(blName);/
> When added baselayer is active, map request for the image:
> /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=2012355.2261495434,6338336.899867127,2323301.0571703566,6627268.866744874&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=2167809.179245145,6482785.2942039985,2167846.6513039283,6482820.48957395&WIDTH=1004&HEIGHT=943>/
> But it won't work, because requested BBOX 
> (/2012355.2261495434,6338336.899867127,2323301.0571703566,6627268.866744874/) 
> is wrong, it should be (18.0772944,49.3726875,20.87056861,51.03376694):
> 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
> Is there any way to add WMS/WMTS served in a different coordinate system?
> Thanks in advance for any help,
> Igor
>
> _______________________________________________
> Lizmap mailing list
> Lizmap at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/lizmap
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/lizmap/attachments/20210329/a6ec32a0/attachment.html>


More information about the Lizmap mailing list