Ver Mensaje Individual
  #3 (permalink)  
Antiguo 18/10/2013, 23:47
Montes28
 
Fecha de Ingreso: septiembre-2010
Mensajes: 1.853
Antigüedad: 13 años, 7 meses
Puntos: 6
Respuesta: Como ubicar puntos en un mapa google maps desde array json

amigos ya le pongo marcadores al mapa pero me falta que al darle click aparezca la InfoWindow

Código Javascript:
Ver original
  1. $(function() {
  2.         // Inicializando Google Maps Api
  3.    
  4.         // Punto de latitud y longitud usado por el api
  5.         var myLatlng = new google.maps.LatLng(4.8925, -75.32361);
  6.         // Opciones del mapa
  7.         var mapOptions = {
  8.             center: myLatlng,
  9.             zoom: 12,
  10.             mapTypeId: google.maps.MapTypeId.TERRAIN
  11.         };
  12.         var map = new google.maps.Map(document.getElementById("googleMap"), mapOptions);
  13.  
  14.         $.ajax({
  15.             url: 'http:/volcano/public/getRepetidoras/',
  16.             type: 'GET'      
  17.         }).done(function(response){
  18.             var repetidoras = JSON.parse(response);
  19.             //console.log(repetidoras);
  20.             //alert(repetidoras);
  21.  
  22.             var myIcon = new google.maps.MarkerImage("../public/img/Repetidora.png", null, null, null, new google.maps.Size(16,16));
  23.  
  24.  
  25.             $.each(repetidoras, function(index, item){                
  26.                 var marker = new google.maps.Marker({
  27.                     position: new google.maps.LatLng(item.latitud, item.longitud),
  28.                     map: map,
  29.                     title: item.nombre,
  30.                     icon: myIcon,
  31.  
  32.                 });
  33.  
  34.                
  35.             });            
  36.        });
  37.  
  38. });

alguien me puede orientar

Última edición por Montes28; 18/10/2013 a las 23:55