Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

WV-154: The current component structure makes this very awkward. On startup, the map needs to know which layers to display. Since the bank is the owner of that information, and not the map, the map depends on getting that information from events. The bank may fire an event, but before the map has initialized. In that case, the map doesn't yet know how to handle the layers and has to ignore it. By the time the map is ready, there may be no more events and there is no easy way for the map to get that information.

Mike McGann06ae9c761615
diff --git a/js/Worldview/Widget/WorldviewMap.js b/js/Worldview/Widget/WorldviewMap.js
index 7a7a6609f..320b79a79 100644
--- a/js/Worldview/Widget/WorldviewMap.js
+++ b/js/Worldview/Widget/WorldviewMap.js
@@ -16,6 +16,11 @@ Worldview.Widget.WorldviewMap = function(containerId, spec) {
var ns = Worldview.Widget;
var onReady = function() {
+ // FIXME: This is a major hack. Events that the map needs to initialize
+ // might occur before the map is ready. Once the map is ready, there
+ // is no easy way to find out what the current state is supposed to
+ // be. Just force an update using the current permalink.
+ self.updateComponent(Worldview.Permalink.fromRegistry());
setExtentToLeading();
};
spec.onReady = onReady;