1
I cannot visualize the line on the map the code is apparently correct not break in any lines ,when viewed by the console . no longer visualize the line.
function initialize() {
var latlng = new google.maps.LatLng(latitudes, longitudes);
var options = {
zoom: 12,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("mapa"), options);
geocoder = new google.maps.Geocoder();
if (coord.length > 1) {
for (var i = 0; i < coord.length; i++) {
var location = coord[i].split(",");
pontos[i] = new google.maps.LatLng(location[0], location[1]);
}
var flightPath = new google.maps.Polyline({
path: pontos,
strokeColor: '#FF0000',
strokeOpacity: 1.0,
strokeWeight: 3,
map: map,
});
flightPath.setMap(map);
}
}
initialize();
What is your doubt?
– Felipe Avelar
I can’t see the line on the map!
– Hans Miller
Explain your question in more detail in the body of the question
– Felipe Avelar
Your array
pontos
was defined and initialized?– Paulo Rodrigues
yes declared the array inside the function until
– Hans Miller
I tried to reproduce exactly what you have here on Jsfiddle and it worked properly. See if you can compare it to what you have.
– Paulo Rodrigues
there are point limits? for my point array is a very long list!
– Hans Miller
I believe there is no limit. You have tried this test with a reduced number?
– Paulo Rodrigues
I did a test up with an array already defined with some items. and still does not generate.
– Hans Miller