OkMap forum
OkMap forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 OkMap Forum - English
 Use of the software
 To add an entry in Map Servers Menu
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jeanmarc93

France
26 Posts

Posted - 09/01/2022 :  16:03:41  Show Profile  Reply with Quote
Good morning,
I'd like to add a IGN WMS entry
Here is the function used by MOBAC
String getTileUrl(int Zoom, int X, int Y) {
return Myurl + Mykey + Myfolder + "?Layer=" + Mylayer + "&Style=" + Mystyle + "&Tilematrixset=" + Mytilematrixset + "&Service=" + Myservice + "&Request=" + Myrequest + "&Version=" + Myversion + "&Format=" + Myformat + "&TileMatrix=" + Zoom + "&TileCol=" + X + "&TileRow=" + Y;
}
. May I have the Code dedicated to France IGN Plan V2 to get an example of Code
. How could I specify the User-Agent in the Code dedicated to this new entry ?
Regards,
Jean-Marc

Edited by - jeanmarc93 on 09/01/2022 17:26:48

okmap

Italy
2572 Posts

Posted - 09/01/2022 :  18:56:50  Show Profile  Visit okmap's Homepage  Reply with Quote
Is this the map?
https://openlayers.org/en/latest/examples/wmts-ign.html
Go to Top of Page

jeanmarc93

France
26 Posts

Posted - 10/01/2022 :  09:15:26  Show Profile  Reply with Quote
Yes, it is
Go to Top of Page

okmap

Italy
2572 Posts

Posted - 10/01/2022 :  10:16:09  Show Profile  Visit okmap's Homepage  Reply with Quote
Already exists in OkMap Desktop database.
It's named "France IGN Plan v2".
Go to Top of Page

jeanmarc93

France
26 Posts

Posted - 10/01/2022 :  18:51:16  Show Profile  Reply with Quote
I want to use this map as template to create a new entry in MapServers.xml file for France IGN Topographic
What would be the parameters for the key (my IGN identifier) and the User-Agent ?
Go to Top of Page

okmap

Italy
2572 Posts

Posted - 11/01/2022 :  09:49:07  Show Profile  Visit okmap's Homepage  Reply with Quote
Please give me the URL to get capabilities.
Go to Top of Page

jeanmarc93

France
26 Posts

Posted - 11/01/2022 :  17:30:23  Show Profile  Reply with Quote
http://wxs.ign.fr/<CLEF>/geoportail/wmts/?Layer=GEOGRAPHICALGRIDSYSTEMS.MAPS&Style=normal&Tilematrixset=PM&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fjpeg&TileMatrix=Zoom&TileCol=X&TileRow=Y;
where CLEF is my personal IGN identifier

Here is a link towards IGN WMTS service and OpenLayers use
https://geoservices.ign.fr/documentation/services/utilisation-web/affichage-wmts/openlayers-et-wmts

Edited by - jeanmarc93 on 11/01/2022 17:34:25
Go to Top of Page

okmap

Italy
2572 Posts

Posted - 11/01/2022 :  17:57:05  Show Profile  Visit okmap's Homepage  Reply with Quote
The link returns "Forbidden"
Go to Top of Page

jeanmarc93

France
26 Posts

Posted - 12/01/2022 :  10:43:27  Show Profile  Reply with Quote
I sent you by mail the chain that must replace <CLEF> in the url
It's a private key given by IGN
Go to Top of Page

okmap

Italy
2572 Posts

Posted - 12/01/2022 :  10:55:56  Show Profile  Visit okmap's Homepage  Reply with Quote
I've obtained this:

<ExceptionReport xmlns="http://www.opengis.net/ows/1.1">
<Exception exceptionCode="InvalidParameterValue"> TileMatrix Zoom inconnu pour le TileMatrixSet PM </Exception>
</ExceptionReport>

this is the correct request:

https://wxs.ign.fr/<cles>/geoportail/wmts/?Service=WMTS&Request=GetCapabilities&Version=1.0.0

Which is the layer you want to get?
Go to Top of Page

jeanmarc93

France
26 Posts

Posted - 12/01/2022 :  11:11:14  Show Profile  Reply with Quote
The Layer is GEOGRAPHICALGRIDSYSTEMS.MAPS
Go to Top of Page

okmap

Italy
2572 Posts

Posted - 13/01/2022 :  09:27:35  Show Profile  Visit okmap's Homepage  Reply with Quote
This is an example:
https://dolmenweb.it/viewers/openlayer/examples/wmts-ign.html

This is the code for OkMap:

var resolutions = []; var matrixIds = []; var proj3857 = ol.proj.get('EPSG:3857'); var maxResolution = ol.extent.getWidth(proj3857.getExtent()) / 256; for (var i = 0; i < 18; i++) {matrixIds[i] = i.toString(); resolutions[i] = maxResolution / Math.pow(2, i);} map.addLayer(new ol.layer.Tile({source: new ol.source.WMTS({url: 'https://wxs.ign.fr/<CLES>/geoportail/wmts/', layer: 'GEOGRAPHICALGRIDSYSTEMS.MAPS', matrixSet: 'PM', format: 'image/jpeg', projection: 'EPSG:3857', tileGrid: new ol.tilegrid.WMTS({origin: [-20037508, 20037508], resolutions: resolutions, matrixIds: matrixIds}), style: 'normal', attributions: '<a href="https://www.ign.fr/" target="_blank"><img src="https://wxs.ign.fr/static/logos/IGN/IGN.gif" title="IGN" alt="IGN"></a>'})}));
Go to Top of Page

jeanmarc93

France
26 Posts

Posted - 13/01/2022 :  11:39:41  Show Profile  Reply with Quote
Many Thanks
Go to Top of Page

jeanmarc93

France
26 Posts

Posted - 22/04/2022 :  08:36:11  Show Profile  Reply with Quote
Hello,

Finally I found the correct code
<mapsServer>
<name>France IGN TOP 25</name>
<code>map.addLayer(new ol.layer.Tile({source: new ol.source.TileWMS({url: 'https://wxs.ign.fr/[KEY]/geoportail/r/wms', params: {'LAYERS':'GEOGRAPHICALGRIDSYSTEMS.MAPS'}, attributions: '<a href="https://www.ign.fr/" target="_blank"><img src="https://wxs.ign.fr/static/logos/IGN/IGN.gif" title="IGN" alt="IGN"></a>'})}));</code>
<baseLayer>true</baseLayer>
<covered>France</covered>
<minZoom>10</minZoom>
<maxZoom>20</maxZoom>
<active>true</active>
<canSaved>true</canSaved>
<custom>false</custom>
<default>false</default>
</mapsServer>

where [KEY] is my personal key registered on IGN Geoservices
The IGN TOP25 maps are now displaying.

Regards

Edited by - jeanmarc93 on 22/04/2022 08:41:19
Go to Top of Page

okmap

Italy
2572 Posts

Posted - 22/04/2022 :  10:00:59  Show Profile  Visit okmap's Homepage  Reply with Quote
Thank you for having shared your code!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
OkMap forum © 2018 OkMap Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07