Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not working for QGIS server WMTS #29

Open
mosikh opened this issue Dec 22, 2023 · 0 comments
Open

not working for QGIS server WMTS #29

mosikh opened this issue Dec 22, 2023 · 0 comments

Comments

@mosikh
Copy link

mosikh commented Dec 22, 2023

Hello,
I need to show some WMTSs offered by QGIS server on leaflet map. Unfortunately, your module doesn't support QGIS server WMTS. Could you please let me know if there is another solution? or could you please update this module to get usable for QGIS server WMTS.

It is my code:

<script src="https://rawgithub.com/mylen/leaflet.TileLayer.WMTS/master/leaflet-tilelayer-wmts.js"></script>

var qgisUrl = 'http://localhost/cgi-bin/qgis_mapserv.fcgi.exe?MAP=C:/Users/mkheyrollahi/Downloads/221103-BBVPlanauskunftServer-v3.qgs';

var ign = new L.TileLayer.WMTS(qgisUrl,
{
layer: 'Bretten',
tilematrixSet: "EPSG:3857",
format: "image/png",
attribution: "attribution",
}
);

map.addLayer(ign);

The error that I get several times during the navigation on my leaflet map is as follows:

GET http://localhost/cgi-bin/qgis_mapserv.fcgi.exe?MAP=C:/Users/mkheyrollahi/Downloads/221103-BBVPlanauskunftServer-v3.qgs&service=WMTS&request=GetTile&version=1.0.0&layer=Bretten&style=&tilematrixset=EPSG%3A3857&format=image%2Fpng&height=256&width=256&tilematrix=EPSG:3857:8&tilerow=87&tilecol=135 400 (Bad Request)

When I open the link in the error message, I get this error there:
TILEMATRIX ('EPSG:3857:8') cannot be converted into int

QGIS server WMTS accepts usually just one integer number for tilematrix. Otherwise, it doesn't work.

By the way, the provided WMTS works well with no error on browser and Openlayers environment.

On the other hand, I used this module with the same code, too:

<script src="https://unpkg.com/leaflet-tilelayer-wmts/dist/leaflet-tilelayer-wmts.js"></script>

This module is a bit better but not good enough. It shows my WMTS layer partially and randomly on some zoom levels with no logic. The performance is poor. It sometimes shows half of the layer, sometimes the whole layer and sometimes nothing.
It gives this error several times when navigating on the leaflet map:

GET http://localhost/cgi-bin/qgis_mapserv.fcgi.exe?MAP=C:/Users/mkheyrollahi/Downloads/221103-BBVPlanauskunftServer-v3.qgs&service=WMTS&request=GetTile&version=1.0.0&layer=Bretten&style=&tilematrixSet=EPSG%3A3857&format=image%2Fpng&height=256&width=256&attribution=dd&zIndex=1000&tilematrix=8&tilerow=173&tilecol=270 400 (Bad Request)

When I open the link in the error message, I get this error there:
TileCol is unknown

Thanks for your time and consideration.

Best regards,
Mostafa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant