CODE:
var geocoder = new GClientGeocoder();
var map;
var directionsArray = [];
var i = 0;
var colors = new Array('FF0000');
window.onload = function() {
geocoder.setBaseCountryCode("pt_BR");
map = new GMap2(document.getElementById('map'), { size: new
GSize(710,480) });
//map.setCenter(new GLatLng(47.400000,-122.210000), 12);
map.setCenter(new GLatLng(47.400000,-122.210000), 9);
map.addControl(new GSmallMapControl());
/*var route1 = 'from: 47.400000,-122.210000 to: ' +
'47.410000,-122.190000 to: 47.460000,-122.250000 to: ' +
'47.450000,-122.240000 to: 47.400000,-122.210000';*/
var route1 = 'from: 47.400000,-122.210000 to: ' +
'47.410000,-122.170000';
var routes = [route1];
for (j = 0; j < routes.length; j++) {
directionsArray[j] = new GDirections();
GEvent.addListener(directionsArray[j], "load",
onGDirectionsLoad);
directionsArray[j].load(routes[j], {getPolyline:true});
}
}
function onGDirectionsLoad() {
//var polyline = directionsArray[i].getPolyline();
var polyline = directionsArray[0].getPolyline();
polyline.setStrokeStyle({color:colors[0], weight:3, opacity:
0.7});
polyline.show();
map.addOverlay(polyline);
i++;
}
The lines semms to apper and suddenly disappear. Is there something
wrong with the code?
Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---