Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Coordinate controls update with projection switch

Mike McGann8e4aef3af36d
diff --git a/dev/generate-config/config/products/arctic_graticule_3413.json b/dev/generate-config/config/products/arctic_graticule_3413.json
index 4133c28bb..581911aa4 100644
--- a/dev/generate-config/config/products/arctic_graticule_3413.json
+++ b/dev/generate-config/config/products/arctic_graticule_3413.json
@@ -1,5 +1,5 @@
{
- "description": "Polarview / Graticule",
+ "description": "NSIDC / Graticule",
"name": "Latitude-Longitude Lines",
"product": "static",
"projections": {
diff --git a/js/Worldview/Map.js b/js/Worldview/Map.js
index 8df4a80ed..70b066802 100644
--- a/js/Worldview/Map.js
+++ b/js/Worldview/Map.js
@@ -43,12 +43,13 @@ $(function(ns) {
}
}),
"arctic": new OpenLayers.Control.MousePosition({
+ projection: "EPSG:3413",
formatOutput: function(mouseLonLat) {
if ( logPosition.isDebugEnabled() ) {
logPosition.debug(Math.round(mouseLonLat.lon) + "," +
Math.round(mouseLonLat.lat));
}
- return "" +
+ return this.projection + " " +
Math.round(mouseLonLat.lon) + "m, " +
Math.round(mouseLonLat.lat) + "m";
}
@@ -59,7 +60,7 @@ $(function(ns) {
logPosition.debug(Math.round(mouseLonLat.lon) + "," +
Math.round(mouseLonLat.lat));
}
- return "" +
+ return "EPSG:3031 " +
Math.round(mouseLonLat.lon) + "m, " +
Math.round(mouseLonLat.lat) + "m";
},
diff --git a/js/Worldview/Widget/ArcticProjectionChangeNotification.js b/js/Worldview/Widget/ArcticProjectionChangeNotification.js
index 12deab16f..b9cf8c822 100644
--- a/js/Worldview/Widget/ArcticProjectionChangeNotification.js
+++ b/js/Worldview/Widget/ArcticProjectionChangeNotification.js
@@ -24,6 +24,9 @@ Worldview.Widget.ArcticProjectionChangeNotification = function(config, bank) {
var notified = false;
var storageEngine;
+ var oldEPSG = "EPSG:3995";
+ var newEPSG = "EPSG:3413";
+
var oldCoastlinesRegEx = new RegExp("arctic_coastlines(?!_)");
var newCoastlinesRegEx = new RegExp("arctic_coastlines_3413");
var oldCoastlines = "arctic_coastlines";
@@ -67,9 +70,14 @@ Worldview.Widget.ArcticProjectionChangeNotification = function(config, bank) {
var updateLayers = function(queryString) {
var products = Worldview.extractFromQuery("products", queryString);
if ( currentNew ) {
+ Worldview.Map.COORDINATE_CONTROLS["arctic"].projection =
+ newEPSG;
products = products.replace(oldCoastlinesRegEx, newCoastlines);
products = products.replace(oldGraticulesRegEx, newGraticules);
+
} else {
+ Worldview.Map.COORDINATE_CONTROLS["arctic"].projection =
+ oldEPSG;
products = products.replace(newCoastlinesRegEx, oldCoastlines);
products = products.replace(newGraticulesRegEx, oldGraticules);
}