eliminar marcadores
Publicado por sirez (1 intervención) el 09/07/2018 17:51:02
Cordial saludo
antes de colocar mis marcadores en el mapa deseo eliminar los que hay.
que instrucción me hace falta y donde va
gracias
siREZ
antes de colocar mis marcadores en el mapa deseo eliminar los que hay.
que instrucción me hace falta y donde va
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
<script type="text/javascript">
function inicializar_mapa() {
var marcadores = [
['Estas Aqui', <?php echo $mi_lat;?>, <?php echo $mi_lon;?>],
['<?php echo $tex1;?>', <?php echo $la1;?>, <?php echo $lo1;?>],
['<?php echo $tex2;?>', <?php echo $la2;?>, <?php echo $lo2;?>],
['<?php echo $tex3;?>', <?php echo $la3;?>, <?php echo $lo3;?>]
];
var mapOptions = {
center: new google.maps.LatLng(<?php echo $mi_lat;?>, <?php echo $mi_lon;?>),
zoom: 16,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("mapa_div"),
mapOptions);
var infowindow = new google.maps.InfoWindow();
var marker, i;
for (i = 0; i < marcadores.length; i++) {
var icon = "img/" + i + ".png";
marker = new google.maps.Marker({
position: new google.maps.LatLng(marcadores[i][1], marcadores[i][2]),
icon: icon,
map: map
});
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.setContent(marcadores[i][0]);
infowindow.open(map, marker);
}
})(marker, i));
}
}
</script>
gracias
siREZ
Valora esta pregunta


0