﻿{"id":13134,"date":"2025-04-23T10:00:00","date_gmt":"2025-04-23T08:00:00","guid":{"rendered":"https:\/\/www.sigterritoires.fr\/?p=13134"},"modified":"2025-05-15T16:17:27","modified_gmt":"2025-05-15T14:17:27","slug":"leaflet-tutorial","status":"publish","type":"post","link":"https:\/\/www.sigterritoires.fr\/index.php\/en\/leaflet-tutorial\/","title":{"rendered":"Leaflet tutorial"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_83 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Contenu <\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/leaflet-tutorial\/#Duration_approx_9-12_hours_divided_into_6_sessions\" >Duration: approx. 9-12 hours (divided into 6 sessions)<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/leaflet-tutorial\/#Program\" >Program :<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/leaflet-tutorial\/#Expected_result\" >Expected result<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/leaflet-tutorial\/#Submit_your_individual_project_%E2%80%93_Session_6\" >Submit your individual project &#8211; Session 6<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/leaflet-tutorial\/#How_to_proceed\" >How to proceed?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/leaflet-tutorial\/#Teaching_method_for_the_Leaflet_course\" >Teaching method for the Leaflet course<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/leaflet-tutorial\/#1-Introductory_slide_show\" >1-Introductory slide show<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/leaflet-tutorial\/#2-Detailed_explanatory_text\" >2-Detailed explanatory text<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/leaflet-tutorial\/#3-Practical_exercise_at_the_end_of_each_session\" >3-Practical exercise at the end of each session<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/leaflet-tutorial\/#4_Answer_key_available%E2%80%A6_but_after_the_effort\" >4. Answer key available\u2026 but after the effort!<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/leaflet-tutorial\/#In_a_nutshell\" >In a nutshell<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/leaflet-tutorial\/#Ready_to_get_started_Go_to_the_first_session_Displaying_a_map_with_Leaflet\" >Ready to get started? Go to the first session: Displaying a map with Leaflet!<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Duration_approx_9-12_hours_divided_into_6_sessions\"><\/span>Duration: approx. 9-12 hours (divided into 6 sessions)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Program\"><\/span>Program :<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>I<a href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/leaflet-tutorial-session-1\" title=\"ntroduction to Leaflet online\">ntroduction to Leaflet online<\/a><\/strong>\n<ul class=\"wp-block-list\">\n<li>&#8211; Installation, basic map structure<\/li>\n\n\n\n<li>&#8211; Adding map backgrounds (OSM, third-party basemaps)<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/leaflet-tutorial-session-2\" title=\"Layers and interactivity \">Layers and interactivity <\/a><\/strong>\n<ul class=\"wp-block-list\">\n<li>&#8211; Points, polylines, polygons<\/li>\n\n\n\n<li>&#8211; Customization, events, interactions<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/leaflet-tutorial-session-3\" title=\"\">GeoJSON layers and external data <\/a><\/strong>\n<ul class=\"wp-block-list\">\n<li>&#8211; Loading GeoJSON data<\/li>\n\n\n\n<li>&#8211; Conditional display, dynamic symbols<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/leaflet-tutorial-session-4\" title=\"Interface controls and tools \">Interface controls and tools <\/a><\/strong>\n<ul class=\"wp-block-list\">\n<li>&#8211; Tooltips, popups, legends, layer groups<\/li>\n\n\n\n<li>&#8211; Layer control and simple filters<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/leaflet-tutorial-session-5\" title=\"User events and interactivity\">User events and interactivity<\/a> <\/strong>\n<ul class=\"wp-block-list\">\n<li>&#8211; Reacting to clicks, hovers, element selection<\/li>\n\n\n\n<li>&#8211; Creating a simple interactive map<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Custom web map mini-project (online 16 \/05\/2025)<\/strong>\n<ul class=\"wp-block-list\">\n<li>&#8211; Creating a mini-project<\/li>\n\n\n\n<li>&#8211; Putting it online (GitHub Pages or other free solution)<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Expected_result\"><\/span>Expected result<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>By the end of the course, you&rsquo;ll be able to create a working Leaflet map with your own data and put it online to share with the world!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Submit_your_individual_project_%E2%80%93_Session_6\"><\/span>Submit your individual project &#8211; Session 6<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In the last session of this module, you will have produced an individual project incorporating the main elements studied (layers, styles, interactions, controls, etc.).<\/p>\n\n\n\n<p>We invite you to share your project with us, so as to benefit from personalized feedback and, if you wish, to be featured in future publications<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_proceed\"><\/span>How to proceed?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Publish your project (code and map) on GitHub or an equivalent service (the method will be described in session 6), then send us the link to your repository via a form made available to you.<\/p>\n\n\n\n<p>Projects will be examined according to the following criteria:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Good use of the Leaflet API<\/li>\n\n\n\n<li>Readability and organization of the code<\/li>\n\n\n\n<li>Visual and functional quality of the map<\/li>\n\n\n\n<li>Relevance of the subject and data chosen<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>To follow the course exercises, you can download a starter kit in zip format from this link.<\/p>\n\n\n<div class='w3eden'><!-- WPDM Link Template: Default Template -->\n\n<div class=\"link-template-default card mb-2\">\n    <div class=\"card-body\">\n        <div class=\"media\">\n            <div class=\"mr-3 img-48\"><img decoding=\"async\" class=\"wpdm_icon\" alt=\"Ic\u00f4ne\" src=\"https:\/\/www.sigterritoires.fr\/wp-content\/plugins\/download-manager\/assets\/file-type-icons\/zip.svg\" \/><\/div>\n            <div class=\"media-body\">\n                <h3 class=\"package-title\"><a href='https:\/\/www.sigterritoires.fr\/index.php\/download\/starter-kit\/'>starter kit<\/a><\/h3>\n                <div class=\"text-muted text-small\"><i class=\"fas fa-copy\"><\/i> 1 fichier\u00b7s <i class=\"fas fa-hdd ml-3\"><\/i> 0.00 KB<\/div>\n            <\/div>\n            <div class=\"ml-3\">\n                <a class='wpdm-download-link download-on-click btn btn-primary ' rel='nofollow' href='#' data-downloadurl=\"https:\/\/www.sigterritoires.fr\/index.php\/download\/starter-kit\/?wpdmdl=13356&refresh=6a03d040a22e71778634816\">T\u00e9l\u00e9charger<\/a>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n\n<\/div>\n\n\n\n<p><br>Unzip the contents into a directory of your choice where you can store all the files for this course.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Teaching_method_for_the_Leaflet_course\"><\/span>Teaching method for the Leaflet course<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>This introductory course to Leaflet.js, the JavaScript library for interactive mapping, is designed to guide you progressively through the learning process, with an active, visual and guided approach.<\/p>\n\n\n\n<p><strong>Each session follows a simple, effective teaching structure:<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1-Introductory_slide_show\"><\/span>1-Introductory slide show<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Each session begins with a summary slide show outlining the essential notions to remember:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>concepts illustrated with concrete examples,<\/li>\n\n\n\n<li>commented code extracts,<\/li>\n\n\n\n<li>diagrams or screenshots,<\/li>\n\n\n\n<li>icons and visual cues to aid memorization.<\/li>\n<\/ul>\n\n\n\n<p><strong>The aim: to quickly understand Leaflet&rsquo;s functions and possibilities.<\/strong>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2-Detailed_explanatory_text\"><\/span>2-Detailed explanatory text<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Each slide is accompanied by a pedagogical explanatory text, which:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>develops the content of the slide show,<\/li>\n\n\n\n<li>explains the \u201cwhy\u201d and \u201chow\u201d behind each function,<\/li>\n\n\n\n<li>suggests code variants or additional tips,<\/li>\n\n\n\n<li>introduces best practices and common mistakes to avoid.<\/li>\n<\/ul>\n\n\n\n<p>This text is intended as a stand-alone reading aid, to be consulted before or after the session.ce.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3-Practical_exercise_at_the_end_of_each_session\"><\/span>3-Practical exercise at the end of each session<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>At the end of each session, you&rsquo;ll find a practical exercise to complete:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>direct application of the concepts covered,<\/li>\n\n\n\n<li>realistic scenario: map of a location, addition of markers, dynamic style, etc.<\/li>\n\n\n\n<li>clear instructions, with guided steps if necessary.<\/li>\n<\/ul>\n\n\n\n<p>Exercises are an essential step in anchoring what you&rsquo;ve learned and testing your understanding.votre compr\u00e9hension.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Answer_key_available%E2%80%A6_but_after_the_effort\"><\/span>4. Answer key available\u2026 but after the effort!<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A link at the end of the article takes you to the answer key for the exercise, with:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>a commented solution,<\/li>\n\n\n\n<li>functional code to copy and paste or adapt,<\/li>\n\n\n\n<li>sometimes variants or areas for improvement.<\/li>\n<\/ul>\n\n\n\n<p>We strongly recommend that you perform the exercise yourself before consulting the solution.<br>This is the best way to progress independently, reinforce your memory and make the concepts your own.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"In_a_nutshell\"><\/span>In a nutshell<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Each session of the course is based on:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>a visual slide show to help you understand quickly,<\/li>\n\n\n\n<li>a clear explanatory text to help you go deeper,<\/li>\n\n\n\n<li>a practical exercise to help you experiment,<\/li>\n\n\n\n<li>a guided answer sheet to help you correct yourself and go further.<\/li>\n<\/ul>\n\n\n\n<p>This method allows you to learn Leaflet step by step, at your own pace, whether you&rsquo;re a beginner or already have some basic knowledge of HTML\/JavaScript.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Ready_to_get_started_Go_to_the_first_session_Displaying_a_map_with_Leaflet\"><\/span>Ready to get started?<br>Go to the first session: <a href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/leaflet-tutorial-session-1\" title=\"Displaying a map with Leaflet!\">Displaying a map with Leaflet!<\/a><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Duration: approx. 9-12 hours (divided into 6 sessions) Program : Expected result By the end of the course, you&rsquo;ll be able to create a working Leaflet map with your own data and put it online to&hellip;<\/p>\n","protected":false},"author":1,"featured_media":13139,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"give_campaign_id":0,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"sfsi_plus_gutenberg_text_before_share":"","sfsi_plus_gutenberg_show_text_before_share":"","sfsi_plus_gutenberg_icon_type":"","sfsi_plus_gutenberg_icon_alignemt":"","sfsi_plus_gutenburg_max_per_row":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[3015],"tags":[2945,2943,2036,2215],"class_list":["post-13134","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-webmapping-en","tag-leaflet-en","tag-program","tag-tutorial-en","tag-webmapping-en"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/04\/Initiation-en.jpg?fit=1280%2C720&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p6XU0A-3pQ","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts\/13134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/comments?post=13134"}],"version-history":[{"count":0,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts\/13134\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/media\/13139"}],"wp:attachment":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/media?parent=13134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/categories?post=13134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/tags?post=13134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}