Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Can now mock the map with mockMap=true in the query string

Mike McGannb625f1742d80
diff --git a/src/index.html b/src/index.html
index 431a0cb88..ea15e3723 100644
--- a/src/index.html
+++ b/src/index.html
@@ -158,6 +158,7 @@
<!-- link.dev --> <script type="text/javascript" src="js/Worldview/Map/GraticuleLayer.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/Worldview/Map/TWMSLayer.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/Worldview/Map/HoverControl.js"></script>
+ <!-- link.dev --> <script type="text/javascript" src="js/Worldview/Map/MockLayerSet.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/Worldview/DataDownload/ECHO.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/Worldview/DataDownload/ECHO/Client.js"></script>
diff --git a/src/js/Worldview/DataDownload/Layers/Hover.js b/src/js/Worldview/DataDownload/Layers/Hover.js
index 9ed122a62..4e6a18103 100644
--- a/src/js/Worldview/DataDownload/Layers/Hover.js
+++ b/src/js/Worldview/DataDownload/Layers/Hover.js
@@ -55,7 +55,7 @@ Worldview.DataDownload.Layers.Hover = function(model, maps, config) {
if ( layer ) {
layer.removeAllFeatures();
}
- }
+ };
self.dispose = function() {
$.each(maps.projections, function(index, map) {
diff --git a/src/js/Worldview/Map/MapSet.js b/src/js/Worldview/Map/MapSet.js
index 42a09c017..8492d4a31 100644
--- a/src/js/Worldview/Map/MapSet.js
+++ b/src/js/Worldview/Map/MapSet.js
@@ -86,7 +86,7 @@ Worldview.Map.MapSet = function(containerId, mapConfig, component) {
self.events = Worldview.Events();
- var init = function() {
+ var init = function() {
var $container = $("#" + containerId);
if ( $container.length === 0 ) {
throw new Error("No container for MapSet: " + containerId);
@@ -516,6 +516,10 @@ Worldview.Map.MapSet = function(containerId, mapConfig, component) {
* Merges in any projection specific properties.
*/
var createLayer = function(map, proj, config) {
+ if ( self.mapConfig.parameters.mockMap ) {
+ return Worldview.Map.MockLayerSet();
+ }
+
config = $.extend(true, {}, config);
if ( config.properties === undefined ) {
diff --git a/src/js/Worldview/Map/MockLayerSet.js b/src/js/Worldview/Map/MockLayerSet.js
new file mode 100644
index 000000000..894af9cb0
--- /dev/null
+++ b/src/js/Worldview/Map/MockLayerSet.js
@@ -0,0 +1,26 @@
+/*
+ * NASA Worldview
+ *
+ * This code was originally developed at NASA/Goddard Space Flight Center for
+ * the Earth Science Data and Information System (ESDIS) project.
+ *
+ * Copyright (C) 2013 United States Government as represented by the
+ * Administrator of the National Aeronautics and Space Administration.
+ * All Rights Reserved.
+ */
+
+Worldview.namespace("Map");
+
+Worldview.Map.MockLayerSet = function() {
+
+ return {
+ setDay: function() {},
+ setOpacity: function() {},
+ setVisibility: function() {},
+ setZIndex: function() {},
+ dispose: function() {},
+ setLookup: function() {},
+ clearLookup: function() {}
+ };
+
+};
\ No newline at end of file
diff --git a/src/js/Worldview/Map/StaticLayerSet.js b/src/js/Worldview/Map/StaticLayerSet.js
index fdf086f0c..366a4b783 100644
--- a/src/js/Worldview/Map/StaticLayerSet.js
+++ b/src/js/Worldview/Map/StaticLayerSet.js
@@ -128,4 +128,4 @@ Worldview.Map.StaticLayerSet = function(map, config) {
init();
return self;
-}
\ No newline at end of file
+};