5
I cannot mark several points on the map. They could check if there is something wrong with the code?
var map;
var idInfoBoxAberto;
var infoBox = [];
var marker ;
var geocoder;
function initialize() {
var latlng = new google.maps.LatLng(latitudes, longitudes);
var options = {
zoom: 14,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("mapa"), options);
geocoder = new google.maps.Geocoder();
for (var i = 0; i < coord.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(coord[i]),
map: map,
});
}
}
initialize();
in the variable coord mi returns the following data ex:-03.734084,-038.576155
– Hans Miller
Is a
string
at this value?– Paulo Rodrigues
that’s right! maybe because it is in this format is not working!!
– Hans Miller
Right, so I adjusted my answer. See if now goes.
– Paulo Rodrigues
you have devised how to draw a line between the dots?
– Hans Miller
You refer to navigation routes or straight lines?
– Paulo Rodrigues
draw a straight line from one point to the other!
– Hans Miller
Here has an example of how to accomplish this. If you prefer, you can open a new question for this question. Do not forget to mark this as accepted if you have answered your question.
– Paulo Rodrigues