Vuelvo a las andadas. Despues de un tiempo sin errores me encuentro con esto:
este es mi código:
Código PHP:
Ver original
<?php //Conexion db ?> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0px; padding: 0px } #map_canvas { height: 100% } </style> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=es"> </script> <script type="text/javascript"> window.onload = function () { var options = { zoom: 5, center: new google.maps.LatLng(40.84706, -2.944336), mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('map_canvas'), options); <?php ?> var Airport1 = '<h3 align="center" style="font-family:Arial, Helvetica, sans-serif"><?php echo $icao; ?> - <?php echo $city; ?></h3>'; var image = 'http://i46.tinypic.com/33zbm09.png'; var latLonCenter = new google.maps.LatLng(<?php echo $latitude; ?>, <?php echo $longitude; ?>); marker = new google.maps.Marker({ position: latLonCenter, map: map, draggable: false, icon: image, title: '<?php echo $icao; ?> - <?php echo $city; ?>', Airport1: Airport1 }); var infowindow = new google.maps.InfoWindow({ content: Airport1 }); google.maps.event.addListener(marker, 'click', function () { var n = 1; var infowindow = new google.maps.InfoWindow({ content: "", maxWidth: 320, zIndex: n }); infowindow.setContent(this.Airport1); infowindow.setZIndex(n++); // superpone el último infowindows infowindow.open(map, this); }); <?php ?> var PolyLine = new google.maps.Polyline({ strokeColor: "#FF0000", strokeOpacity: 2.0, strokeWeight: 2 }); var polyCords = [ new google.maps.LatLng(<?php echo $latitude; ?>, <?php echo $longitude; ?>), new google.maps.LatLng(<?php echo $latitudeD; ?>, <?php echo $longitudeD; ?>) ]; google.maps.event.addListener(marker, 'click', function() { PolyLine.setPath(polyCords); PolyLine.setMap(map); }); <?php } } ?> } </script> </head> <body> <center><div id="map_canvas" style="width:850px; height:560px;"></div></center> </body>
Lo que pasa es que no me muestra las polilyne . Al pulsar en el marker que se abra una red de polylines hacia otros marker. Los marker se muestran sin problemas pero al pulsar en ellos los polylines no aparecen.
La idea es hacer algo como este mapa: http://www.ibe-va.com/index.php?opti...mid=90&lang=en