JavaScript - hola no logro hacer que mi marcador se arrastre y que se agrupen como hago

 
Vista:
sin imagen de perfil

hola no logro hacer que mi marcador se arrastre y que se agrupen como hago

Publicado por Jean Paul (3 intervenciones) el 22/03/2017 00:41:58
a
b
c
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de xve
Val: 3.162
Oro
Ha mantenido su posición en JavaScript (en relación al último mes)
Gráfica de JavaScript

hola no logro hacer que mi marcador se arrastre y que se agrupen como hago

Publicado por xve (2100 intervenciones) el 22/03/2017 08:47:59
Estaría bien que pegaras el código en vez de poner imágenes para poder copiarlo!!!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

hola no logro hacer que mi marcador se arrastre y que se agrupen como hago

Publicado por Jean Paul (3 intervenciones) el 23/03/2017 00:47:25
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!DOCTYPE html>
 <html lang="es">
  <head>
    <meta charset="UTF-8">
    <style type="text/css">
    #mapa { height: 500px; }
    </style>
   <script async defer
      src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBcBM1MEathfs-EYh-HLbAxxFMc-86u6xc&callback=initMap">
    </script>
<script src="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js">
    </script>
 
    <script>
 
      function writeAddressName(latLng) {//funcion para extarer ubicacion con la ip
        var geocoder = new google.maps.Geocoder();
        geocoder.geocode
 
        ({
          "location": latLng
 
        },
        function(results, status) {
          if (status == google.maps.GeocoderStatus.OK)
            document.getElementById("latLng").innerHTML='Latitud: '+marker.getPosition().lat();
 
          else
            document.getElementById("error").innerHTML += "Unable to retrieve your address" + "<br />";
        });
 
 
 
      }
 
      function geolocationSuccess(position)
	  {
         var marcadores = [
		 ['mi ubicacion',position.coords.latitude, position.coords.longitude],
        ['resultados de db', 10.2695266,-84.4864645],
        ['resultados de db2',10.2702022,-84.4770231]
 
      ];
var userLatLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
      var map = new google.maps.Map(document.getElementById('mapa'), //muestra el mapa en el div mapa
	  {
        zoom: 13,//distancia a la que se ve el marcadro
        center: userLatLng,//centra la vista del mapa en nuestra ubicacion
 
        mapTypeId: google.maps.MapTypeId.ROADMAP
      });
 
      var infowindow = new google.maps.InfoWindow();
      var marker, i;//arreglo para mostrar varios marcadores
 
 
      for (i = 1; i < marcadores.length; i++)
	  {
		if(i <= 1)
		{
			marker = new google.maps.Marker(//agarra la ubicacion de uno y mueve el marcador
			{
				position: new google.maps.LatLng(marcadores[0][1], marcadores[0][2]),
				 draggable: true,
				  map: map
			});
		}
        marker = new google.maps.Marker(//agarra la ubicacion de los locales y no  se mueve el marcador
		{
          position: new google.maps.LatLng(marcadores[i][1], marcadores[i][2]),
          map: map
        });
 
 
        		/*nombre al click del puntero*/
        google.maps.event.addListener(marker, 'click', (function(marker, i) {
          return function()
		  {
            infowindow.setContent(marcadores[i][0]);
            infowindow.open(map,marker);
          }
 
        })(marker, i));
 
      }
     }
 
      function geolocationError(positionError) {
        document.getElementById("error").innerHTML += "Error: " + positionError.message + "<br />";
      }
 
      function geolocateUser() {
        // If the browser supports the Geolocation API
        if (navigator.geolocation)
        {
          var positionOptions = {
            enableHighAccuracy: true,
            timeout: 10 * 1000 // 10 seconds
          };
          navigator.geolocation.getCurrentPosition(geolocationSuccess, geolocationError, positionOptions);
        }
        else
          document.getElementById("error").innerHTML += "Your browser doesn't support the Geolocation API";
      }
 
      window.onload = geolocateUser;
    </script>
  </head>
  <body>
    <div id="mapa"></div>
	<p><b>Address</b>: <span id="latLng"></span></p>
  </body>
</html>
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

hola no logro hacer que mi marcador se arrastre y que se agrupen como hago

Publicado por Jean Paul (3 intervenciones) el 23/03/2017 00:49:44
Ya logre que el puntero se mueva ahora tengo que hacer que se agrupen cuando se les de zoom y que muestre mi direccion exacta y no longitud y latitud
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar