1
0
forked from qwerty/milfs

mejoras en el campo mapa

This commit is contained in:
humano 2018-10-10 09:51:13 -05:00
parent 24d2a436db
commit 7f27c1280d

View File

@ -41,11 +41,11 @@ var map = L.map('map')
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map); L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);
<?php <?php
if(!isset($_REQUEST['exif'])) { ?> if(!isset($_REQUEST['exif'])) { ?>
function onLocationFound(e) { function onLocationFound(e) {
var radius = e.accuracy / 2; //var radius = e.accuracy / 2;
var marker = L.marker(e.latlng,{draggable: true}).addTo(map) var marker = L.marker(e.latlng,{draggable: true}).addTo(map);
L.circle(e.latlng, radius).addTo(map); var mapa = window.parent.document.getElementById("<?php echo $_REQUEST[id] ?>");
var mapa = window.parent.document.getElementById('<?php echo $_REQUEST[id]?>');
marker.on('dragend', ondragend); marker.on('dragend', ondragend);
ondragend(); ondragend();
@ -56,12 +56,6 @@ var mapa = window.parent.document.getElementById('<?php echo $_REQUEST[id]?>');
} }
} }
map.on('locationfound', onLocationFound);
<?php } ?>
function onLocationError(e) { function onLocationError(e) {
//alert(e.message); //alert(e.message);
var marker = L.marker([<?php echo $lon ?>,<?php echo $lat ?>],{draggable: true}).addTo(map); var marker = L.marker([<?php echo $lon ?>,<?php echo $lat ?>],{draggable: true}).addTo(map);
@ -71,11 +65,27 @@ function onLocationError(e) {
function ondragend() { function ondragend() {
var m = marker.getLatLng(); var m = marker.getLatLng();
var z = map.getZoom(); var z = map.getZoom();
mapa.value= m.lng+' '+m.lat+' '+m.z; mapa.value= m.lng+' '+m.lat+' '+z;
} }
} }
map.on('locationerror', onLocationError); map.on('locationerror', onLocationError);
map.on('locationfound', onLocationFound);
map.locate({setView: true, maxZoom: 16}); map.locate({setView: true, maxZoom: 16});
<?php }else{ ?>
var marker = L.marker([<?php echo $lon ?>,<?php echo $lat ?>],{draggable: true}).addTo(map);
var mapa = window.parent.document.getElementById('<?php echo $_REQUEST[id]?>');
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 lat = window.parent.document.getElementById('lat');
//var lng = window.parent.document.getElementById('lon'); //var lng = window.parent.document.getElementById('lon');
//var mapa = window.parent.document.getElementById('<?php echo $_REQUEST[id]?>'); //var mapa = window.parent.document.getElementById('<?php echo $_REQUEST[id]?>');