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

Géoplateforme PCRS layer not working ? #1033

Open
Mysterius opened this issue Feb 28, 2024 · 1 comment
Open

Géoplateforme PCRS layer not working ? #1033

Mysterius opened this issue Feb 28, 2024 · 1 comment
Labels

Comments

@Mysterius
Copy link

Mysterius commented Feb 28, 2024

Hello,

I've been trying to make the work-in-progress PCRS layer display in Openlayers using ol-ext but I can't get it to work.
Using this very simple code taken from the Geoportail example doesn't work.

ol.layer.Geoportail.register("PCRS.LAMB93", {"layer":"PCRS.LAMB93","theme":"parcellaire","desc":"Données du Plan Corps de Rue Simplifié","server":"https://data.geopf.fr/wmts","bbox":[-5,40,10,52],"format":"image/jpeg","tilematrix":"PM","minZoom":6,"maxZoom":22,"originators":{"Geoservices":{"attribution":"Géoservices","href":"https://geoservices.ign.fr/"}},"queryable":true,"style":"normal","tilematrix":"PM","title":"PCRS","legend":["http://ign.fr"]});

var testLayer = new ol.layer.Geoportail({ layer: 'PCRS.LAMB93' });

I get this error :

TileMatrixSet PM inconnu pour le layer.

It seems to me that ol-ext or Openlayers cannot recognize the matrix used. It's not PM but, according to the GetCapabilities document, LAMB93_5cm.

I tried replacing "tilematrix":"PM" with "tilematrix":"LAMB93_5cm" in the register function to no avail.
I also tried using the vanilla openlayers WMTS implementation but wasn't able to find how to make it work either because I'm not very knowledgeable about tile matrixes.

@Viglino
Copy link
Owner

Viglino commented Feb 29, 2024

The issue is the ol/layer/Geoportail only support PM tilematrix and EPSG:3857 projection.
If you want to use another projections you have to set your own WMTS layer.
You also have to load the projection definition (using proj4) and your map must be in this projection (or compatible).

Maybe you can use the WMTSCapabilities to help you defining the source: https://viglino.github.io/ol-ext/examples/layer/map.wmtscapabilities.html
You have to add the supported projection to the control:

ol.control.WMSCapabilities.prototype.supportedSets.push('LAMB93_5cm')

In the debuger you can see the result but you have to set the correct tileGrid for the projection...

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

No branches or pull requests

2 participants