I am working on adding multiple polylines to my map. However, after some logic processing, I need to loop through the map.entities collection to retrieve all the polylines that I have added.
var polylineN = new Microsoft.Maps.Polyline(loc);
map.entities.push(polylineN);
When I iterate through map.entities, I notice that there are functions, Objects, and various data types present. I believe using the map.entities.get function might help me retrieve the correct entities, but how do I determine the length of the index to iterate through?
map.entities.get(0) //works fine
For example:
_.each(map.entities, function(entity){
console.log(entity); //it returns all kinds of data
});
Any assistance would be greatly appreciated. An iteration sample in JavaScript or using underscore would be helpful.