Sorry, this is probably a duplicate question, but how can I iterate over a list in Javascript inside another object without using eval()?
See pseudocode in CAPITALS below:
polygon = polygon['coordinates']; //list object
var polygon = new CM.Polygon([
FOR POLY IN POLYGON {
new CM.LatLng(poly[1], poly[0]),
}
]);
Obviously, I don't want a real for-loop inside the CM.Polygon object (a CloudMade map object), what I want is simply to output each LatLng in the list in turn.
Thanks!