[Lizmap] Adding external WMS/WMTS to lizMap.map object
michal.wloga at envirosolutions.pl
michal.wloga at envirosolutions.pl
Mon Mar 29 06:07:46 PDT 2021
Hi,
To clarify, the problem described by Igor has nothing in common with backend. The idea is to allow user add a temporary WMS/WMTS layer through web interface.
It may be also an OpenLayers v2 issue.
Lizmap(or OLv2) forces bbox parameter of GetMap request in project's CRS even if SRS/CRS parameter is defined different.
Without defining projection it will work ONLY IF service supports project's CRS.
We need some kind of in-fly-reprojection.
E.g. Lizmap project is in EPSG:4326 but WMS service is in EPSG:2180 and EPSG:3857. Is there a way to use it without using backend (QGIS server)?
Regards,
EnviroSolutions Sp. z o. o.
Michał Włoga
tel: +48 607 059 157
coo at envirosolutions.pl
www.envirosolutions.pl
Pobieracz Danych GUGiK – laureat nagrody GUGiK na najlepsze wykorzystanie danych i usług GUGiK w 2020 r.
-----Original Message-----
From: Lizmap [mailto:lizmap-bounces at lists.osgeo.org] On Behalf Of Giovanni Manghi
Sent: Monday, March 29, 2021 11:36 AM
To: Nicolas Boisteault <nboisteault at 3liz.com>
Cc: lizmap at lists.osgeo.org
Subject: Re: [Lizmap] Adding external WMS/WMTS to lizMap.map object
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
_______________________________________________
Lizmap mailing list
Lizmap at lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/lizmap
More information about the Lizmap
mailing list