Google Maps V3: Invalid Value For Constructor Parameter 0 While Drawing Polylines
I have a problem when constructing a polygon. The error message says something like: Invalid value for constructor parameter 0: (49.27862248020283, -122.79301448410035),(49.27796
Solution 1:
I was having the same problem. Don't know if its the best solution, probably not, but it worked for me.
The problem was that the Latlng weren't being recognized. So I recreated the array.
var lats = [];
var lat_size = steps[step].lat_lngs.length;
for (var t=0; t <lat_size; t++) {
lats.push(new google.maps.LatLng(steps[step].lat_lngs[t].lat(), steps[step].lat_lngs[t].lng()))
}
var polylineOptions = {
map: map,
path: lats
}
new google.maps.Polyline(polylineOptions);
Post a Comment for "Google Maps V3: Invalid Value For Constructor Parameter 0 While Drawing Polylines"