pero ahora lo que quiero es llamar a las rutas del .txt en la funcion.
Codigo GoogleMaps:
Código Javascript:
Ver original
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Google Maps JavaScript API Example: Event Context</title> <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type="text/javascript"></script> <script src="rutas.txt"></script> <script type="text/javascript"> var map; var directionsPanel; var directions; function initialize() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map_canvas")); directionsPanel = document.getElementById("my_textual_div"); map.setCenter(new GLatLng(19.0452, -98.1975), 13); directions = new GDirections(map, directionsPanel); directions.load("from: 19.073260673918124, -98.2043295353651 to: 19.06999624726789, -98.20791766047478 to: 19.064128229593183, -98.1915333867073 to: 19.0257550617554, -98.20219047367573 to: 18.97479962658195, -98.19917231798172"); GEvent.addListener(map, "moveend", function() { var center = map.getCenter(); document.getElementById("message").innerHTML = center.toString(); }); } } </script> </head> <body onload="initialize()" onunload="GUnload()"> <div id="map_canvas" style="width: 500px; height: 300px"></div> <div id="message"></div> </body> </html>
rutas.txt:
Código Archivo de Texto:
Ver original
coordenada_x1="19.073260673918124"; coordenada_y1="-98.2043295353651"; coordenada_x2="19.06999624726789"; coordenada_y2="-98.20791766047478"; coordenada_x3="19.064128229593183"; coordenada_y3="-98.1915333867073"; coordenada_x4="19.0257550617554"; coordenada_y4="-98.20219047367573"; coordenada_x5="18.97479962658195"; coordenada_y5="-98.19917231798172";