{"id":2986,"date":"2026-01-18T16:04:38","date_gmt":"2026-01-18T15:04:38","guid":{"rendered":"https:\/\/eurekamaths.fr\/wpe\/?page_id=2986"},"modified":"2026-01-18T16:04:38","modified_gmt":"2026-01-18T15:04:38","slug":"carte-des-inscrits-2","status":"publish","type":"page","link":"https:\/\/mathisere.fr\/index.php\/administration\/carte-des-inscrits-2\/","title":{"rendered":"Carte des inscrits"},"content":{"rendered":"<h1 id=\"extension-wordpress-carte-des-inscriptions-eur-kamaths\">Extension WordPress &#8211; Carte des Inscriptions Eur\u00eakamaths<\/h1>\n<p>[tabs]<br \/>\nExtension WordPress &#8211; Carte des Inscriptions Eur\u00eakamaths<\/p>\n<p>[tab title=\u00a0\u00bbREADME\u00a0\u00bb]<\/p>\n<p>[accordion]<\/p>\n<p>[accordion_item title=\u00a0\u00bbDescription\u00a0\u00bb]<\/p>\n<h2 id=\"-description\">\ud83d\udccb Description<\/h2>\n<p>Extension WordPress qui affiche sur une carte interactive (Leaflet) toutes les classes inscrites au concours Eur\u00eakamaths. Les marqueurs sont color\u00e9s selon le niveau (CM1 = jaune, CM2 = vert, 6e = violet) et regroup\u00e9s automatiquement avec Leaflet.markercluster.<\/p>\n<p>[\/accordion_item][accordion_item title=\u00a0\u00bbFonctionnalit\u00e9s\u00a0\u00bb]<\/p>\n<h2 id=\"-fonctionnalit-s\">\ud83d\uddfa\ufe0f Fonctionnalit\u00e9s<\/h2>\n<h3 id=\"carte-interactive\">Carte interactive<\/h3>\n<ul>\n<li><strong>Fond de carte OpenStreetMap<\/strong> : gratuit et collaboratif<\/li>\n<li><strong>Clustering automatique<\/strong> : les marqueurs proches sont regroup\u00e9s<\/li>\n<li><strong>Zoom et navigation<\/strong> : contr\u00f4les intuitifs<\/li>\n<li><strong>Responsive<\/strong> : s&rsquo;adapte \u00e0 tous les \u00e9crans<\/li>\n<\/ul>\n<h3 id=\"marqueurs-color-s-par-niveau\">Marqueurs color\u00e9s par niveau<\/h3>\n<ul>\n<li>\ud83d\udfe1 <strong>CM1<\/strong> : Ic\u00f4ne jaune (#FFD700)<\/li>\n<li>\ud83d\udfe2 <strong>CM2<\/strong> : Ic\u00f4ne verte (#28a745)<\/li>\n<li>\ud83d\udfe3 <strong>6e<\/strong> : Ic\u00f4ne violette (#9B59B6)<\/li>\n<\/ul>\n<h3 id=\"popups-informatifs\">Popups informatifs<\/h3>\n<p>Au clic sur un marqueur, affichage de :<\/p>\n<ul>\n<li>Nom de la classe et niveau<\/li>\n<li>Nom de l&rsquo;enseignant<\/li>\n<li>\u00c9tablissement<\/li>\n<li>Commune et code postal<\/li>\n<li>Nombre d&rsquo;\u00e9l\u00e8ves<\/li>\n<\/ul>\n<h3 id=\"statistiques\">Statistiques<\/h3>\n<p>Affichage en temps r\u00e9el :<\/p>\n<ul>\n<li>Nombre total de classes inscrites<\/li>\n<li>R\u00e9partition par niveau (CM1, CM2, 6e)<\/li>\n<\/ul>\n<h3 id=\"filtrage-par-ann-e-scolaire\">Filtrage par ann\u00e9e scolaire<\/h3>\n<ul>\n<li>Affiche uniquement les inscriptions de l&rsquo;ann\u00e9e scolaire s\u00e9lectionn\u00e9e<\/li>\n<li>Par d\u00e9faut : ann\u00e9e scolaire en cours<\/li>\n<\/ul>\n<p>[\/accordion_item][accordion_item title=\u00a0\u00bbInstallation\u00a0\u00bb]<\/p>\n<h2 id=\"-installation\">\ud83d\ude80 Installation<\/h2>\n<h3 id=\"pr-requis\">Pr\u00e9requis<\/h3>\n<ul>\n<li>WordPress avec les extensions :\n<ul>\n<li><strong>Inscription Concours Eur\u00eakamaths<\/strong> (pour la table <code>inscrits<\/code>)<\/li>\n<\/ul>\n<\/li>\n<li>Tables de base de donn\u00e9es :\n<ul>\n<li><code>wp_inscrits<\/code> avec colonnes : <code>id_inscrit<\/code>, <code>classe<\/code>, <code>niveau<\/code>, <code>prenom<\/code>, <code>nom<\/code>, <code>nb<\/code>, <code>uai<\/code>, <code>annee_scolaire<\/code><\/li>\n<li><code>wp_etabs_geolocalisation<\/code> avec colonnes : <code>uai<\/code>, <code>nom_etab<\/code>, <code>commune<\/code>, <code>cp<\/code>, <strong><code>latitude<\/code><\/strong>, <strong><code>longitude<\/code><\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3 id=\"structure-des-fichiers\">Structure des fichiers<\/h3>\n<pre><code>carte-inscriptions\/\n\u251c\u2500\u2500 carte-inscriptions<span class=\"hljs-selector-class\">.php<\/span> (fichier principal)\n\u251c\u2500\u2500 assets\/\n\u2502   \u251c\u2500\u2500 carte-script<span class=\"hljs-selector-class\">.js<\/span>\n\u2502   \u2514\u2500\u2500 carte-style<span class=\"hljs-selector-class\">.css<\/span>\n\u2514\u2500\u2500 README.md\n<\/code><\/pre>\n<h3 id=\"-tapes-d-installation\">\u00c9tapes d&rsquo;installation<\/h3>\n<ol>\n<li><strong>Cr\u00e9er le dossier du plugin<\/strong>\n<pre><code class=\"lang-bash\"><span class=\"hljs-built_in\">mkdir<\/span> wp-<span class=\"hljs-built_in\">content<\/span>\/plugins\/carte-inscriptions\n<span class=\"hljs-built_in\">mkdir<\/span> wp-<span class=\"hljs-built_in\">content<\/span>\/plugins\/carte-inscriptions\/assets\n<\/code><\/pre>\n<\/li>\n<li><strong>Copier les fichiers<\/strong>\n<ul>\n<li><code>carte-inscriptions.php<\/code> : fichier principal PHP<\/li>\n<li><code>assets\/carte-script.js<\/code> : JavaScript Leaflet<\/li>\n<li><code>assets\/carte-style.css<\/code> : styles CSS<\/li>\n<\/ul>\n<\/li>\n<li><strong>V\u00e9rifier la table <code>etabs_geolocalisation<\/code><\/strong>La table doit contenir les colonnes <code>latitude<\/code> et <code>longitude<\/code> :\n<pre><code class=\"lang-sql\"><span class=\"hljs-keyword\">ALTER<\/span> <span class=\"hljs-keyword\">TABLE<\/span> wp_etabs_geolocalisation\n<span class=\"hljs-keyword\">ADD<\/span> <span class=\"hljs-keyword\">COLUMN<\/span> latitude <span class=\"hljs-built_in\">DECIMAL<\/span>(<span class=\"hljs-number\">10<\/span>, <span class=\"hljs-number\">8<\/span>) <span class=\"hljs-keyword\">DEFAULT<\/span> <span class=\"hljs-literal\">NULL<\/span>,\n<span class=\"hljs-keyword\">ADD<\/span> <span class=\"hljs-keyword\">COLUMN<\/span> longitude <span class=\"hljs-built_in\">DECIMAL<\/span>(<span class=\"hljs-number\">11<\/span>, <span class=\"hljs-number\">8<\/span>) <span class=\"hljs-keyword\">DEFAULT<\/span> <span class=\"hljs-literal\">NULL<\/span>;\n<\/code><\/pre>\n<\/li>\n<li><strong>Activer le plugin<\/strong>\n<ul>\n<li>Allez dans WordPress Admin \u2192 Extensions<\/li>\n<li>Activez \u00ab\u00a0Carte des Inscriptions Eur\u00eakamaths\u00a0\u00bb<\/li>\n<\/ul>\n<\/li>\n<li><strong>Utiliser le shortcode<\/strong>\n<ul>\n<li>Ajoutez le shortcode dans une page ou un article :<br \/>\n[<code>carte_inscriptions<\/code>]<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>[\/accordion_item][accordion_item title=\u00a0\u00bbFonctionnalit\u00e9s\u00a0\u00bb]<\/p>\n<h2 id=\"-personnalisation-du-shortcode\">\ud83c\udfa8 Personnalisation du shortcode<\/h2>\n<p>Le shortcode accepte plusieurs param\u00e8tres optionnels :<\/p>\n<pre>&#091;<code>carte_inscriptions height=<span class=\"hljs-string\">\"600px\"<\/span> zoom=<span class=\"hljs-string\">\"6\"<\/span> center_lat=<span class=\"hljs-string\">\"46.603354\"<\/span> center_lng=<span class=\"hljs-string\">\"1.888334\"<\/span> annee=<span class=\"hljs-string\">\"2024-2025\"<\/span><\/code>]\n<\/pre>\n<h3 id=\"param-tres-disponibles\">Param\u00e8tres disponibles<\/h3>\n<table>\n<thead>\n<tr>\n<th>Param\u00e8tre<\/th>\n<th>Description<\/th>\n<th>Valeur par d\u00e9faut<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>height<\/code><\/td>\n<td>Hauteur de la carte<\/td>\n<td><code>600px<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>zoom<\/code><\/td>\n<td>Niveau de zoom initial<\/td>\n<td><code>6<\/code> (France enti\u00e8re)<\/td>\n<\/tr>\n<tr>\n<td><code>center_lat<\/code><\/td>\n<td>Latitude du centre initial<\/td>\n<td><code>46.603354<\/code> (centre France)<\/td>\n<\/tr>\n<tr>\n<td><code>center_lng<\/code><\/td>\n<td>Longitude du centre initial<\/td>\n<td><code>1.888334<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>annee<\/code><\/td>\n<td>Ann\u00e9e scolaire \u00e0 afficher<\/td>\n<td>Ann\u00e9e en cours<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"exemples-d-utilisation\">Exemples d&rsquo;utilisation<\/h3>\n<p><strong>Carte par d\u00e9faut (<code>height=<span class=\"hljs-string\">\"600px\"<\/span><\/code>mais pour l&rsquo;exemple <code> height=<span class=\"hljs-string\">\"200px\"<\/span><\/code>):<\/strong><\/p>\n<pre><code>&#091;<code>carte_inscriptions  height=<span class=\"hljs-string\">\"200px\"<\/span><\/code>]\n<\/code><\/pre>\n<p><strong>Carte centr\u00e9e sur l&rsquo;\u00cele-de-France :<\/strong><\/p>\n<pre><code>&#091;<code>carte_inscriptions zoom=<span class=\"hljs-string\">\"8\"<\/span> center_lat=<span class=\"hljs-string\">\"48.8566\"<\/span> center_lng=<span class=\"hljs-string\">\"2.3522\" height=\"200px\"<\/span><\/code>]\n<\/code><\/pre>\n<p><strong>Carte avec ann\u00e9e sp\u00e9cifique :<\/strong><\/p>\n<pre><code>&#091;<code>carte_inscriptions annee=<span class=\"hljs-string\">\"2023-2024\"<\/span><\/code>]\n<\/code><\/pre>\n<p><strong>Carte plus grande :<\/strong><\/p>\n<p><code>&#091;<code>carte_inscriptions height=<span class=\"hljs-string\">\"400px\"<\/span><\/code>]<\/code><br \/>\n[\/accordion_item][accordion_item title=\u00a0\u00bbBase de donn\u00e9es\u00a0\u00bb]<\/p>\n<h2 id=\"-base-de-donn-es\">\ud83d\udcca Base de donn\u00e9es<\/h2>\n<h3 id=\"table-wp_etabs_geolocalisation\">Table wp_etabs_geolocalisation<\/h3>\n<p><strong>Colonnes requises pour la carte :<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>Colonne<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>uai<\/td>\n<td>varchar(8)<\/td>\n<td>Code UAI de l&rsquo;\u00e9tablissement<\/td>\n<\/tr>\n<tr>\n<td>nom_etab<\/td>\n<td>varchar(255)<\/td>\n<td>Nom de l&rsquo;\u00e9tablissement<\/td>\n<\/tr>\n<tr>\n<td>commune<\/td>\n<td>varchar(100)<\/td>\n<td>Commune<\/td>\n<\/tr>\n<tr>\n<td>cp<\/td>\n<td>varchar(10)<\/td>\n<td>Code postal<\/td>\n<\/tr>\n<tr>\n<td>latitude<\/td>\n<td>decimal(10,8)<\/td>\n<td>Latitude GPS<\/td>\n<\/tr>\n<tr>\n<td>longitude<\/td>\n<td>decimal(11,8)<\/td>\n<td>Longitude GPS<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Important :<\/strong> Les \u00e9tablissements sans coordonn\u00e9es (latitude\/longitude NULL ou 0) ne seront pas affich\u00e9s sur la carte.<\/p>\n<h3 id=\"exemple-de-donn-es\">Exemple de donn\u00e9es<\/h3>\n<pre><code class=\"lang-sql\"><span class=\"hljs-keyword\">INSERT<\/span> <span class=\"hljs-keyword\">INTO<\/span> wp_etabs_geolocalisation (uai, nom_etab, commune, cp, latitude, longitude)\n<span class=\"hljs-keyword\">VALUES<\/span>\n(<span class=\"hljs-string\">'0380001A'<\/span>, <span class=\"hljs-string\">'\u00c9cole primaire Jean Moulin'<\/span>, <span class=\"hljs-string\">'Grenoble'<\/span>, <span class=\"hljs-string\">'38000'<\/span>, <span class=\"hljs-number\">45.188529<\/span>, <span class=\"hljs-number\">5.724524<\/span>),\n(<span class=\"hljs-string\">'0750001B'<\/span>, <span class=\"hljs-string\">'Coll\u00e8ge Victor Hugo'<\/span>, <span class=\"hljs-string\">'Paris'<\/span>, <span class=\"hljs-string\">'75015'<\/span>, <span class=\"hljs-number\">48.841684<\/span>, <span class=\"hljs-number\">2.289960<\/span>);\n<\/code><\/pre>\n<p>[\/accordion_item][accordion_item title=\u00a0\u00bbComment obtenir les coordonn\u00e9es GPS ?\u00a0\u00bb]<\/p>\n<h2 id=\"-comment-obtenir-les-coordonn-es-gps-\">\ud83d\udd0d Comment obtenir les coordonn\u00e9es GPS ?<\/h2>\n<h3 id=\"option-1-api-adresse-gouv-fr-recommand-\">Option 1 : API Adresse (gouv.fr) &#8211; RECOMMAND\u00c9<\/h3>\n<p>Script PHP pour g\u00e9ocoder automatiquement :<\/p>\n<pre><code class=\"lang-php\"><span class=\"php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n<span class=\"hljs-keyword\">global<\/span> $wpdb;\n$etabs = $wpdb-&gt;get_results(<span class=\"hljs-string\">\"SELECT id, adresse, cp, commune FROM wp_etabs_geolocalisation WHERE latitude IS NULL\"<\/span>);\n\n<span class=\"hljs-keyword\">foreach<\/span> ($etabs <span class=\"hljs-keyword\">as<\/span> $etab) {\n    $query = urlencode($etab-&gt;adresse . <span class=\"hljs-string\">' '<\/span> . $etab-&gt;cp . <span class=\"hljs-string\">' '<\/span> . $etab-&gt;commune);\n    $url = <span class=\"hljs-string\">\"https:\/\/api-adresse.data.gouv.fr\/search\/?q=\"<\/span> . $query . <span class=\"hljs-string\">\"&amp;limit=1\"<\/span>;\n\n    $response = file_get_contents($url);\n    $data = json_decode($response, <span class=\"hljs-keyword\">true<\/span>);\n\n    <span class=\"hljs-keyword\">if<\/span> (!<span class=\"hljs-keyword\">empty<\/span>($data&#091;<span class=\"hljs-string\">'features'<\/span>&#093;)) {\n        $coords = $data&#091;<span class=\"hljs-string\">'features'<\/span>&#093;&#091;<span class=\"hljs-number\">0<\/span>&#093;&#091;<span class=\"hljs-string\">'geometry'<\/span>&#093;&#091;<span class=\"hljs-string\">'coordinates'<\/span>&#093;;\n        $wpdb-&gt;update(\n            <span class=\"hljs-string\">'wp_etabs_geolocalisation'<\/span>,\n            <span class=\"hljs-keyword\">array<\/span>(\n                <span class=\"hljs-string\">'longitude'<\/span> =&gt; $coords&#091;<span class=\"hljs-number\">0<\/span>&#093;,\n                <span class=\"hljs-string\">'latitude'<\/span> =&gt; $coords&#091;<span class=\"hljs-number\">1<\/span>&#093;\n            ),\n            <span class=\"hljs-keyword\">array<\/span>(<span class=\"hljs-string\">'id'<\/span> =&gt; $etab-&gt;id)\n        );\n    }\n\n    usleep(<span class=\"hljs-number\">200000<\/span>); <span class=\"hljs-comment\">\/\/ Pause de 200ms entre chaque requ\u00eate<\/span>\n}\n<span class=\"hljs-meta\">?&gt;<\/span><\/span>\n<\/code><\/pre>\n<h3 id=\"option-2-import-csv\">Option 2 : Import CSV<\/h3>\n<p>Si vous avez d\u00e9j\u00e0 les coordonn\u00e9es dans un fichier CSV :<\/p>\n<pre><code class=\"lang-sql\"><span class=\"hljs-keyword\">LOAD<\/span> <span class=\"hljs-keyword\">DATA<\/span> <span class=\"hljs-keyword\">LOCAL<\/span> <span class=\"hljs-keyword\">INFILE<\/span> <span class=\"hljs-string\">'coordonnees.csv'<\/span>\n<span class=\"hljs-keyword\">INTO<\/span> <span class=\"hljs-keyword\">TABLE<\/span> wp_etabs_geolocalisation\n<span class=\"hljs-keyword\">FIELDS<\/span> <span class=\"hljs-keyword\">TERMINATED<\/span> <span class=\"hljs-keyword\">BY<\/span> <span class=\"hljs-string\">','<\/span>\n<span class=\"hljs-keyword\">LINES<\/span> <span class=\"hljs-keyword\">TERMINATED<\/span> <span class=\"hljs-keyword\">BY<\/span> <span class=\"hljs-string\">'\\n'<\/span>\n<span class=\"hljs-keyword\">IGNORE<\/span> <span class=\"hljs-number\">1<\/span> <span class=\"hljs-keyword\">ROWS<\/span>\n(uai, latitude, longitude);\n<\/code><\/pre>\n<h3 id=\"option-3-services-en-ligne\">Option 3 : Services en ligne<\/h3>\n<ul>\n<li><strong>Google Maps<\/strong> : rechercher l&rsquo;adresse, clic droit \u2192 \u00ab\u00a0Plus d&rsquo;infos sur cet endroit\u00a0\u00bb<\/li>\n<li><strong>OpenStreetMap<\/strong> : rechercher l&rsquo;adresse, les coordonn\u00e9es s&rsquo;affichent dans l&rsquo;URL<\/li>\n<li><strong>GPS Visualizer<\/strong> : outil de conversion d&rsquo;adresses en masse<\/li>\n<\/ul>\n<p>[\/accordion_item][accordion_item title=\u00a0\u00bbBiblioth\u00e8ques utilis\u00e9es\u00a0\u00bb]<\/p>\n<h2 id=\"-biblioth-ques-utilis-es\">\ud83c\udfaf Biblioth\u00e8ques utilis\u00e9es<\/h2>\n<ul>\n<li><strong>Leaflet 1.9.4<\/strong> : biblioth\u00e8que de cartographie JavaScript\n<ul>\n<li>Licence : BSD-2-Clause<\/li>\n<li>Site : <a href=\"https:\/\/leafletjs.com\/\">https:\/\/leafletjs.com\/<\/a><\/li>\n<\/ul>\n<\/li>\n<li><strong>Leaflet.markercluster 1.5.3<\/strong> : plugin de clustering\n<ul>\n<li>Licence : MIT<\/li>\n<li>Site : <a href=\"https:\/\/github.com\/Leaflet\/Leaflet.markercluster\">https:\/\/github.com\/Leaflet\/Leaflet.markercluster<\/a><\/li>\n<\/ul>\n<\/li>\n<li><strong>OpenStreetMap<\/strong> : fond de carte gratuit\n<ul>\n<li>Licence : ODbL<\/li>\n<li>Site : <a href=\"https:\/\/www.openstreetmap.org\/\">https:\/\/www.openstreetmap.org\/<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>[\/accordion_item][accordion_item title=\u00a0\u00bb\ud83d\udd27 D\u00e9pannage\u00a0\u00bb]<\/p>\n<h2 id=\"-d-pannage\">\ud83d\udd27 D\u00e9pannage<\/h2>\n<h3 id=\"la-carte-ne-s-affiche-pas\">La carte ne s&rsquo;affiche pas<\/h3>\n<ul>\n<li>V\u00e9rifiez que les scripts Leaflet sont bien charg\u00e9s (console navigateur)<\/li>\n<li>V\u00e9rifiez que le shortcode est bien dans une page\/article<\/li>\n<li>D\u00e9sactivez les autres plugins pour d\u00e9tecter un conflit<\/li>\n<\/ul>\n<h3 id=\"aucun-marqueur-n-appara-t\">Aucun marqueur n&rsquo;appara\u00eet<\/h3>\n<ul>\n<li>V\u00e9rifiez que la table <code>wp_inscrits<\/code> contient des donn\u00e9es<\/li>\n<li>V\u00e9rifiez que la colonne <code>annee_scolaire<\/code> correspond \u00e0 l&rsquo;ann\u00e9e affich\u00e9e<\/li>\n<li>V\u00e9rifiez que la table <code>wp_etabs_geolocalisation<\/code> a bien les colonnes <code>latitude<\/code> et <code>longitude<\/code><\/li>\n<li>Ex\u00e9cutez cette requ\u00eate pour v\u00e9rifier :\n<pre><code class=\"lang-sql\"><span class=\"hljs-keyword\">SELECT<\/span> <span class=\"hljs-keyword\">COUNT<\/span>(*) <span class=\"hljs-keyword\">FROM<\/span> wp_inscrits i\n<span class=\"hljs-keyword\">INNER<\/span> <span class=\"hljs-keyword\">JOIN<\/span> wp_etabs_geolocalisation e <span class=\"hljs-keyword\">ON<\/span> i.uai = e.uai\n<span class=\"hljs-keyword\">WHERE<\/span> e.latitude <span class=\"hljs-keyword\">IS<\/span> <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span> <span class=\"hljs-keyword\">AND<\/span> e.longitude <span class=\"hljs-keyword\">IS<\/span> <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span>;\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<h3 id=\"les-marqueurs-sont-mal-positionn-s\">Les marqueurs sont mal positionn\u00e9s<\/h3>\n<ul>\n<li>V\u00e9rifiez l&rsquo;ordre des coordonn\u00e9es (latitude puis longitude)<\/li>\n<li>V\u00e9rifiez que les coordonn\u00e9es sont au bon format (d\u00e9cimal, pas sexag\u00e9simal)<\/li>\n<li>Exemple correct : <code>latitude = 48.8566<\/code>, <code>longitude = 2.3522<\/code><\/li>\n<\/ul>\n<h3 id=\"erreur-ajax\">Erreur AJAX<\/h3>\n<ul>\n<li>V\u00e9rifiez les logs d&rsquo;erreur PHP<\/li>\n<li>V\u00e9rifiez que l&rsquo;utilisateur a les droits (le shortcode est accessible sans connexion)<\/li>\n<li>V\u00e9rifiez dans la console du navigateur<\/li>\n<\/ul>\n<p>[\/accordion_item][accordion_item title=\u00a0\u00bbSupport\u00a0\u00bb]<\/p>\n<h2 id=\"-support\">\ud83d\udcde Support<\/h2>\n<p>Pour toute question ou probl\u00e8me :<\/p>\n<ul>\n<li>Email : contact@eurekamaths.fr<\/li>\n<li>Site : <a href=\"https:\/\/mathisere.fr\/\">https:\/\/mathisere.fr\/<\/a><\/li>\n<\/ul>\n<p>[\/accordion_item][accordion_item title=\u00a0\u00bb\ud83d\udcc4 Licence\u00a0\u00bb]<\/p>\n<h2 id=\"-licence\">\ud83d\udcc4 Licence<\/h2>\n<p>\u00a9 Eur\u00eakamaths &#8211; Tous droits r\u00e9serv\u00e9s<\/p>\n<h2 id=\"-changelog\">\ud83d\udd04 Changelog<\/h2>\n<h3 id=\"version-1-0-0\">Version 1.0.0<\/h3>\n<ul>\n<li>Premi\u00e8re version<\/li>\n<li>Carte interactive avec Leaflet<\/li>\n<li>Clustering des marqueurs<\/li>\n<li>Marqueurs color\u00e9s par niveau (CM1, CM2, 6e)<\/li>\n<li>Popups informatifs<\/li>\n<li>Statistiques en temps r\u00e9el<\/li>\n<li>Filtrage par ann\u00e9e scolaire<\/li>\n<li>Responsive design<\/li>\n<\/ul>\n<p>[\/accordion_item][\/accordion][\/tab]<br \/>\n[tab title=\u00a0\u00bbGuide d&rsquo;installation complet\u00a0\u00bb]<br \/>\n\ud83d\uddfa\ufe0f Guide d&rsquo;installation complet &#8211; Carte des Inscriptions<br \/>\n[accordion]<br \/>\n[accordion_item title=\u00a0\u00bb\ud83d\udce6 Vue d&rsquo;ensemble\u00a0\u00bb]<\/p>\n<h2 id=\"-vue-d-ensemble\">\ud83d\udce6 Vue d&rsquo;ensemble<\/h2>\n<p>Ce guide vous accompagne pas \u00e0 pas pour installer et configurer la carte interactive des inscriptions au concours Eur\u00eakamaths.<\/p>\n<h2 id=\"-tape-1-pr-requis\">\ud83c\udfaf \u00c9tape 1 : Pr\u00e9requis<\/h2>\n<p>Avant de commencer, assurez-vous d&rsquo;avoir :<\/p>\n<ul>\n<li>\u2705 WordPress install\u00e9 et fonctionnel<\/li>\n<li>\u2705 Extension \u00ab\u00a0Inscription Concours Eur\u00eakamaths\u00a0\u00bb activ\u00e9e<\/li>\n<li>\u2705 Tables de base de donn\u00e9es :\n<ul>\n<li><code>wp_inscrits<\/code> (cr\u00e9\u00e9e par l&rsquo;extension Inscription)<\/li>\n<li><code>wp_etabs_geolocalisation<\/code> (avec les donn\u00e9es des \u00e9tablissements)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2 id=\"-tape-2-pr-parer-la-table-des-tablissements\">\ud83d\udd27 \u00c9tape 2 : Pr\u00e9parer la table des \u00e9tablissements<\/h2>\n<h3 id=\"ajouter-les-colonnes-latitude-et-longitude\">Ajouter les colonnes latitude et longitude<\/h3>\n<p>Si votre table <code>wp_etabs_geolocalisation<\/code> n&rsquo;a pas encore les colonnes de g\u00e9olocalisation :<\/p>\n<pre><code class=\"lang-sql\"><span class=\"hljs-keyword\">ALTER<\/span> <span class=\"hljs-keyword\">TABLE<\/span> wp_etabs_geolocalisation\n<span class=\"hljs-keyword\">ADD<\/span> <span class=\"hljs-keyword\">COLUMN<\/span> latitude <span class=\"hljs-built_in\">DECIMAL<\/span>(<span class=\"hljs-number\">10<\/span>, <span class=\"hljs-number\">8<\/span>) <span class=\"hljs-keyword\">DEFAULT<\/span> <span class=\"hljs-literal\">NULL<\/span>,\n<span class=\"hljs-keyword\">ADD<\/span> <span class=\"hljs-keyword\">COLUMN<\/span> longitude <span class=\"hljs-built_in\">DECIMAL<\/span>(<span class=\"hljs-number\">11<\/span>, <span class=\"hljs-number\">8<\/span>) <span class=\"hljs-keyword\">DEFAULT<\/span> <span class=\"hljs-literal\">NULL<\/span>;\n\n<span class=\"hljs-comment\">-- Cr\u00e9er des index pour am\u00e9liorer les performances<\/span>\n<span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">INDEX<\/span> idx_coords <span class=\"hljs-keyword\">ON<\/span> wp_etabs_geolocalisation(latitude, longitude);\n<\/code><\/pre>\n<h3 id=\"v-rifier-la-structure-de-la-table\">V\u00e9rifier la structure de la table<\/h3>\n<p>Votre table doit avoir au minimum ces colonnes :<\/p>\n<pre><code class=\"lang-sql\"><span class=\"hljs-keyword\">DESCRIBE<\/span> wp_etabs_geolocalisation;\n<\/code><\/pre>\n<p>R\u00e9sultat attendu :<\/p>\n<pre><code>uai          varchar(<span class=\"hljs-number\">8<\/span>)\nnom_etab     varchar(<span class=\"hljs-number\">255<\/span>)\nadresse      varchar(<span class=\"hljs-number\">255<\/span>)\ncommune      varchar(<span class=\"hljs-number\">100<\/span>)\ncp           varchar(<span class=\"hljs-number\">10<\/span>)\npays         varchar(<span class=\"hljs-number\">100<\/span>)\nlatitude     decimal(<span class=\"hljs-number\">10<\/span>,<span class=\"hljs-number\">8<\/span>)    &lt;- NOUVEAU\nlongitude    decimal(<span class=\"hljs-number\">11<\/span>,<span class=\"hljs-number\">8<\/span>)    &lt;- NOUVEAU\n<\/code><\/pre>\n<h2 id=\"-tape-3-installer-l-extension-carte\">\ud83d\udcc2 \u00c9tape 3 : Installer l&rsquo;extension Carte<\/h2>\n<h3 id=\"structure-des-fichiers-cr-er\">Structure des fichiers \u00e0 cr\u00e9er<\/h3>\n<pre><code>wp-<span class=\"hljs-attribute\">content<\/span>\/plugins\/carte-inscriptions\/\n\u251c\u2500\u2500 carte-inscriptions<span class=\"hljs-selector-class\">.php<\/span>          &lt;- Fichier principal\n\u251c\u2500\u2500 geocoding-utility<span class=\"hljs-selector-class\">.php<\/span>            &lt;- Utilitaire de g\u00e9ocodage (optionnel)\n\u251c\u2500\u2500 assets\/\n\u2502   \u251c\u2500\u2500 carte-script<span class=\"hljs-selector-class\">.js<\/span>              &lt;- JavaScript\n\u2502   \u2514\u2500\u2500 carte-style<span class=\"hljs-selector-class\">.css<\/span>              &lt;- CSS\n\u2514\u2500\u2500 README<span class=\"hljs-selector-class\">.md<\/span>                         &lt;- Documentation\n<\/code><\/pre>\n<h3 id=\"commandes-pour-cr-er-la-structure\">Commandes pour cr\u00e9er la structure<\/h3>\n<pre><code class=\"lang-bash\"><span class=\"hljs-keyword\">cd<\/span> <span class=\"hljs-keyword\">wp<\/span>-content\/plugins\/\n<span class=\"hljs-built_in\">mkdir<\/span> carte-inscriptions\n<span class=\"hljs-keyword\">cd<\/span> carte-inscriptions\n<span class=\"hljs-built_in\">mkdir<\/span> assets\n<\/code><\/pre>\n<h3 id=\"copier-les-fichiers\">Copier les fichiers<\/h3>\n<ol>\n<li><strong>carte-inscriptions.php<\/strong> \u2192 fichier principal fourni<\/li>\n<li><strong>assets\/carte-script.js<\/strong> \u2192 JavaScript Leaflet<\/li>\n<li><strong>assets\/carte-style.css<\/strong> \u2192 styles CSS<\/li>\n<li><strong>geocoding-utility.php<\/strong> \u2192 utilitaire (optionnel mais recommand\u00e9)<\/li>\n<\/ol>\n<h2 id=\"-tape-4-g-ocoder-les-tablissements\">\ud83c\udf0d \u00c9tape 4 : G\u00e9ocoder les \u00e9tablissements<\/h2>\n<p>Les coordonn\u00e9es GPS sont indispensables pour afficher les \u00e9tablissements sur la carte.<\/p>\n<h3 id=\"option-a-utiliser-l-utilitaire-de-g-ocodage-recommand-\">Option A : Utiliser l&rsquo;utilitaire de g\u00e9ocodage (RECOMMAND\u00c9)<\/h3>\n<ol>\n<li><strong>Ajouter le code de g\u00e9ocodage<\/strong> dans <code>carte-inscriptions.php<\/code> :\n<pre><code class=\"lang-php\"><span class=\"hljs-comment\">\/\/ \u00c0 la fin du fichier carte-inscriptions.php, avant la ligne finale<\/span>\n<span class=\"hljs-keyword\">require_once<\/span> plugin_dir_path(<span class=\"hljs-keyword\">__FILE__<\/span>) . <span class=\"hljs-string\">'geocoding-utility.php'<\/span>;\n<\/code><\/pre>\n<\/li>\n<li><strong>Cr\u00e9er une page WordPress<\/strong> (en tant qu&rsquo;administrateur) :\n<ul>\n<li>Titre : \u00ab\u00a0G\u00e9ocodage des \u00e9tablissements\u00a0\u00bb<\/li>\n<li>Contenu : <code>&#091;geocode_etabs&#093;<\/code><\/li>\n<li>Publier la page<\/li>\n<\/ul>\n<\/li>\n<li><strong>Acc\u00e9der \u00e0 la page<\/strong> et cliquer sur \u00ab\u00a0D\u00e9marrer le g\u00e9ocodage\u00a0\u00bb<\/li>\n<li><strong>Attendre la fin<\/strong> : le processus g\u00e9ocode automatiquement tous les \u00e9tablissements<\/li>\n<\/ol>\n<h3 id=\"option-b-import-manuel-csv\">Option B : Import manuel CSV<\/h3>\n<p>Si vous avez d\u00e9j\u00e0 un fichier CSV avec les coordonn\u00e9es :<\/p>\n<pre><code class=\"lang-csv\">uai,latitude,longitude\n<span class=\"hljs-number\">0380001<\/span><span class=\"hljs-keyword\">A<\/span>,<span class=\"hljs-number\">45.188529,5<\/span>.<span class=\"hljs-number\">724524<\/span>\n<span class=\"hljs-number\">0750001<\/span>B,<span class=\"hljs-number\">48.841684<\/span>,<span class=\"hljs-number\">2.289960<\/span>\n<\/code><\/pre>\n<p>Import SQL :<\/p>\n<pre><code class=\"lang-sql\"><span class=\"hljs-keyword\">LOAD<\/span> <span class=\"hljs-keyword\">DATA<\/span> <span class=\"hljs-keyword\">LOCAL<\/span> <span class=\"hljs-keyword\">INFILE<\/span> <span class=\"hljs-string\">'coordonnees.csv'<\/span>\n<span class=\"hljs-keyword\">INTO<\/span> <span class=\"hljs-keyword\">TABLE<\/span> wp_etabs_geolocalisation\n<span class=\"hljs-keyword\">FIELDS<\/span> <span class=\"hljs-keyword\">TERMINATED<\/span> <span class=\"hljs-keyword\">BY<\/span> <span class=\"hljs-string\">','<\/span>\n<span class=\"hljs-keyword\">ENCLOSED<\/span> <span class=\"hljs-keyword\">BY<\/span> <span class=\"hljs-string\">'\"'<\/span>\n<span class=\"hljs-keyword\">LINES<\/span> <span class=\"hljs-keyword\">TERMINATED<\/span> <span class=\"hljs-keyword\">BY<\/span> <span class=\"hljs-string\">'\\n'<\/span>\n<span class=\"hljs-keyword\">IGNORE<\/span> <span class=\"hljs-number\">1<\/span> <span class=\"hljs-keyword\">ROWS<\/span>\n(uai, latitude, longitude);\n<\/code><\/pre>\n<h3 id=\"option-c-api-externe-pour-d-veloppeurs-\">Option C : API externe (pour d\u00e9veloppeurs)<\/h3>\n<p>Utiliser un service de g\u00e9ocodage :<\/p>\n<ul>\n<li><strong>API Adresse (gouv.fr)<\/strong> : gratuit, France uniquement<\/li>\n<li><strong>Nominatim (OpenStreetMap)<\/strong> : gratuit, monde entier<\/li>\n<li><strong>Google Geocoding API<\/strong> : payant mais pr\u00e9cis<\/li>\n<\/ul>\n<h2 id=\"-tape-5-activer-l-extension\">\u2705 \u00c9tape 5 : Activer l&rsquo;extension<\/h2>\n<ol>\n<li>Aller dans <strong>WordPress Admin<\/strong> \u2192 <strong>Extensions<\/strong><\/li>\n<li>Trouver \u00ab\u00a0Carte des Inscriptions Eur\u00eakamaths\u00a0\u00bb<\/li>\n<li>Cliquer sur <strong>Activer<\/strong><\/li>\n<\/ol>\n<h2 id=\"-tape-6-afficher-la-carte\">\ud83c\udfa8 \u00c9tape 6 : Afficher la carte<\/h2>\n<h3 id=\"cr-er-une-page-publique\">Cr\u00e9er une page publique<\/h3>\n<ol>\n<li><strong>Cr\u00e9er une nouvelle page<\/strong> :\n<ul>\n<li>Titre : \u00ab\u00a0Carte des inscriptions\u00a0\u00bb<\/li>\n<li>Slug : <code>carte-inscriptions<\/code><\/li>\n<\/ul>\n<\/li>\n<li><strong>Ajouter le shortcode<\/strong> :\n<pre><code>&#091;<\/code>carte_inscriptions<\/code>]\n<\/code><\/pre>\n<\/li>\n<li><strong>Personnaliser (optionnel)<\/strong> :\n<pre><code>&#091;carte_inscriptions height=<span class=\"hljs-string\">\"700px\"<\/span> zoom=<span class=\"hljs-string\">\"7\"<\/span> center_lat=<span class=\"hljs-string\">\"46.603354\"<\/span> center_lng=<span class=\"hljs-string\">\"1.888334\"<\/span>&#093;\n<\/code><\/pre>\n<\/li>\n<li><strong>Publier la page<\/strong><\/li>\n<\/ol>\n<h3 id=\"int-grer-dans-une-page-existante\">Int\u00e9grer dans une page existante<\/h3>\n<p>Vous pouvez combiner avec d&rsquo;autres shortcodes :<\/p>\n<pre><code><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h2<\/span>&gt;<\/span>Les classes inscrites<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h2<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">p<\/span>&gt;<\/span>D\u00e9couvrez toutes les classes participantes sur la carte interactive :<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">p<\/span>&gt;<\/span>\n\n&#091;<code>carte_inscriptions<\/code>]\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h2<\/span>&gt;<\/span>Inscrivez votre classe<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h2<\/span>&gt;<\/span>\n<div class=\"inscription-message-error\">\n                <p>Vous devez \u00eatre connect\u00e9 pour acc\u00e9der au formulaire d\u2019inscription.<\/p>\n                <p><a href=\"https:\/\/mathisere.fr\/wp-login.php?redirect_to=https%3A%2F%2Fmathisere.fr%2Findex.php%2Fadministration%2Fcarte-des-inscrits-2%2F\">Se connecter<\/a> |\n                   <a href=\"https:\/\/mathisere.fr\/wp-login.php?action=register\">S\u2019inscrire<\/a><\/p>\n            <\/div>\n<\/code><\/pre>\n<h2 id=\"-tape-7-v-rification\">\ud83d\udd0d \u00c9tape 7 : V\u00e9rification<\/h2>\n<h3 id=\"v-rifier-que-tout-fonctionne\">V\u00e9rifier que tout fonctionne<\/h3>\n<ol>\n<li><strong>Acc\u00e9der \u00e0 la page<\/strong> de la carte<\/li>\n<li><strong>V\u00e9rifier l&rsquo;affichage<\/strong> :\n<ul>\n<li>\u2705 La carte s&rsquo;affiche correctement<\/li>\n<li>\u2705 Les marqueurs apparaissent<\/li>\n<li>\u2705 Les marqueurs ont les bonnes couleurs (jaune\/vert\/violet)<\/li>\n<li>\u2705 Les popups s&rsquo;ouvrent au clic<\/li>\n<li>\u2705 Les statistiques sont affich\u00e9es<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3 id=\"en-cas-de-probl-me\">En cas de probl\u00e8me<\/h3>\n<p><strong>La carte ne s&rsquo;affiche pas<\/strong> :<\/p>\n<pre><code class=\"lang-sql\"><span class=\"hljs-comment\">-- V\u00e9rifier qu'il y a des inscriptions<\/span>\n<span class=\"hljs-keyword\">SELECT<\/span> <span class=\"hljs-keyword\">COUNT<\/span>(*) <span class=\"hljs-keyword\">FROM<\/span> wp_inscrits;\n\n<span class=\"hljs-comment\">-- V\u00e9rifier qu'il y a des coordonn\u00e9es<\/span>\n<span class=\"hljs-keyword\">SELECT<\/span> <span class=\"hljs-keyword\">COUNT<\/span>(*) <span class=\"hljs-keyword\">FROM<\/span> wp_etabs_geolocalisation\n<span class=\"hljs-keyword\">WHERE<\/span> latitude <span class=\"hljs-keyword\">IS<\/span> <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span> <span class=\"hljs-keyword\">AND<\/span> longitude <span class=\"hljs-keyword\">IS<\/span> <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span>;\n\n<span class=\"hljs-comment\">-- V\u00e9rifier la jointure<\/span>\n<span class=\"hljs-keyword\">SELECT<\/span> <span class=\"hljs-keyword\">COUNT<\/span>(*) <span class=\"hljs-keyword\">FROM<\/span> wp_inscrits i\n<span class=\"hljs-keyword\">INNER<\/span> <span class=\"hljs-keyword\">JOIN<\/span> wp_etabs_geolocalisation e <span class=\"hljs-keyword\">ON<\/span> i.uai = e.uai\n<span class=\"hljs-keyword\">WHERE<\/span> e.latitude <span class=\"hljs-keyword\">IS<\/span> <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span> <span class=\"hljs-keyword\">AND<\/span> e.longitude <span class=\"hljs-keyword\">IS<\/span> <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span>;\n<\/code><\/pre>\n<p><strong>Aucun marqueur<\/strong> :<\/p>\n<ul>\n<li>V\u00e9rifiez la console JavaScript (F12) pour les erreurs<\/li>\n<li>V\u00e9rifiez que l&rsquo;ann\u00e9e scolaire correspond<\/li>\n<li>V\u00e9rifiez les param\u00e8tres du shortcode<\/li>\n<\/ul>\n<p><strong>Les marqueurs sont mal positionn\u00e9s<\/strong> :<\/p>\n<pre><code class=\"lang-sql\"><span class=\"hljs-comment\">-- V\u00e9rifier quelques coordonn\u00e9es<\/span>\n<span class=\"hljs-keyword\">SELECT<\/span> uai, nom_etab, latitude, longitude\n<span class=\"hljs-keyword\">FROM<\/span> wp_etabs_geolocalisation\n<span class=\"hljs-keyword\">WHERE<\/span> latitude <span class=\"hljs-keyword\">IS<\/span> <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span>\n<span class=\"hljs-keyword\">LIMIT<\/span> <span class=\"hljs-number\">5<\/span>;\n<\/code><\/pre>\n<h2 id=\"-tape-8-statistiques-et-suivi\">\ud83d\udcca \u00c9tape 8 : Statistiques et suivi<\/h2>\n<h3 id=\"requ-tes-sql-utiles\">Requ\u00eates SQL utiles<\/h3>\n<p><strong>Nombre d&rsquo;\u00e9tablissements par d\u00e9partement<\/strong> :<\/p>\n<pre><code class=\"lang-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\n    <span class=\"hljs-keyword\">SUBSTRING<\/span>(uai, <span class=\"hljs-number\">1<\/span>, <span class=\"hljs-number\">3<\/span>) <span class=\"hljs-keyword\">as<\/span> departement,\n    <span class=\"hljs-keyword\">COUNT<\/span>(*) <span class=\"hljs-keyword\">as<\/span> nombre\n<span class=\"hljs-keyword\">FROM<\/span> wp_inscrits i\n<span class=\"hljs-keyword\">INNER<\/span> <span class=\"hljs-keyword\">JOIN<\/span> wp_etabs_geolocalisation e <span class=\"hljs-keyword\">ON<\/span> i.uai = e.uai\n<span class=\"hljs-keyword\">WHERE<\/span> i.annee_scolaire = <span class=\"hljs-string\">'2024-2025'<\/span>\n<span class=\"hljs-keyword\">GROUP<\/span> <span class=\"hljs-keyword\">BY<\/span> departement\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span> nombre <span class=\"hljs-keyword\">DESC<\/span>;\n<\/code><\/pre>\n<p><strong>R\u00e9partition par niveau<\/strong> :<\/p>\n<pre><code class=\"lang-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\n    niveau,\n    <span class=\"hljs-keyword\">COUNT<\/span>(*) <span class=\"hljs-keyword\">as<\/span> nombre,\n    <span class=\"hljs-keyword\">SUM<\/span>(nb) <span class=\"hljs-keyword\">as<\/span> total_eleves\n<span class=\"hljs-keyword\">FROM<\/span> wp_inscrits\n<span class=\"hljs-keyword\">WHERE<\/span> annee_scolaire = <span class=\"hljs-string\">'2024-2025'<\/span>\n<span class=\"hljs-keyword\">GROUP<\/span> <span class=\"hljs-keyword\">BY<\/span> niveau;\n<\/code><\/pre>\n<p><strong>\u00c9tablissements sans coordonn\u00e9es<\/strong> :<\/p>\n<pre><code class=\"lang-sql\"><span class=\"hljs-keyword\">SELECT<\/span> <span class=\"hljs-keyword\">DISTINCT<\/span> e.uai, e.nom_etab, e.commune\n<span class=\"hljs-keyword\">FROM<\/span> wp_inscrits i\n<span class=\"hljs-keyword\">LEFT<\/span> <span class=\"hljs-keyword\">JOIN<\/span> wp_etabs_geolocalisation e <span class=\"hljs-keyword\">ON<\/span> i.uai = e.uai\n<span class=\"hljs-keyword\">WHERE<\/span> (e.latitude <span class=\"hljs-keyword\">IS<\/span> <span class=\"hljs-literal\">NULL<\/span> <span class=\"hljs-keyword\">OR<\/span> e.longitude <span class=\"hljs-keyword\">IS<\/span> <span class=\"hljs-literal\">NULL<\/span>)\n<span class=\"hljs-keyword\">AND<\/span> i.annee_scolaire = <span class=\"hljs-string\">'2024-2025'<\/span>;\n<\/code><\/pre>\n<h2 id=\"-tape-9-optimisations-optionnel-\">\ud83c\udfaf \u00c9tape 9 : Optimisations (optionnel)<\/h2>\n<h3 id=\"mise-en-cache\">Mise en cache<\/h3>\n<p>Pour am\u00e9liorer les performances sur un site \u00e0 fort trafic :<\/p>\n<pre><code class=\"lang-php\"><span class=\"hljs-comment\">\/\/ Ajouter dans carte-inscriptions.php<\/span>\n<span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">ajax_get_inscriptions_map<\/span><span class=\"hljs-params\">()<\/span> <\/span>{\n    $cache_key = <span class=\"hljs-string\">'carte_inscriptions_'<\/span> . $annee_scolaire;\n    $cached_data = get_transient($cache_key);\n\n    <span class=\"hljs-keyword\">if<\/span> ($cached_data !== <span class=\"hljs-keyword\">false<\/span>) {\n        wp_send_json_success($cached_data);\n        <span class=\"hljs-keyword\">return<\/span>;\n    }\n\n    <span class=\"hljs-comment\">\/\/ ... code existant pour r\u00e9cup\u00e9rer les donn\u00e9es ...<\/span>\n\n    <span class=\"hljs-comment\">\/\/ Mettre en cache pour 1 heure<\/span>\n    set_transient($cache_key, $data, HOUR_IN_SECONDS);\n\n    wp_send_json_success($data);\n}\n<\/code><\/pre>\n<h3 id=\"invalidation-du-cache\">Invalidation du cache<\/h3>\n<p>Ajouter un hook pour vider le cache quand une inscription est cr\u00e9\u00e9e :<\/p>\n<pre><code class=\"lang-php\">add_action(<span class=\"hljs-string\">'inscription_created'<\/span>, <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span><span class=\"hljs-params\">($annee_scolaire)<\/span> <\/span>{\n    delete_transient(<span class=\"hljs-string\">'carte_inscriptions_'<\/span> . $annee_scolaire);\n});\n<\/code><\/pre>\n<p>[\/accordion_item][accordion_item title=\u00a0\u00bb\ud83d\ude80 Utilisation avanc\u00e9e\u00a0\u00bb]<\/p>\n<h2 id=\"-utilisation-avanc-e\">\ud83d\ude80 Utilisation avanc\u00e9e<\/h2>\n<h3 id=\"afficher-plusieurs-ann-es\">Afficher plusieurs ann\u00e9es<\/h3>\n<p>Cr\u00e9er plusieurs pages avec des ann\u00e9es diff\u00e9rentes :<\/p>\n<pre><code>&#091;carte_inscriptions annee=<span class=\"hljs-string\">\"2024-2025\"<\/span> height=<span class=\"hljs-string\">\"600px\"<\/span>&#093;\n&#091;carte_inscriptions annee=<span class=\"hljs-string\">\"2023-2024\"<\/span> height=<span class=\"hljs-string\">\"600px\"<\/span>&#093;\n<\/code><\/pre>\n<h3 id=\"carte-par-r-gion\">Carte par r\u00e9gion<\/h3>\n<pre><code><span class=\"hljs-comment\">&lt;!-- \u00cele-de-France --&gt;<\/span>\n&#091;carte_inscriptions zoom=\"9\" center_lat=\"48.8566\" center_lng=\"2.3522\"&#093;\n\n<span class=\"hljs-comment\">&lt;!-- Auvergne-Rh\u00f4ne-Alpes --&gt;<\/span>\n&#091;carte_inscriptions zoom=\"8\" center_lat=\"45.764043\" center_lng=\"4.835659\"&#093;\n<\/code><\/pre>\n<h3 id=\"int-gration-dans-un-widget\">Int\u00e9gration dans un widget<\/h3>\n<p>Le shortcode fonctionne aussi dans les widgets WordPress :<\/p>\n<ol>\n<li>Aller dans <strong>Apparence<\/strong> \u2192 <strong>Widgets<\/strong><\/li>\n<li>Ajouter un widget <strong>Texte personnalis\u00e9<\/strong><\/li>\n<li>Coller le shortcode <code>&#091;carte_inscriptions height=\"400px\"&#093;<\/code><\/li>\n<\/ol>\n<h2 id=\"-responsive\">\ud83d\udcf1 Responsive<\/h2>\n<p>La carte est automatiquement responsive et s&rsquo;adapte aux mobiles.<\/p>\n<p>Tailles par d\u00e9faut :<\/p>\n<ul>\n<li><strong>Desktop<\/strong> : 600px de hauteur<\/li>\n<li><strong>Tablette<\/strong> : 400px de hauteur<\/li>\n<li><strong>Mobile<\/strong> : 350px de hauteur<\/li>\n<\/ul>\n<h2 id=\"-personnalisation-des-couleurs\">\u2728 Personnalisation des couleurs<\/h2>\n<p>Pour changer les couleurs des marqueurs, modifier dans <code>carte-script.js<\/code> :<\/p>\n<pre><code class=\"lang-javascript\"><span class=\"hljs-keyword\">var<\/span> iconColors = {\n    <span class=\"hljs-string\">'yellow'<\/span>: <span class=\"hljs-string\">'#FFD700'<\/span>,    <span class=\"hljs-comment\">\/\/ CM1 - modifier ici<\/span>\n    <span class=\"hljs-string\">'green'<\/span>: <span class=\"hljs-string\">'#28a745'<\/span>,     <span class=\"hljs-comment\">\/\/ CM2 - modifier ici<\/span>\n    <span class=\"hljs-string\">'violet'<\/span>: <span class=\"hljs-string\">'#9B59B6'<\/span>     <span class=\"hljs-comment\">\/\/ 6e - modifier ici<\/span>\n};\n<\/code><\/pre>\n<h2 id=\"-ressources\">\ud83c\udf93 Ressources<\/h2>\n<ul>\n<li><strong>Documentation Leaflet<\/strong> : <a href=\"https:\/\/leafletjs.com\/reference.html\">https:\/\/leafletjs.com\/reference.html<\/a><\/li>\n<li><strong>Leaflet.markercluster<\/strong> : <a href=\"https:\/\/github.com\/Leaflet\/Leaflet.markercluster\">https:\/\/github.com\/Leaflet\/Leaflet.markercluster<\/a><\/li>\n<li><strong>API Adresse<\/strong> : <a href=\"https:\/\/adresse.data.gouv.fr\/api-doc\/adresse\">https:\/\/adresse.data.gouv.fr\/api-doc\/adresse<\/a><\/li>\n<li><strong>OpenStreetMap<\/strong> : <a href=\"https:\/\/www.openstreetmap.org\/\">https:\/\/www.openstreetmap.org\/<\/a><\/li>\n<\/ul>\n<h2 id=\"-checklist-finale\">\u2705 Checklist finale<\/h2>\n<p>Avant de mettre en production :<\/p>\n<ul>\n<li>[ ] Extension activ\u00e9e<\/li>\n<li>[ ] Table <code>wp_etabs_geolocalisation<\/code> avec colonnes <code>latitude<\/code> et <code>longitude<\/code><\/li>\n<li>[ ] \u00c9tablissements g\u00e9ocod\u00e9s (v\u00e9rifier avec une requ\u00eate SQL)<\/li>\n<li>[ ] Page cr\u00e9\u00e9e avec le shortcode<\/li>\n<li>[ ] Carte affich\u00e9e correctement<\/li>\n<li>[ ] Marqueurs color\u00e9s par niveau<\/li>\n<li>[ ] Popups fonctionnels<\/li>\n<li>[ ] Statistiques affich\u00e9es<\/li>\n<li>[ ] Responsive test\u00e9 sur mobile<\/li>\n<li>[ ] Performance acceptable (&lt; 2 secondes de chargement)<\/li>\n<\/ul>\n<h2 id=\"-f-licitations-\">\ud83c\udf89 F\u00e9licitations !<\/h2>\n<p>Votre carte interactive est maintenant op\u00e9rationnelle !<\/p>\n<p>Les utilisateurs peuvent visualiser toutes les classes inscrites, filtrer par ann\u00e9e scolaire, et d\u00e9couvrir la r\u00e9partition g\u00e9ographique du concours Eur\u00eakamaths.<br \/>\n[\/accordion_item][\/accordion][\/tab][\/tabs]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Extension WordPress &#8211; Carte des Inscriptions Eur\u00eakamaths [tabs] Extension WordPress &#8211; Carte des Inscriptions Eur\u00eakamaths [tab title=\u00a0\u00bbREADME\u00a0\u00bb] [accordion] [accordion_item title=\u00a0\u00bbDescription\u00a0\u00bb] \ud83d\udccb Description Extension WordPress qui affiche sur une carte interactive (Leaflet) toutes les classes inscrites au concours Eur\u00eakamaths. Les marqueurs sont color\u00e9s selon le niveau (CM1 = jaune, CM2 = vert, 6e = violet) et &#8230; <a title=\"Carte des inscrits\" class=\"read-more\" href=\"https:\/\/mathisere.fr\/index.php\/administration\/carte-des-inscrits-2\/\" aria-label=\"En savoir plus sur Carte des inscrits\">Lire la suite<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":749,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2986","page","type-page","status-publish"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mathisere.fr\/index.php\/wp-json\/wp\/v2\/pages\/2986","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mathisere.fr\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mathisere.fr\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mathisere.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mathisere.fr\/index.php\/wp-json\/wp\/v2\/comments?post=2986"}],"version-history":[{"count":0,"href":"https:\/\/mathisere.fr\/index.php\/wp-json\/wp\/v2\/pages\/2986\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/mathisere.fr\/index.php\/wp-json\/wp\/v2\/pages\/749"}],"wp:attachment":[{"href":"https:\/\/mathisere.fr\/index.php\/wp-json\/wp\/v2\/media?parent=2986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}