Interactive interface for browsing global, full-resolution satellite imagery
mobile, large landscape device/browser media styling of map zoom button and rotation
Ed Platod534bc7b4bd7
diff --git a/web/css/geosearch.css b/web/css/geosearch.cssindex 690b1a403..f79bea539 100644--- a/web/css/geosearch.css+++ b/web/css/geosearch.css@@ -33,10 +33,26 @@position: absolute;top: 0;right: 62px;- & .btn {+ margin-right: 0;+ background: none;+ & .geosearch-search-submit-button {background: none;border: none;color: #999;+ border-left: 2px solid rgba(51, 51, 51, 0.65);+ border-radius: 0;+ box-sizing: border-box;+ width: 31px;+ box-shadow: none;+ cursor: default;+ &:active:focus {+ box-shadow: none;+ }+ & svg.svg-inline--fa.fa-search-location {+ position: absolute;+ left: 8px;+ top: 13px;+ }}}@@ -49,7 +65,7 @@margin-right: 1px;background: rgba(40, 40, 40, 0.85);border-radius: 5px;- z-index: 100;+ z-index: 1;}/* Geosearch Component Coordinate Buttons */@@ -155,4 +171,11 @@line-height: 16px;font-size: 16px;}+ .geosearch-submit-input-group-addon {+ margin-right: 6px;+ background: #00457b;+ & .geosearch-search-submit-button {+ border-left: none;+ }+ }}diff --git a/web/css/map.css b/web/css/map.cssindex bd86c1808..155141acc 100644--- a/web/css/map.css+++ b/web/css/map.css@@ -72,32 +72,51 @@border-bottom-right-radius: 10px;}-@media (max-width: 740px) {+@media (max-width: 768px) {.wv-map-zoom-in, .wv-map-zoom-out {display: none;}-}--@media only screen and (max-device-width: 740px) and (orientation: landscape) {+ .wv-map-rotate-left {+ top: 96px;+ }+ .wv-map-rotate-right {+ top: 187px;+ }+ .wv-map-rotate-left svg.svg-inline--fa,+ .wv-map-rotate-right svg.svg-inline--fa {+ width: 47px;+ padding: 8px;+ }.wv-map-reset-rotation {- top: auto;- bottom: 5px;- right: 53px;+ top: 134px;+ font-size: 1.35em;+ width: 49px;}+}+/* handle rotation and zoom button placement on large landscape device (like iPhone X) */+@media only screen and (max-device-width: 980px) and (max-device-height: 600px) and (orientation: landscape),+ (max-height: 600px) {+ div[data-proj='arctic'] .wv-map-zoom-in,+ div[data-proj='antarctic'] .wv-map-zoom-in,+ div[data-proj='arctic'] .wv-map-zoom-out,+ div[data-proj='antarctic'] .wv-map-zoom-out, {+ right: 54px;+ }+ .wv-map-zoom-in {+ top: 58px;+ }+ .wv-map-zoom-out {+ top: 96px;+ }.wv-map-rotate-left {- top: auto;- bottom: 5px;- border-bottom-left-radius: 10px;- border-top-right-radius: 0;- right: 96px;+ top: 58px;+ }+ .wv-map-reset-rotation {+ top: 96px;}-.wv-map-rotate-right {- top: auto;- bottom: 5px;- border-top-right-radius: 10px;- border-bottom-left-radius: 0;+ top: 149px;}}diff --git a/web/css/tooltip.css b/web/css/tooltip.cssindex 8d4610a03..0291a7707 100644--- a/web/css/tooltip.css+++ b/web/css/tooltip.css@@ -121,7 +121,7 @@border-top-color: #000;}&.tooltip-coordinates-container {- max-width: 320px;+ max-width: 420px;}.tooltip-coordinates-title {white-space: pre-wrap;@@ -156,3 +156,11 @@}}}++@media (max-width: 768px) {+ .tooltip-custom-black {+ &.tooltip-coordinates-container {+ max-width: 320px;+ }+ }+}diff --git a/web/js/components/geosearch/geosearch-input.js b/web/js/components/geosearch/geosearch-input.jsindex b2e066399..0b5d8a18b 100644--- a/web/js/components/geosearch/geosearch-input.js+++ b/web/js/components/geosearch/geosearch-input.js@@ -87,8 +87,11 @@ class SearchBox extends Component {const hasCoordinates = coordinates.length > 0;// eslint-disable-next-line no-nested-ternaryconst buttonContainerRight = hasCoordinates- ? isMobile ? '67px' : '62px'- : '31px';+ ? isMobile ? '67px' : '60px'+ : '30px';+ const submitButtonStyle = inputValue+ ? { color: '#0070c8', cursor: 'pointer' }+ : {};return (<InputGroupAddon@@ -99,10 +102,7 @@ class SearchBox extends Component {}}><Button- style={{- color: `${inputValue ? '#0070c8' : ''}`,- boxShadow: 'none',- }}+ style={submitButtonStyle}disabled={!inputValue}onClick={this.handleSubmitClick}className="geosearch-search-submit-button"@@ -124,6 +124,9 @@ class SearchBox extends Component {width: isMobile ? '90%' : wrapperStyleWidth,paddingRight: isMobile ? '0' : '26px',};+ const placeHolderText = isMobile+ ? 'Enter place name or coordinates'+ : 'Search for places or enter coordinates';return (<divclassName="geosearch-input-container"@@ -135,7 +138,7 @@ class SearchBox extends Component {inputProps={{className: 'form-control geosearch-autocomplete dark-input',id: 'geosearch-autocomplete',- placeholder: 'Search for places or enter coordinates',+ placeholder: placeHolderText,}}wrapperStyle={wrapperStyle}value={inputValue}diff --git a/web/js/components/geosearch/geosearch-modal.js b/web/js/components/geosearch/geosearch-modal.jsindex 761a8cf01..025313809 100644--- a/web/js/components/geosearch/geosearch-modal.js+++ b/web/js/components/geosearch/geosearch-modal.js@@ -62,18 +62,22 @@ class SearchComponent extends Component {reverseGeocode([longitude, latitude]).then((results) => {selectCoordinatesToFly([longitude, latitude], results);});- this.updatePendingCoordinates([]);+ this.setState({+ inputValue: '',+ coordinatesPending: [],+ searchResults: [],+ });}// handle selecting menu item in search resultsonSelect=(value, item) => {const { selectCoordinatesToFly } = this.props;-- this.updateSearchResults([item]);- this.updateValue(value);+ this.setState({+ inputValue: value,+ searchResults: [item],+ });const {magicKey,- // text,} = item;processMagicKey(magicKey).then((result) => {@@ -158,7 +162,7 @@ class SearchComponent extends Component {} = this.state;const hasCoordinates = coordinates.length > 0;- const alertMessage = `${isTouchDevice ? 'Tap' : 'Click'} on map to add a reverse geocode marker.`;+ const alertMessage = `${isTouchDevice ? 'Tap' : 'Click'} on map to identify a point on the map.`;const coordinateButtonGroupContainerClassName = `geosearch-coordinate-group-container ${hasCoordinates ? 'grouped' : ''}`;return (<>diff --git a/web/js/modules/geosearch/selectors.js b/web/js/modules/geosearch/selectors.jsindex 069a6cf81..62fcda07e 100644--- a/web/js/modules/geosearch/selectors.js+++ b/web/js/modules/geosearch/selectors.js@@ -116,7 +116,6 @@ const createPin = function(coordinates, transformedCoordinates = false, reverseG};// ArcGIS World Geocoding Service API Requests and Options-const GEOCODE_OPTIONS = {urlBase: 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/',requestOptions: {@@ -124,6 +123,8 @@ const GEOCODE_OPTIONS = {redirect: 'follow',},};+// language code EN (English) and required f request format parameters+const constantRequestParameters = '&langCode=en&f=json';// https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm// necessary to filter to remove fast food type suggestions, but still include relavant Places of Interest@@ -143,9 +144,10 @@ export async function suggest(val) {const { requestOptions, urlBase } = GEOCODE_OPTIONS;const encodedValue = encodeURIComponent(val);const encodedCategories = encodeURIComponent(GEOCODE_SUGGEST_CATEGORIES.join(','));+ const request = `${urlBase}suggest?text=${encodedValue}${constantRequestParameters}&category=${encodedCategories}`;try {- const response = await fetch(`${urlBase}suggest?text=${encodedValue}&f=json&category=${encodedCategories}`, requestOptions);+ const response = await fetch(request, requestOptions);const result = await response.text();return JSON.parse(result);} catch (error) {@@ -155,9 +157,10 @@ export async function suggest(val) {export async function processMagicKey(magicKey) {const { requestOptions, urlBase } = GEOCODE_OPTIONS;+ const request = `${urlBase}findAddressCandidates?outFields=*${constantRequestParameters}&magicKey=${magicKey}=`;try {- const response = await fetch(`${urlBase}findAddressCandidates?f=json&outFields=*&magicKey=${magicKey}=`, requestOptions);+ const response = await fetch(request, requestOptions);const result = await response.text();return JSON.parse(result);} catch (error) {@@ -167,9 +170,10 @@ export async function processMagicKey(magicKey) {export async function reverseGeocode(coordinates) {const { requestOptions, urlBase } = GEOCODE_OPTIONS;+ const request = `${urlBase}reverseGeocode?location=${coordinates}${constantRequestParameters}`;try {- const response = await fetch(`${urlBase}reverseGeocode?location=${coordinates}&f=json`, requestOptions);+ const response = await fetch(request, requestOptions);const result = await response.text();return JSON.parse(result);} catch (error) {