Using OpenLayers 3, the forEach method doesn't actually work, but only within this fu

المشرف العام

Administrator
طاقم الإدارة
I'm using OpenLayers 3 with AngularJS. I'm trying to make a factory such that I can generate an object for a tree control.

My function (which doesn't actually do anything yet), looks likes this:

getObjectFromMap: function(mapLayers) { console.log(mapLayers); mapLayers.forEach(function(element, index, array) { console.log(index); });}When I try to use the forEach method elsewhere in my application, it works fine. Within this method, the first console.log prints an ol.Collection as expected.

The forEach then does absolutely nothing.

Any ideas? Am I missing something obvious?



أكثر...
 
أعلى