1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
window.onload = function () {
var map = L.map('map').setView([36.66842,3.69141],10);
L.tileLayer('MapQuest/{z}/{x}/{y}.png', {
attribution: '© <a href="[http://osm.org/copyright]">OpenStreetMap</a> contributors'
}).addTo(map);
var j=0;
function choix(matricule)
{
if(matricule==<?php if(isset($_SESSION['mat']) and !empty($_SESSION['mat']) ){ echo $_SESSION['mat'];}else{echo "matricule";} ?>)
{
alert("egale");
L.marker([point[j][0],point[j][1]]).addTo(map).bindPopup('A pretty CSS3 popup]. <br> Easily customizable.'); // Ce bout de code appartient a la fonction anonyme window.onload = function ()
j++;
}
else
{
alert("non");
var form= document.getElementById("formul");
form.action="localiser.php?page=localiser";
<?php if(isset($_POST['matricule'])){ $_SESSION['mat'] = $_POST['matricule']; }?>
form.submit();
}
};
map.on('dragend', function latlng()
{
var cordonnee = document.getElementById("lat");
cordonnee.value = map.getCenter().lat;
cordonnee = document.getElementById("lng");
cordonnee.value = map.getCenter().lng;
});
map.on('zoomend', function latlng()
{
var cordonnee = document.getElementById("lat");
cordonnee.value = map.getCenter().lat;
cordonnee = document.getElementById("lng");
cordonnee.value = map.getCenter().lng;
});
}; |
Partager