37
rated 0 times
[
40]
[
3]
/ answers: 1 / hits: 7106
/ 10 Years ago, tue, july 8, 2014, 12:00:00
I was trying to draw a dynamic polyline in Javascript using Google Map API v3, Here is the Code snippet which i am using :
var map=new google.maps.Map(document.getElementById(googleMap),mapProp);
var myTrip=new Array();
//var y=new google.maps.LatLng(28.360012,77.031527);
//var z=new google.maps.LatLng(28.360124,77.031429);
myTrip.push(new google.maps.LatLng(28.360012,77.031527));
myTrip.push(new google.maps.LatLng(28.360124,77.031429));
myTrip.push(new google.maps.LatLng(28.361024,77.034129));
var flightPath=new google.maps.Polyline({
path:myTrip,
strokeColor:#0000FF,
strokeOpacity:0.8,
strokeWeight:2
});
flightPath.setMap(map);
google.maps.event.addDomListener(window, 'load', initialize);
This isn't drawing Polyline on the map.
Can someone please help me with this ?
More From » google-maps-api-3