• Resolved Etienne ROSENSTIEHL

    (@etienne-r-2)


    Thank you for your plugin that I use for years now.
    I would like to use the French IGN geoportail.
    There is an old plugin ‘Geoportail shortcode’ doing this but it is far from convenient. I guess I am not the first one. I guess you know this geoportal. If not tell me what kind of information you need.
    There are many versions of the web services IGN is providing. Their maps for France are really the best.
    I want them on my WordPress website and I rely on you.
    My beta version : https://www.menou.stbn.fr . You will see I use your plugin.
    A test of the IGN developper toolkit : https://www.menou.stbn.fr/menou-en-images/cartes-et-plans/
    Thanks in advance
    Etienne

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi,
    if French IGN geoportail is offering WMTS tile services, which can be used without addition registration (=you must be able to use it with a default leaflet setup without having to load extra javascript), then it is likely that you can configure those WMTS tile services as custom basemaps within Leaflet Maps Marker or Maps Marker Pro.
    I searched and found the following extension, from which you can extract tile url etc you need for configuring a custom basemap – I suggest you give it a try: https://github.com/IGNF/geoportal-extensions/blob/master/src/Leaflet/Layers/WMTS.js
    Anyway I am not sure if this will work & suggest to get in contact with French IGN geoportail for a leaflet integration example of their services
    best,
    Robert

    Thread Starter Etienne ROSENSTIEHL

    (@etienne-r-2)

    Hi,
    Many thanks for your first answer.
    I can use the IGN geoportal with and their Extension to the Leaflet Library.
    Now I would like Leaflet Maps Marker being able to use the WMS and WMTS capabilities of the IGN.
    Below is a example of javascript for a page showing a map from IGN. I don’t understand where I could input this kind of information in your plugin to generate the same map in your plugin.
    At the end of the day, I would like to use only IGN geoservices data and images.
    One more question : does your plugin use WMTS and/or WMS ?

    Best regards
    Etienne

    window.onload= function() {
    var map = L.map(“mapView”).setView([47.3669,3.2785],15) ;
    L.tileLayer(
    https://wxs.ign.fr/apiKey/geoportail/wmts?service=WMTS” +
    “&request=GetTile&version=1.0.0” +
    “&style=normal” +
    “&tilematrixset=PM” +
    “&format=image/jpeg” +
    “&layer=ORTHOIMAGERY.ORTHOPHOTOS” +
    “&tilematrix={z}&tilecol={x}&tilerow={y}”,
    { minZoom : 0,
    maxZoom : 18,
    tileSize : 256, // les tuiles du Géooportail font 256x256px
    attribution : “IGN-F/Géoportail”
    }
    ).addTo(map);
    }
    </script>

    Hi Etienne,
    Not sure if IGN tile layer work without a custom extension (which is not supported in our plugins). The example you posted could anyway be used to setup a custom basemap at Settings / Basemaps / Custom Basemap 1 settings for example. Just give it a try by creating a tile URL from the example, like
    https://wxs.ign.fr/apiKey/geoportail/wmts?service=WMTS&request=GetTile&version=1.0.0&style=normal&#8230;.&tilematrix={z}&tilecol={x}&tilerow={y}
    ApiKey might been to be replaced with your API key
    Best,
    Robert

    Thread Starter Etienne ROSENSTIEHL

    (@etienne-r-2)

    Hi Robert,
    Many thanks for your time and efforts. Unfortunately, it is not enough.
    I will contact the IGN.
    It is possible to use leaflet directly without any specific extension. I used the following code. In case it is helpful…
    Any suggestion ?…
    I’ll keep you posted of further development
    Regards
    Etienne

    <!– Leaflet library –>
    <link rel=”stylesheet” href=”geoportail/leaflet/leaflet.css” />
    <script src=”geoportail/leaflet/leaflet.js”></script>

    <div id=”mapView”></div>
    <script type=”text/javascript”>
    window.onload= function() {
    var map = L.map(“mapView”).setView([47.3669,3.2785],15) ;
    L.tileLayer(
    https://wxs.ign.fr/myKey/geoportail/wmts?service=WMTS&#8221; +
    “&request=GetTile&version=1.0.0” +
    “&style=normal” +
    “&tilematrixset=PM” +
    “&format=image/jpeg” +
    “&layer=ORTHOIMAGERY.ORTHOPHOTOS” +
    “&tilematrix={z}&tilecol={x}&tilerow={y}”,
    { minZoom : 0,
    maxZoom : 18,
    tileSize : 256, // les tuiles du Géooportail font 256x256px
    attribution : “IGN-F/Géoportail”
    }
    ).addTo(map);
    }
    </script>

    Hi Etienne,
    I tried setting up a custom basemap with the following tile URL:
    https://wxs.ign.fr/myKey/geoportail/wmts?service=WMTS&request=GetTile&version=1.0.0&style=normal&tilematrixset=PM&format=image/jpeg&layer=ORTHOIMAGERY.ORTHOPHOTOS&tilematrix={z}&tilecol={x}&tilerow={y}
    as a result, an additional authentication popup was shown – so perhaps it works if you replace myKey with your actual key from ign.fr
    best,
    Robert

    Thread Starter Etienne ROSENSTIEHL

    (@etienne-r-2)

    Hi Robert,
    It works fine now. Congratulation.
    You made a fantastic job.

    I was about to be able to code my maps with OpenLayers and an IGN extension. I am glad to be back in the real world of people ignoring code…

    Best regards
    Etienne

    great to hear that it worked!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How could I use French Geoportal IGN’ is closed to new replies.