correciones para mapa.php
This commit is contained in:
parent
198249d5ab
commit
88d4a4c63d
@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset=utf-8 />
|
||||
<title>Display latitude longitude on marker movement</title>
|
||||
<title>Mapa tupale.co</title>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script>
|
||||
|
||||
@ -43,7 +43,7 @@ var mapa = window.parent.document.getElementById('<?php echo $_REQUEST[id]?>');
|
||||
var z = map.getZoom();
|
||||
mapa.value= m.lng+' '+m.lat+' '+z;
|
||||
}
|
||||
//map.on('locationfound', onLocationFound);
|
||||
|
||||
}
|
||||
map.on('locationfound', onLocationFound);
|
||||
function onLocationError(e) {
|
||||
@ -68,35 +68,19 @@ map.on('locationerror', onLocationError);
|
||||
|
||||
var marker = L.marker([<?php echo $lon ?>,<?php echo $lat ?>],{draggable: true}).addTo(map);
|
||||
var mapa = window.parent.document.getElementById('<?php echo $_REQUEST[id]?>');
|
||||
|
||||
map.setView([<?php echo $lon ?>, <?php echo $lat ?>], <?php echo $zoom ?>);
|
||||
// map.locate({setView: true, maxZoom: 16});
|
||||
marker.on('dragend', ondragend);
|
||||
ondragend();
|
||||
function ondragend() {
|
||||
var m = marker.getLatLng();
|
||||
var z = map.getZoom();
|
||||
mapa.value= m.lng+' '+m.lat+' '+z;
|
||||
}
|
||||
|
||||
|
||||
<?php }?>
|
||||
|
||||
//var lat = window.parent.document.getElementById('lat');
|
||||
//var lng = window.parent.document.getElementById('lon');
|
||||
//var mapa = window.parent.document.getElementById('<?php echo $_REQUEST[id]?>');
|
||||
|
||||
//var marker = L.marker([<?php echo $lon ?>,<?php echo $lat ?>],{draggable: true}).addTo(map);
|
||||
|
||||
|
||||
|
||||
// every time the marker is dragged, update the coordinates container
|
||||
//marker.on('dragend', ondragend);
|
||||
|
||||
// Set the initial marker coordinate on load.
|
||||
//ondragend();
|
||||
|
||||
/*
|
||||
function ondragend() {
|
||||
var m = marker.getLatLng();
|
||||
var z = map.getZoom();
|
||||
|
||||
// lat.value= m.lat;
|
||||
// lng.value= m.lng;
|
||||
mapa.value= m.lng+' '+m.lat+' '+z;
|
||||
}*/
|
||||
</script>
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user