ExpoActes : géolocalisation manuelle d’une commne

actes/admin/gestgeoloc.php

on commente ou supprime tout ce qui est relation avec Google Maps

apres les lignes :

[..............]   

echo " <tr>\n";
    echo "  <td align='right'>Longitude : </td>\n";
    echo '  <td><input type="text" name="lon" id="lon" size="10" value="'.$row['LON'].'" />'."</td>\n
    echo '  <td rowspan="4">';

on insére

echo '<link rel="stylesheet" href="/leaflet/leaflet.css" />';
echo '<link rel="stylesheet" href="/leaflet/leaflet.fullscreen.css" />';
echo '<div id="map"></div>';
echo '<script src="/leaflet/leaflet.js" ></script>';
echo '<script src="/leaflet/Leaflet.fullscreen.min.js"></script>';
echo '<script type="text/javascript">';
echo '  var lat = '.$lat.';';
echo '  var lon = '.$lon.';';
echo '  var macarte = null;';
echo '  function initMap() {';
echo '          var iconBase = "/actes/img/pin_eye.png";';
echo "          macarte = L.map('map').setView([lat, lon], 13);";
echo '          L.tileLayer("https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png", {';
echo '                  attribution: \'données © <a href="//osm.org/copyright">OpenStreetMap</a>/ODbL - rendu <a href="//openstreetmap.fr">OSM France</a>\',';
echo '                  minZoom: 1,';
echo '                  maxZoom: 20';
echo '          }).addTo(macarte);';
echo '          var myIcon = L.icon({';
echo '                  iconUrl: iconBase ,';
echo '                  iconSize: [21, 34],';
echo '                  iconAnchor: [0, 0],';
echo '                  popupAnchor: [0, 0],';
echo '          });';
echo '          var marker = L.marker([lat, lon],{ icon: myIcon,draggable:true}).addTo(macarte);';
echo "          marker.on('drag', function (e) {";
echo "                  document.getElementById('lat').value = marker.getLatLng().lat;";
echo "                  document.getElementById('lon').value = marker.getLatLng().lng;";
echo "                });";
echo "                marker.on('click', L.DomEvent.stopPropagation);";
echo "                marker.addTo(macarte)";
// pour le passage en plein écran
echo '          macarte.addControl(new L.Control.Fullscreen({';
echo '               title: {';
echo "             'false': 'Passer en plein écran',";
echo "             'true': 'Sortir du plein écran'";
echo '                      }';
echo '                  }));';
echo '  }';
echo 'window.onload = function(){';
echo '          initMap(); ';
echo '};';
echo '</script>';
echo '<style type="text/css">';
echo '  #map{ ';
echo '          height:400px;';
echo '          width:400px;';
echo '  }';
echo '</style>';
echo '</div>';

[......]