Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Coordinates now DMS, reverted font and background that was to make it more readable

Mike McGannbeb0b71584d4
diff --git a/web/css/map-ol2.css b/web/css/map-ol2.css
index 426f7fa34..a883b46d3 100644
--- a/web/css/map-ol2.css
+++ b/web/css/map-ol2.css
@@ -44,8 +44,6 @@ div.olControlScaleLineCustomBottom, div.olControlScaleLineCustomTop {
div.olControlMousePosition {
bottom: 95px;
white-space: pre;
- font-family: ‘Lucida Console’, Monaco, monospace;
- background-color: rgba(0, 0, 0, 0.5);
text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
padding: 5px;
}
diff --git a/web/js/map/wv.map.ui.js b/web/js/map/wv.map.ui.js
index a879c20a5..bb8f9a208 100644
--- a/web/js/map/wv.map.ui.js
+++ b/web/js/map/wv.map.ui.js
@@ -510,8 +510,8 @@ wv.map.ui = wv.map.ui || function(models, config) {
// arctic has been backfilled
var crs = ( models.proj.change ) ? models.proj.change.crs
: models.proj.selected.crs;
- var str = wv.util.formatDM(mouseLonLat.lat, "latitude") + ", " +
- wv.util.formatDM(mouseLonLat.lon, "longitude") + " " +
+ var str = wv.util.formatDMS(mouseLonLat.lat, "latitude") + ", " +
+ wv.util.formatDMS(mouseLonLat.lon, "longitude") + " " +
crs;
return str;
}
@@ -594,9 +594,6 @@ wv.map.ui = wv.map.ui || function(models, config) {
// Keep track of center point on projection switch
map.previousCenter = map.getCenter();
-
- // "13D12.123'N, 123D12.123'W EPSG:1234"
- $(coordinateControl.div).html(" ");
return map;
};
diff --git a/web/js/util/wv.util.js b/web/js/util/wv.util.js
index dd038899e..67e7f3aaa 100644
--- a/web/js/util/wv.util.js
+++ b/web/js/util/wv.util.js
@@ -566,7 +566,7 @@ wv.util = (function(self) {
DOWN: 40
};
- self.formatDM = function(value, type) {
+ self.formatDMS = function(value, type) {
var width, signs;
if ( type === "longitude" ) {
width = 3;
@@ -576,13 +576,15 @@ wv.util = (function(self) {
signs = "NS";
}
var sign = ( value >= 0 ) ? signs[0] : signs[1];
- var totalMinutes = Math.abs(value * 60);
- var degrees = Math.floor(totalMinutes / 60);
- var minutes = totalMinutes - (degrees * 60);
+ value = Math.abs(value);
+ var degrees = Math.floor(value);
+ var minutes = Math.floor((value * 60) - (degrees * 60));
+ var seconds = Math.floor((value * 3600) - (degrees * 3600) - (minutes * 60));
var sdegrees = self.pad(degrees, width, " ");
- var sminutes = self.pad(minutes.toFixed(3), 6, " ");
- return sdegrees + "°" + sminutes + "'" + sign;
+ var sminutes = self.pad(minutes, 2, "0");
+ var sseconds = self.pad(seconds, 2, "0");
+ return sdegrees + "°" + sminutes + "'" + sseconds + '"' + sign;
};
return self;