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

Giovanni Manghi giovanni.manghi at gmail.com
Mon Mar 29 02:36:10 PDT 2021


Hi,

maybe this is related?

https://github.com/3liz/lizmap-web-client/issues/753#issuecomment-359973553

cheers

-- G --



On Mon, Mar 29, 2021 at 8:38 AM Nicolas Boisteault <nboisteault at 3liz.com> wrote:
>
> 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
>
> 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
>
> _______________________________________________
> Lizmap mailing list
> Lizmap at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/lizmap


More information about the Lizmap mailing list