Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

WV-137: First attempt at a zoom to max extent button

Mike McGann09a6564289d5
diff --git a/css/map.css b/css/map.css
index 04881ff4b..65ec263e9 100644
--- a/css/map.css
+++ b/css/map.css
@@ -86,9 +86,11 @@ div.olControlZoomPanelCustom div {
}
div.olControlZoomPanelCustom .olControlZoomInCustomItemInactive,
-div.olControlZoomPanelCustom .olControlZoomOutCustomItemInactive {
+div.olControlZoomPanelCustom .olControlZoomOutCustomItemInactive,
+div.olControlZoomPanelCustom .olControlZoomToMaxExtentCustomItemInactive {
position: absolute;
}
+
div.olControlZoomPanelCustom .olControlZoomInCustomItemInactive {
background: rgba(45,50,55,0.5);
top: 0;
@@ -97,10 +99,11 @@ div.olControlZoomPanelCustom .olControlZoomInCustomItemInactive {
}
div.olControlZoomPanelCustom .olControlZoomOutCustomItemInactive {
background: rgba(45,50,55,0.5);
- top: 72px;
+ /*top: 72px;*/
background-position: 0 -72px;
border-radius: 0 0 5px 5px ;
- top: 35px;
+ /*top: 35px;*/
+ top: 70px;
}
div.olControlZoomPanelCustom .olControlZoomOutCustomItemInactive:after ,
div.olControlZoomPanelCustom .olControlZoomInCustomItemInactive:after{
@@ -118,10 +121,11 @@ div.olControlZoomPanelCustom .olControlZoomOutCustomItemInactive:after{
padding: 0 11px;
}
-div.olControlZoomPanelCustom .olControlZoomToMaxExtentItemInactive {
- top: 36px;
- background-position: 0 -36px;
- display: none;
+div.olControlZoomPanelCustom .olControlZoomToMaxExtentCustomItemInactive {
+ background: rgba(45,50,55,0.7);
+ top: 35px;
+ background-image: url('../images/zoomToMaxExtent.svg');
+ background-size: cover;
}
/* End Zoom Panel */
diff --git a/dev/images/zoomToMaxExtent.graffle b/dev/images/zoomToMaxExtent.graffle
new file mode 100644
index 000000000..015a0daea
--- /dev/null
+++ b/dev/images/zoomToMaxExtent.graffle
@@ -0,0 +1,452 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>ActiveLayerIndex</key>
+ <integer>0</integer>
+ <key>ApplicationVersion</key>
+ <array>
+ <string>com.omnigroup.OmniGrafflePro</string>
+ <string>139.16.0.171715</string>
+ </array>
+ <key>AutoAdjust</key>
+ <false/>
+ <key>BackgroundGraphic</key>
+ <dict>
+ <key>Bounds</key>
+ <string>{{0, 0}, {144, 144}}</string>
+ <key>Class</key>
+ <string>SolidGraphic</string>
+ <key>ID</key>
+ <integer>2</integer>
+ <key>Style</key>
+ <dict>
+ <key>shadow</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Draws</key>
+ <string>NO</string>
+ </dict>
+ </dict>
+ </dict>
+ <key>BaseZoom</key>
+ <integer>0</integer>
+ <key>CanvasOrigin</key>
+ <string>{0, 0}</string>
+ <key>CanvasSize</key>
+ <string>{144, 144}</string>
+ <key>ColumnAlign</key>
+ <integer>1</integer>
+ <key>ColumnSpacing</key>
+ <real>36</real>
+ <key>CreationDate</key>
+ <string>2013-04-16 13:21:23 +0000</string>
+ <key>Creator</key>
+ <string>Mike McGann</string>
+ <key>DisplayScale</key>
+ <string>1 0/72 in = 1 0/72 in</string>
+ <key>FileType</key>
+ <string>flat</string>
+ <key>GraphDocumentVersion</key>
+ <integer>8</integer>
+ <key>GraphicsList</key>
+ <array>
+ <dict>
+ <key>Bounds</key>
+ <string>{{82.808036165707534, 16.40102557879171}, {49.927658081054688, 40}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>ID</key>
+ <integer>14</integer>
+ <key>Rotation</key>
+ <real>315</real>
+ <key>Shape</key>
+ <string>AdjustableArrow</string>
+ <key>ShapeData</key>
+ <dict>
+ <key>ratio</key>
+ <real>0.50000017881393433</real>
+ <key>width</key>
+ <real>20.000001907348633</real>
+ </dict>
+ <key>Style</key>
+ <dict>
+ <key>fill</key>
+ <dict>
+ <key>MiddleFraction</key>
+ <real>0.4523809552192688</real>
+ </dict>
+ <key>shadow</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>a</key>
+ <string>0.4</string>
+ <key>b</key>
+ <string>0</string>
+ <key>g</key>
+ <string>0</string>
+ <key>r</key>
+ <string>0</string>
+ </dict>
+ <key>ShadowVector</key>
+ <string>{0, 2}</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>0.8</string>
+ <key>g</key>
+ <string>0.8</string>
+ <key>r</key>
+ <string>0.8</string>
+ </dict>
+ </dict>
+ </dict>
+ <key>TextRelativeArea</key>
+ <string>{{0.125, 0.25}, {0.75, 0.5}}</string>
+ <key>isConnectedShape</key>
+ <true/>
+ </dict>
+ <dict>
+ <key>Bounds</key>
+ <string>{{11.00155402941531, 16.736115579976477}, {49.918617248535156, 40}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>ID</key>
+ <integer>13</integer>
+ <key>Rotation</key>
+ <real>225</real>
+ <key>Shape</key>
+ <string>AdjustableArrow</string>
+ <key>ShapeData</key>
+ <dict>
+ <key>ratio</key>
+ <real>0.50000017881393433</real>
+ <key>width</key>
+ <real>20.000001907348633</real>
+ </dict>
+ <key>Style</key>
+ <dict>
+ <key>fill</key>
+ <dict>
+ <key>MiddleFraction</key>
+ <real>0.4523809552192688</real>
+ </dict>
+ <key>shadow</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>a</key>
+ <string>0.4</string>
+ <key>b</key>
+ <string>0</string>
+ <key>g</key>
+ <string>0</string>
+ <key>r</key>
+ <string>0</string>
+ </dict>
+ <key>ShadowVector</key>
+ <string>{0, 2}</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>0.8</string>
+ <key>g</key>
+ <string>0.8</string>
+ <key>r</key>
+ <string>0.8</string>
+ </dict>
+ </dict>
+ </dict>
+ <key>TextRelativeArea</key>
+ <string>{{0.125, 0.25}, {0.75, 0.5}}</string>
+ <key>isConnectedShape</key>
+ <true/>
+ </dict>
+ <dict>
+ <key>Bounds</key>
+ <string>{{11.979928495338321, 87.691301694913108}, {49.036201477050781, 40}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>ID</key>
+ <integer>12</integer>
+ <key>Rotation</key>
+ <real>135</real>
+ <key>Shape</key>
+ <string>AdjustableArrow</string>
+ <key>ShapeData</key>
+ <dict>
+ <key>ratio</key>
+ <real>0.50000017881393433</real>
+ <key>width</key>
+ <real>20</real>
+ </dict>
+ <key>Style</key>
+ <dict>
+ <key>fill</key>
+ <dict>
+ <key>MiddleFraction</key>
+ <real>0.4523809552192688</real>
+ </dict>
+ <key>shadow</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>a</key>
+ <string>0.4</string>
+ <key>b</key>
+ <string>0</string>
+ <key>g</key>
+ <string>0</string>
+ <key>r</key>
+ <string>0</string>
+ </dict>
+ <key>ShadowVector</key>
+ <string>{0, 2}</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>0.8</string>
+ <key>g</key>
+ <string>0.8</string>
+ <key>r</key>
+ <string>0.8</string>
+ </dict>
+ </dict>
+ </dict>
+ <key>TextRelativeArea</key>
+ <string>{{0.125, 0.25}, {0.75, 0.5}}</string>
+ <key>isConnectedShape</key>
+ <true/>
+ </dict>
+ <dict>
+ <key>Bounds</key>
+ <string>{{82.919926537275785, 88.426860615973197}, {49.559894561767578, 40}}</string>
+ <key>Class</key>
+ <string>ShapedGraphic</string>
+ <key>ID</key>
+ <integer>9</integer>
+ <key>Rotation</key>
+ <real>44.995880126953125</real>
+ <key>Shape</key>
+ <string>AdjustableArrow</string>
+ <key>ShapeData</key>
+ <dict>
+ <key>ratio</key>
+ <real>0.50000017881393433</real>
+ <key>width</key>
+ <real>20</real>
+ </dict>
+ <key>Style</key>
+ <dict>
+ <key>fill</key>
+ <dict>
+ <key>MiddleFraction</key>
+ <real>0.4523809552192688</real>
+ </dict>
+ <key>shadow</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>a</key>
+ <string>0.4</string>
+ <key>b</key>
+ <string>0</string>
+ <key>g</key>
+ <string>0</string>
+ <key>r</key>
+ <string>0</string>
+ </dict>
+ <key>ShadowVector</key>
+ <string>{0, 2}</string>
+ </dict>
+ <key>stroke</key>
+ <dict>
+ <key>Color</key>
+ <dict>
+ <key>b</key>
+ <string>0.8</string>
+ <key>g</key>
+ <string>0.8</string>
+ <key>r</key>
+ <string>0.8</string>
+ </dict>
+ </dict>
+ </dict>
+ <key>TextRelativeArea</key>
+ <string>{{0.125, 0.25}, {0.75, 0.5}}</string>
+ <key>isConnectedShape</key>
+ <true/>
+ </dict>
+ </array>
+ <key>GridInfo</key>
+ <dict>
+ <key>ShowsGrid</key>
+ <string>YES</string>
+ </dict>
+ <key>GuidesLocked</key>
+ <string>NO</string>
+ <key>GuidesVisible</key>
+ <string>YES</string>
+ <key>HPages</key>
+ <integer>1</integer>
+ <key>ImageCounter</key>
+ <integer>3</integer>
+ <key>KeepToScale</key>
+ <false/>
+ <key>Layers</key>
+ <array>
+ <dict>
+ <key>Lock</key>
+ <string>NO</string>
+ <key>Name</key>
+ <string>Layer 1</string>
+ <key>Print</key>
+ <string>YES</string>
+ <key>View</key>
+ <string>YES</string>
+ </dict>
+ </array>
+ <key>LayoutInfo</key>
+ <dict>
+ <key>Animate</key>
+ <string>NO</string>
+ <key>AutoLayout</key>
+ <integer>2</integer>
+ <key>LineLength</key>
+ <real>0.4643835723400116</real>
+ <key>circoMinDist</key>
+ <real>18</real>
+ <key>circoSeparation</key>
+ <real>0.0</real>
+ <key>layoutEngine</key>
+ <string>dot</string>
+ <key>neatoSeparation</key>
+ <real>0.0</real>
+ <key>twopiSeparation</key>
+ <real>0.0</real>
+ </dict>
+ <key>LinksVisible</key>
+ <string>NO</string>
+ <key>MagnetsVisible</key>
+ <string>NO</string>
+ <key>MasterSheets</key>
+ <array/>
+ <key>ModificationDate</key>
+ <string>2013-04-16 14:01:10 +0000</string>
+ <key>Modifier</key>
+ <string>Mike McGann</string>
+ <key>NotesVisible</key>
+ <string>NO</string>
+ <key>Orientation</key>
+ <integer>2</integer>
+ <key>OriginVisible</key>
+ <string>NO</string>
+ <key>OutlineStyle</key>
+ <string>Basic</string>
+ <key>PageBreaks</key>
+ <string>NO</string>
+ <key>PrintInfo</key>
+ <dict>
+ <key>NSBottomMargin</key>
+ <array>
+ <string>float</string>
+ <string>41</string>
+ </array>
+ <key>NSHorizonalPagination</key>
+ <array>
+ <string>coded</string>
+ <string>BAtzdHJlYW10eXBlZIHoA4QBQISEhAhOU051bWJlcgCEhAdOU1ZhbHVlAISECE5TT2JqZWN0AIWEASqEhAFxlwCG</string>
+ </array>
+ <key>NSLeftMargin</key>
+ <array>
+ <string>float</string>
+ <string>18</string>
+ </array>
+ <key>NSPaperSize</key>
+ <array>
+ <string>size</string>
+ <string>{612, 792}</string>
+ </array>
+ <key>NSPrintReverseOrientation</key>
+ <array>
+ <string>int</string>
+ <string>0</string>
+ </array>
+ <key>NSRightMargin</key>
+ <array>
+ <string>float</string>
+ <string>18</string>
+ </array>
+ <key>NSTopMargin</key>
+ <array>
+ <string>float</string>
+ <string>18</string>
+ </array>
+ </dict>
+ <key>PrintOnePage</key>
+ <true/>
+ <key>ReadOnly</key>
+ <string>NO</string>
+ <key>RowAlign</key>
+ <integer>1</integer>
+ <key>RowSpacing</key>
+ <real>36</real>
+ <key>SheetTitle</key>
+ <string>Canvas 1</string>
+ <key>SmartAlignmentGuidesActive</key>
+ <string>YES</string>
+ <key>SmartDistanceGuidesActive</key>
+ <string>YES</string>
+ <key>UniqueID</key>
+ <integer>1</integer>
+ <key>UseEntirePage</key>
+ <false/>
+ <key>VPages</key>
+ <integer>1</integer>
+ <key>WindowInfo</key>
+ <dict>
+ <key>CurrentSheet</key>
+ <integer>0</integer>
+ <key>ExpandedCanvases</key>
+ <array/>
+ <key>Frame</key>
+ <string>{{493, 255}, {1121, 938}}</string>
+ <key>ListView</key>
+ <false/>
+ <key>OutlineWidth</key>
+ <integer>142</integer>
+ <key>RightSidebar</key>
+ <true/>
+ <key>Sidebar</key>
+ <false/>
+ <key>SidebarWidth</key>
+ <integer>138</integer>
+ <key>VisibleRegion</key>
+ <string>{{-49.749684741412764, -32.749684741412764}, {245.05863815690606, 211.26607824762897}}</string>
+ <key>Zoom</key>
+ <real>3.994962215423584</real>
+ <key>ZoomValues</key>
+ <array>
+ <array>
+ <string>Canvas 1</string>
+ <real>3.994962215423584</real>
+ <real>1.997481107711792</real>
+ </array>
+ </array>
+ </dict>
+</dict>
+</plist>
diff --git a/images/zoomToMaxExtent.svg b/images/zoomToMaxExtent.svg
new file mode 100644
index 000000000..9e62b031f
--- /dev/null
+++ b/images/zoomToMaxExtent.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 144 144" width="12pc" height="12pc"><metadata xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:date>2013-04-16 14:01Z</dc:date><!-- Produced by OmniGraffle Professional 5.4.2 --></metadata><defs><filter id="Shadow" filterUnits="userSpaceOnUse"><feGaussianBlur in="SourceAlpha" result="blur" stdDeviation="3.488"/><feOffset in="blur" result="offset" dx="0" dy="2"/><feFlood flood-color="black" flood-opacity=".4" result="flood"/><feComposite in="flood" in2="offset" operator="in"/></filter></defs><g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1"><title>Canvas 1</title><g><title>Layer 1</title><g><use xl:href="#id9_Graphic" filter="url(#Shadow)"/><use xl:href="#id12_Graphic" filter="url(#Shadow)"/><use xl:href="#id13_Graphic" filter="url(#Shadow)"/><use xl:href="#id14_Graphic" filter="url(#Shadow)"/></g><g id="id9_Graphic"><path d="M 83.105983 97.97763 L 97.24711 83.834473 L 118.15061 104.73497 L 125.22117 97.6634 L 125.2232 125.94767 L 96.93893 125.9497 L 104.00949 118.87813 Z" fill="white"/><path d="M 83.105983 97.97763 L 97.24711 83.834473 L 118.15061 104.73497 L 125.22117 97.6634 L 125.2232 125.94767 L 96.93893 125.9497 L 104.00949 118.87813 Z" stroke="#ccc" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g><g id="id12_Graphic"><path d="M 46.763874 83.283316 L 60.906015 97.425457 L 40.37432 117.95715 L 47.445385 125.02822 L 19.161114 125.02822 L 19.161114 96.743946 L 26.232179 103.81501 Z" fill="white"/><path d="M 46.763874 83.283316 L 60.906015 97.425457 L 40.37432 117.95715 L 47.445385 125.02822 L 19.161114 125.02822 L 19.161114 96.743946 L 26.232179 103.81501 Z" stroke="#ccc" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g><g id="id13_Graphic"><path d="M 60.68083 47.313941 L 46.538689 61.456082 L 25.383033 40.300427 L 18.311968 47.371492 L 18.311966 19.087219 L 46.59624 19.08722 L 39.525174 26.158286 Z" fill="white"/><path d="M 60.68083 47.313941 L 46.538689 61.456082 L 25.383033 40.300427 L 18.311968 47.371492 L 18.311966 19.087219 L 46.59624 19.08722 L 39.525174 26.158286 Z" stroke="#ccc" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g><g id="id14_Graphic"><path d="M 97.190843 61.12419 L 83.0487 46.982048 L 104.21075 25.82 L 97.139685 18.748934 L 125.42396 18.748933 L 125.42396 47.033205 L 118.35289 39.96214 Z" fill="white"/><path d="M 97.190843 61.12419 L 83.0487 46.982048 L 104.21075 25.82 L 97.139685 18.748934 L 125.42396 18.748933 L 125.42396 47.033205 L 118.35289 39.96214 Z" stroke="#ccc" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/></g></g></g></svg>
diff --git a/js/Worldview/Map/ProductMap.js b/js/Worldview/Map/ProductMap.js
index 9bf4b116f..d6bf887a9 100644
--- a/js/Worldview/Map/ProductMap.js
+++ b/js/Worldview/Map/ProductMap.js
@@ -388,11 +388,17 @@ Worldview.Map.ProductMap = function(containerId, mapConfig, component) {
zoomOutControl.title = "zoom out";
zoomOutControl.displayClass = mapClass + "olControlZoomOutCustom";
+ var zoomToMaxExtentControl = new OpenLayers.Control.ZoomToMaxExtent();
+ zoomToMaxExtentControl.title = "zoom to max extent";
+ zoomToMaxExtentControl.displayClass = mapClass +
+ "olControlZoomToMaxExtentCustom";
+
// Create panel to hold zoom controls and add to map
var zoomPanel = new OpenLayers.Control.Panel();
zoomPanel.displayClass = mapClass + "olControlZoomPanelCustom";
zoomPanel.addControls(zoomInControl);
zoomPanel.addControls(zoomOutControl);
+ zoomPanel.addControls(zoomToMaxExtentControl);
controls.push(zoomPanel);
// Add navigation controls