I can better explain my case by code snippet
var cascadiaFault = new google.maps.Polyline({
paths: [
new google.maps.LatLng(49.95, -128.1),
new google.maps.LatLng(46.26, -126.3),
new google.maps.LatLng(40.3, -125.4)
]
});
the value of paths property should be assigned from external variable pathsTemp
var pathsTemp = [];
for (var i = 0; i < boxes.length; i++) {
var bounds = boxes[i];
// Perform search over this bounds
pathsTemp.push(bounds.getCenter());
}
var cascadiaFault = new google.maps.Polyline({
paths: pathsTemp;
});
Its not working..
Other options that I tried
paths = pathsTemp; -- Not working
paths: paths.push(pathsTmep) -- No syntactic error but, uncaught reference error at runtime when this line is reached
PS: I don't have javascript background and unfortunately I don't have time to start reading the syntax and rules from scratch (However, I can understand most of the js code already written)

pathsTempis the correct array? (what does getCenter return? a new LatLng object?)boxes[i]is of typegoogle.maps.LatLngBounds..bounds.getCenter()returns object of typegoogle.maps.LatLngpathsproperty. It only has apath(pathsis for Polygons)pathsdevelopers.google.com/maps/documentation/javascript/…