correciones para mapa.php
This commit is contained in:
parent
a28b443a98
commit
198249d5ab
@ -4268,7 +4268,7 @@ foreach ($geocoder as $clave => $valor) {
|
||||
$pais = $valor['address']['country'];
|
||||
$departamento = $valor['address']['state'];
|
||||
$licencia= $valor['licence'];
|
||||
$link = "milfs/mapa.php?lat=$valor[lon]&lon=$valor[lat]&zoom=16&id=$campo&localizado";
|
||||
$link = "milfs/mapa.php?lat=$valor[lon]&lon=$valor[lat]&zoom=16&id=$campo&exif";
|
||||
$linea .= "
|
||||
<div onclick=\" xajax_limpia_div('muestra_geocoder'); document.getElementById('mapita').src='$link'; \" style='padding:5px; border-radius: 3px;margin:5px;border: 1px solid gray; background-color : white;'>
|
||||
<ul class='list-unstyled' >
|
||||
|
@ -2,11 +2,11 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset=utf-8 />
|
||||
<title>Tupale.co</title>
|
||||
<title>Display latitude longitude on marker movement</title>
|
||||
|
||||
<script src="../librerias/leaflet/leaflet.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script>
|
||||
|
||||
<link rel="stylesheet" href="../librerias/leaflet/leaflet.css" />
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" />
|
||||
<style>
|
||||
body { margin:0; padding:0; }
|
||||
#map {width: 100%;height: 280px;}
|
||||
@ -28,7 +28,8 @@ var map = L.map('map')
|
||||
.setView([<?php echo $lon ?>, <?php echo $lat ?>], <?php echo $zoom ?>);
|
||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);
|
||||
<?php
|
||||
if(!isset($_REQUEST['exif']) or !isset($_REQUEST['localizado'])) { ?>
|
||||
if(!isset($_REQUEST['exif'])) { ?>
|
||||
|
||||
function onLocationFound(e) {
|
||||
var radius = e.accuracy / 2;
|
||||
var marker = L.marker(e.latlng,{draggable: true}).addTo(map)
|
||||
@ -42,18 +43,15 @@ 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);
|
||||
|
||||
<?php } ?>
|
||||
map.on('locationfound', onLocationFound);
|
||||
function onLocationError(e) {
|
||||
//alert(e.message);
|
||||
|
||||
|
||||
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 ?>);
|
||||
marker.on('dragend', ondragend);
|
||||
ondragend();
|
||||
function ondragend() {
|
||||
@ -62,8 +60,20 @@ function onLocationError(e) {
|
||||
mapa.value= m.lng+' '+m.lat+' '+z;
|
||||
}
|
||||
}
|
||||
map.on('locationerror', onLocationError);
|
||||
map.locate({setView: true, maxZoom: 16});
|
||||
|
||||
map.on('locationerror', onLocationError);
|
||||
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]?>');
|
||||
map.setView([<?php echo $lon ?>, <?php echo $lat ?>], <?php echo $zoom ?>);
|
||||
// map.locate({setView: true, maxZoom: 16});
|
||||
|
||||
|
||||
<?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]?>');
|
||||
|
Loading…
Reference in New Issue
Block a user