Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

WV-1095: _.each changed to _.forOwn when creating maps. Every now and then on iOS, it crashes if this is _.each so there may be a bug that somehow changes config.projections to seem array-like to lodash

Mike McGann334858fb1f43
diff --git a/web/js/map/wv.map.ui.js b/web/js/map/wv.map.ui.js
index bb8f9a208..9b1885f9b 100644
--- a/web/js/map/wv.map.ui.js
+++ b/web/js/map/wv.map.ui.js
@@ -39,7 +39,9 @@ wv.map.ui = wv.map.ui || function(models, config) {
if ( config.parameters.mockMap ) {
return;
}
- _.each(config.projections, function(proj) {
+ // NOTE: iOS sometimes bombs if this is _.each instead. In that case,
+ // it is possible that config.projections somehow becomes array-like.
+ _.forOwn(config.projections, function(proj) {
var map = createMap(proj);
self.proj[proj.id] = map;
});