I'm trying to use the longitude latitude as a waypoint in my google maps and cant seem to get it working.
Here's how I have my values pushed
waypts_mtlsheloc.push({
location: (45.658197,-73.636333), //I don't think I'm supposed to write this like that. But can't find the right way.
stopover: true
})
And then try to modify my line like this
service.route({
origin: latlng_mtlsheloc[0],
destination: latlng_mtlsheloc[latlng_mtlsheloc.length - 1],
waypoints:waypts_mtlsheloc,
travelMode: google.maps.DirectionsTravelMode.DRIVING
}, function(result, status) {
console.log(status)
if (status == google.maps.DirectionsStatus.OK) {
path = path.concat(result.routes[0].overview_path);
line_mtlsheloc.setPath(result.routes[0].overview_path);
}
});
But it gives me an error "Error in property [waypoint]", I've tried different methods of writing down the location, but can't seem to find the right one.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…