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

hola amigos espero me puedan ayudar

tengo que ubicar unos puntos en un map de google maps, hasta el momento tengo lo siguiente

Código HTML:
Ver original
  1. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>  
  2.     <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=AIzaSyDY0kkJiTPVd2U7aTOAwhc9ySH6oHxOIYM&sensor=fals"></script>
  3. <script type="text/javascript" src="mapa.js"></script>

en mapa.js

Código Javascript:
Ver original
  1. function initialize()
  2. {
  3. var mapProp = {
  4.   center:new google.maps.LatLng(5.07,-75.52056),
  5.   zoom:5,
  6.   mapTypeId:google.maps.MapTypeId.ROADMAP
  7.   };
  8. var map=new google.maps.Map(document.getElementById("googleMap")
  9.   ,mapProp);
  10. }
  11.  
  12. google.maps.event.addDomListener(window, 'load', initialize);


Código HTML:
Ver original
  1. <div id="googleMap" align="center"style="width:300px;height:280px;" ></div>

con php estoy generando este array json

Cita:
[{"id":1,"nombre":"OLLETA","longitud":"-75.35410416666670","latitud":"4.89291416666667","v olcan_id":1,"map_id":1,"image_id":5,"descripcion": "","created_at":"2013-10-10 11:46:51","updated_at":"2013-10-10 11:59:46"},{"id":5,"nombre":"EL ALGUACIL","longitud":"-75.35259777777780","latitud":"4.96046944444444","v olcan_id":1,"map_id":1,"image_id":4,"descripcion": "","created_at":"2013-10-10 11:47:36","updated_at":"2013-10-10 14:44:07"},{"id":2,"nombre":"CISNE","longitud":"-75.34563166666670","latitud":"4.84416333333333","v olcan_id":1,"map_id":1,"image_id":5,"descripcion": "","created_at":"2013-10-10 11:47:07","updated_at":"2013-10-10 14:54:58"}]
como coloco los puntos en el mapa?

amigos primero debo mediante javascript atrapar el array json?

Última edición por Montes28; 17/10/2013 a las 23:43