Title: IGN layer
Last modified: August 31, 2016

---

# IGN layer

 *  Resolved [slackline974](https://wordpress.org/support/users/slackline974/)
 * (@slackline974)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/ign-layer/)
 * Hi!
    I love your plugin! Thanks for your superb work. I tried to add an Ign layer
   and google map api in a wordpress page, but I didn’t succeed.. And your plugin
   is exactly what I need! But I just want to add an Ign layer in this plugin. Could
   you help me, or add this in the plugin directly?
 * Thank you 🙂
 * [https://wordpress.org/plugins/leaflet-map/](https://wordpress.org/plugins/leaflet-map/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [slackline974](https://wordpress.org/support/users/slackline974/)
 * (@slackline974)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/ign-layer/#post-7169745)
 * Like this: [http://www.randopitons.re/randonnee/1009-toboggans-fleurs-jaunes-bassin-roche-bras-rouge](http://www.randopitons.re/randonnee/1009-toboggans-fleurs-jaunes-bassin-roche-bras-rouge)
 *  Plugin Author [bozdoz](https://wordpress.org/support/users/bozdoz/)
 * (@bozdoz)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/ign-layer/#post-7169852)
 * Looks like there’s a plugin for it: [https://github.com/mylen/leaflet.TileLayer.WMTS](https://github.com/mylen/leaflet.TileLayer.WMTS)
 * As a rule, I’ve been avoiding adding plugins to my plugin (difficult to maintain,
   and I feel like I’d be taking credit for their work). But you should be able 
   to customize your site with some amount of effort.
 * You could add a new shortcode :
 * `add_shortcode('leaflet-wmts', array(&$this, 'wmts_shortcode'));`
 * Register (and enqueue) the wmts js library:
 * `wp_register_script('leaflet_wmts_js', '/leaflet-tilelayer-wmts.js', Array(),
   $version, true);`
 * And basically copy/edit the `map_shortcode` script:
 *     ```
       wp_enqueue_script('leaflet_wmts_js');
   
                   $content = '<div id="leaflet-wordpress-map-'.$leaflet_map_count.'" class="leaflet-wordpress-map" style="height:'.$height.'; width:'.$width.';"></div>';
                   $content .= "<script>
                   WPLeafletMapPlugin.add(function () {
                       var map,
                           baseURL = '{$tileurl}',
                           base = new L.TileLayer.WMTS( baseURL ,
                                      {
                                          layer: 'GEOGRAPHICALGRIDSYSTEMS.MAPS.SCAN-EXPRESS.STANDARD',
                                          style: 'normal',
                                          tilematrixSet: 'PM',
                                          format: 'image/jpeg',
                                          attribution: '<a href=\'https://github.com/mylen/leaflet.TileLayer.WMTS\'>GitHub</a>&copy; <a href=\'http://www.ign.fr\'>IGN</a>'
                                      }
                                     );
   
                       map = L.map('leaflet-wordpress-map-{$leaflet_map_count}',
                           {
                               layers: [base],
                               zoomControl: {$zoomcontrol},
                               scrollWheelZoom: {$scrollwheel}
                           }).setView([{$lat}, {$lng}], {$zoom});";
       ```
   
 * …etc.
 * Then your shortcode could be `[leaflet-wmts tileurl="tile-url-here.com"]`.
 *  Thread Starter [slackline974](https://wordpress.org/support/users/slackline974/)
 * (@slackline974)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/ign-layer/#post-7170000)
 * Thank you for your answer.
    An Idea for the result with another solution (my 
   website) [http://www.slackline974.org/ti-slack7/](http://www.slackline974.org/ti-slack7/)
 * I’m a beginner in Js and php, but I learn to understand, and I will try to succeed
   with your indication.
 * Thank you again, I hope to be as good like you one day! 😉

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘IGN layer’ is closed to new replies.

 * ![](https://ps.w.org/leaflet-map/assets/icon-256x256.png?rev=1693083)
 * [Leaflet Map](https://wordpress.org/plugins/leaflet-map/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/leaflet-map/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/leaflet-map/)
 * [Active Topics](https://wordpress.org/support/plugin/leaflet-map/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/leaflet-map/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/leaflet-map/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [slackline974](https://wordpress.org/support/users/slackline974/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/ign-layer/#post-7170000)
 * Status: resolved