Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

migrate FA to 5.0 #1375

Benjamin King86a35ddab754
diff --git a/web/css/anim.widget.css b/web/css/anim.widget.css
index 55989a60a..dea21a3d4 100644
--- a/web/css/anim.widget.css
+++ b/web/css/anim.widget.css
@@ -39,7 +39,7 @@
}
#wv-animation-widget a .wv-animation-widget-icon {
- font-size: 28px;
+ font-size: 23px;
color: #fff;
position: absolute;
transform: translate(-50%, -50%);
@@ -52,9 +52,11 @@
color: #fff;
opacity: 0.5;
}
-
+#wv-animation-widget a .wv-animation-widget-icon.fa-file-video {
+ font-size: 29px;
+}
#wv-animation-widget a .wv-animation-widget-icon.fa-retweet {
- font-size: 34px;
+ font-size: 31px;
color: #212121;
opacity: 0.7;
}
@@ -194,7 +196,7 @@
margin-left: 1em;
}
-.gif-results-dialog-case, {
+.gif-results-dialog-case {
text-transform: capitalize;
}
@@ -311,7 +313,8 @@
outline: none;
position: absolute;
top: 50%;
- transition: transform 0.3s ease-out, box-shadow 0.3s ease-out, -webkit-transform 0.3s ease-out, -webkit-box-shadow 0.3s ease-out;
+ transition: transform 0.3s ease-out, box-shadow 0.3s ease-out,
+ -webkit-transform 0.3s ease-out, -webkit-box-shadow 0.3s ease-out;
width: 15px;
}
diff --git a/web/css/jquery-ui-override.css b/web/css/jquery-ui-override.css
index ffa40dccc..9fbe11a31 100644
--- a/web/css/jquery-ui-override.css
+++ b/web/css/jquery-ui-override.css
@@ -10,7 +10,7 @@ a.ui-button.ui-state-default {
background-image: linear-gradient(#555, #666);
background-image: -ms-linear-gradient(#555, #666);
background-image: -o-linear-gradient(#555, #666);
- font-family: "Segoe UI", "Arial", sans-serif;
+ font-family: 'Segoe UI', 'Arial', sans-serif;
}
a.ui-button.ui-state-default.ui-state-hover {
@@ -45,12 +45,12 @@ a.ui-button.ui-state-default.ui-state-hover {
* Remove the jQuery UI Icon
* Remove the jQuery UI Text Indent
*/
-.ui-icon[class*=" fa-"] {
+.ui-icon[class*=' fa-'] {
background: none repeat scroll 0 0 transparent;
text-indent: 0;
}
-.ui-button-icon-only .ui-icon[class*=" fa-"] {
+.ui-button-icon-only .ui-icon[class*=' fa-'] {
margin-left: -7px;
}
@@ -93,12 +93,12 @@ a.ui-button.ui-state-default.ui-state-hover {
button.ui-button:focus .ui-icon-closethick,
button.ui-button .ui-icon-closethick {
background-position: 0 0;
- background-image: url("../images/close.png");
+ background-image: url('../images/close.png');
}
button.ui-button:hover .ui-icon-closethick {
background-position: 0 0;
- background-image: url("../images/close-highlight.png");
+ background-image: url('../images/close-highlight.png');
}
.ui-tooltip {
@@ -148,7 +148,7 @@ a:hover {
}
.ui-menu-item i {
- font-size: 15px;
+ font-size: 13px;
}
.iCheck-checkbox {
diff --git a/web/css/layers.css b/web/css/layers.css
index 12c696a4d..468fcd379 100644
--- a/web/css/layers.css
+++ b/web/css/layers.css
@@ -381,7 +381,7 @@
width: 30px;
height: 30px;
opacity: 0.8;
- font-size: 30px;
+ font-size: 26px;
position: absolute;
right: 12px;
top: 50%;
@@ -390,7 +390,7 @@
.measurement-row .source-nav-item {
margin-left: 10px;
cursor: pointer;
- font-family: "Open Sans", sans-serif;
+ font-family: 'Open Sans', sans-serif;
font-size: 13px;
font-weight: 300;
}
@@ -423,7 +423,7 @@
}
.measurement-row .source-sub-group .wv-checkbox {
color: #fff;
- font: 400 13px/13px "Open Sans", sans-serif;
+ font: 400 13px/13px 'Open Sans', sans-serif;
}
.measurement-row .wv-checkbox label {
display: inline;
diff --git a/web/css/link.css b/web/css/link.css
index a81ec4ef7..03ce70d47 100644
--- a/web/css/link.css
+++ b/web/css/link.css
@@ -41,7 +41,7 @@
.wv-link .hide-icon[data-tooltip]::after,
.wv-link .hide-icon[data-tooltip]:hover::before,
.wv-link .hide-icon[data-tooltip]:hover::after {
- -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
+ -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=0)';
filter: alpha(opacity=0);
-khtml-opacity: 0;
-moz-opacity: 0;
@@ -59,7 +59,7 @@
transform-origin: top;
}
-.wv-link [data-tooltip-length="xsmall"]::after {
+.wv-link [data-tooltip-length='xsmall']::after {
width: 75px;
}
@@ -75,7 +75,13 @@
vertical-align: middle;
cursor: pointer;
background-color: #ccc;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#dcdcdc), to(#ccc));
+ background-image: -webkit-gradient(
+ linear,
+ left top,
+ left bottom,
+ from(#dcdcdc),
+ to(#ccc)
+ );
background-image: linear-gradient(#dcdcdc, #ccc);
border: 1px solid #ccc;
border-radius: 3px;
@@ -93,7 +99,13 @@
.wv-link .copy-btn:hover {
text-decoration: none;
background-color: #bbb;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ccc), to(#bbb));
+ background-image: -webkit-gradient(
+ linear,
+ left top,
+ left bottom,
+ from(#ccc),
+ to(#bbb)
+ );
background-image: linear-gradient(#ccc, #bbb);
border-color: #bbb;
}
@@ -123,7 +135,7 @@
justify-content: space-around;
}
-#social-share [class*="fa fa-"] {
+#social-share .icon-link {
background-color: #000;
border-radius: 50%;
color: #fff;
@@ -135,15 +147,15 @@
text-align: center;
}
-#social-share .fa-facebook {
+#social-share .facebook {
background-color: #3b5998;
}
-#social-share .fa-twitter {
+#social-share .twitter {
background-color: #00aced;
}
-#social-share .fa-reddit {
+#social-share .reddit {
position: relative;
color: #ff5700;
background-color: #fff;
@@ -153,17 +165,17 @@
margin-left: 1px;
}
-#social-share .fa-reddit::before {
+#social-share .reddit::before {
border-radius: 50%;
position: absolute;
left: -1px;
- top: 0;
+ top: -1px;
}
#social-share .fa-google-plus {
background-color: #d34836;
}
-#social-share .fa-envelope {
+#social-share .email {
background-color: #505050;
}
diff --git a/web/css/map.css b/web/css/map.css
index 0102226dc..29f81fc55 100644
--- a/web/css/map.css
+++ b/web/css/map.css
@@ -25,8 +25,8 @@
opacity: 0.4;
}
-.wv-map-zoom .fa {
- padding: 1.35em 1.15em;
+.wv-map-zoom i {
+ padding: 17px 14px;
display: block;
line-height: normal;
}
@@ -97,9 +97,7 @@
bottom: 130px;
color: #fff;
background-color: rgba(40, 40, 40, 0.85);
- text-shadow: -1px -1px 0 #000,
- 1px -1px 0 #000,
- -1px 1px 0 #000,
+ text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000,
1px 1px 0 #000;
padding: 3px;
border-top: 2px solid #fff;
@@ -114,9 +112,7 @@
bottom: 149px;
color: #fff;
background-color: rgba(40, 40, 40, 0.85);
- text-shadow: -1px -1px 0 #000,
- 1px -1px 0 #000,
- -1px 1px 0 #000,
+ text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000,
1px 1px 0 #000;
padding: 3px;
border-bottom: 2px solid #fff;
@@ -136,9 +132,7 @@
white-space: pre;
outline: none;
color: #fff;
- text-shadow: -1px -1px 0 #000,
- 1px -1px 0 #000,
- -1px 1px 0 #000,
+ text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000,
1px 1px 0 #000;
font-size: 100%;
border: none;
@@ -204,7 +198,6 @@
margin-left: -7px;
width: 14px;
height: 13px;
- background: url("../images/map/latlon.png") no-repeat;
+ background: url('../images/map/latlon.png') no-repeat;
background-position: -14px;
}
-
diff --git a/web/css/sidebar-panel.css b/web/css/sidebar-panel.css
index 0282c66c0..25cfc201a 100644
--- a/web/css/sidebar-panel.css
+++ b/web/css/sidebar-panel.css
@@ -20,7 +20,7 @@
}
.atcollapse {
position: absolute;
- background: url("../images/icon-sprite.svg") -206px -3px;
+ background: url('../images/icon-sprite.svg') -206px -3px;
border-radius: 0;
-webkit-box-sizing: border-box;
box-sizing: border-box;
@@ -60,10 +60,10 @@ a.staticLayers:not([href]):not([tabindex]):hover {
a.staticLayers::after {
position: absolute;
- content: "";
+ content: '';
height: 20px;
width: 20px;
- background: url("../images/icon-sprite.svg") -180px -10px;
+ background: url('../images/icon-sprite.svg') -180px -10px;
display: block;
right: 10px;
top: 6px;
@@ -74,7 +74,7 @@ a.staticLayers:hover::after {
}
a.atexpand {
- background: url("../images/icon-sprite.svg") -175px 0;
+ background: url('../images/icon-sprite.svg') -175px 0;
}
.sidebar-panel {
@@ -269,10 +269,12 @@ li.item.productsitem.inmotion,
position: absolute;
top: 50%;
margin-top: -10px;
- font-size: 20px;
+ font-size: 18px;
+}
+.productsitem i {
color: #333;
}
-.layer-hidden .layer-eye-icon {
+.layer-hidden i {
color: #c5c5c8;
}
.productsitem .hdanchor:hover .layer-eye-icon {
@@ -290,13 +292,14 @@ li.item.productsitem.inmotion,
width: 284px;
list-style: none;
}
+.productsitem a.wv-layers-close:hover,
.productsitem a.wv-layers-info:hover,
.productsitem a.wv-layers-options:hover {
background: #fff;
}
.wv-layers-info-icon {
- font-size: 11px !important;
+ font-size: 9px;
border: 1px solid #333;
width: 14px;
height: 14px;
@@ -307,8 +310,6 @@ li.item.productsitem.inmotion,
}
i.wv-layers-options-icon {
- background: url("../images/wv.layers/show-hide.png?v=@BUILD_NONCE@") no-repeat
- 0 -24px;
width: 12px;
height: 12px;
position: absolute;
@@ -316,7 +317,6 @@ i.wv-layers-options-icon {
margin-top: -6px;
left: 50%;
margin-left: -6px;
- background-position: 0 -69px;
}
.productsitem.layer-hidden a.wv-layers-options i.wv-layers-options-icon {
@@ -357,7 +357,7 @@ i.wv-layers-options-icon {
display: block;
}
-.productsitem a.button.close {
+.productsitem a.button.wv-layers-close {
display: block;
float: right;
width: 20px;
@@ -366,37 +366,16 @@ i.wv-layers-options-icon {
cursor: pointer;
}
-.sidebar-panel li.item.productsitem:hover a.button.close {
- display: block;
-}
-
-.productsitem.layer-visible a.button.close:hover {
- background-color: #fff;
-}
-
-.productsitem.layer-hidden a.button.close:hover {
- background: #fff;
-}
-
-.productsitem a.button.close i {
- background: url("../images/wv.layers/show-hide.png?v=@BUILD_NONCE@") no-repeat
- 0 -24px;
+.productsitem a.button.wv-layers-close i {
width: 12px;
height: 12px;
pointer-events: none;
position: absolute;
top: 50%;
- margin-top: -6px;
+ margin-top: -7px;
left: 50%;
- margin-left: -6px;
-}
-
-.productsitem.layer-hidden a.button.close i {
- background-position: -21px -24px;
-}
-
-.productsitem.layer-hidden a.button.close:hover i {
- background-position: 0 -24px;
+ font-size: 14px;
+ margin-left: -5px;
}
.productsitem .layer-main {
diff --git a/web/js/app.js b/web/js/app.js
index d443e3c90..b7ce615e3 100644
--- a/web/js/app.js
+++ b/web/js/app.js
@@ -98,7 +98,6 @@ import { uiInfo } from './ui/info';
// Dependency CSS
import '../../node_modules/bootstrap/dist/css/bootstrap.css';
-import 'font-awesome-webpack';
import '../../node_modules/jquery-ui-bundle/jquery-ui.structure.css';
import '../../node_modules/jquery-ui-bundle/jquery-ui.theme.css';
import '../../node_modules/icheck/skins/square/grey.css';
@@ -112,6 +111,7 @@ import '../../node_modules/jquery-jcrop/css/jquery.Jcrop.css';
import '../../node_modules/ol/ol.css';
import '../../node_modules/nouislider/src/jquery.nouislider.css';
import '../../node_modules/simplebar/dist/simplebar.css';
+import '../../node_modules/@fortawesome/fontawesome-free/css/all.css';
// App CSS
import '../css/fonts.css';
@@ -260,7 +260,7 @@ class App extends React.Component {
id="animate-button"
title="Set up animation"
>
- <i id="wv-animate" className="fa fa-video-camera wv-animate" />
+ <i id="wv-animate" className="fas fa-video wv-animate" />
</div>
</div>
<div id="timeline-footer">
@@ -288,6 +288,10 @@ class App extends React.Component {
var state = util.fromQueryString(location.search);
var parameters = util.fromQueryString(location.search);
+ // Add font Awesome fonts
+ // library.add(faInfoCircle);
+ // dom.watch();
+
var main = function() {
if (parameters.elapsed) {
startTime = new Date().getTime();
@@ -576,9 +580,12 @@ class App extends React.Component {
}
function registerMapMouseHandlers(maps, events) {
- Object.values(maps).forEach((map) => {
+ Object.values(maps).forEach(map => {
let element = map.getTargetElement();
- let crs = map.getView().getProjection().getCode();
+ let crs = map
+ .getView()
+ .getProjection()
+ .getCode();
element.addEventListener('mousemove', event => {
events.trigger('mousemove', event, map, crs);
});
diff --git a/web/js/components/animation-widget/animation-widget.js b/web/js/components/animation-widget/animation-widget.js
index 52538c482..51df172f5 100644
--- a/web/js/components/animation-widget/animation-widget.js
+++ b/web/js/components/animation-widget/animation-widget.js
@@ -93,7 +93,7 @@ class AnimationWidget extends React.Component {
onDateChange(date, id) {
const { endDate, startDate } = this.state;
googleTagManager.pushEvent({
- 'event': 'GIF_animation_date_case'
+ event: 'GIF_animation_date_case'
});
if (id === 'start') {
this.setState({
@@ -147,7 +147,7 @@ class AnimationWidget extends React.Component {
className="wv-icon-case"
onClick={this.props.onPushGIF}
>
- <i className="fa fa-file-video-o wv-animation-widget-icon" />
+ <i className="fas fa-file-video wv-animation-widget-icon" />
</a>
<div className="wv-anim-dates-case">
<TimeSelector
diff --git a/web/js/components/share/links.js b/web/js/components/share/links.js
index 9e8133925..256f6fb5e 100644
--- a/web/js/components/share/links.js
+++ b/web/js/components/share/links.js
@@ -10,10 +10,34 @@ class ShareLinks extends React.Component {
render() {
return (
<div id="social-share">
- <a id="fb-share" className="icon-link fa fa-facebook fa-2x" href={this.props.fbLink} onClick={(e) => this.onClick(e, 'facebook')} title="Share via Facebook!" />
- <a id="tw-share" className="icon-link fa fa-twitter fa-2x" href={this.props.twLink} onClick={(e) => this.onClick(e, 'twitter')} title="Share via Twitter!" />
- <a id="rd-share" className="icon-link fa fa-reddit fa-2x" href={this.props.rdLink} onClick={(e) => this.onClick(e, 'reddit')} title="Share via Reddit!" />
- <a id="email-share" className="icon-link fa fa-envelope fa-2x" href={this.props.emailLink} onClick={(e) => this.onClick(e, 'email')} title="Share via Email!" />
+ <a
+ id="fb-share"
+ className="icon-link fab facebook fa-facebook-f fa-2x"
+ href={this.props.fbLink}
+ onClick={e => this.onClick(e, 'facebook')}
+ title="Share via Facebook!"
+ />
+ <a
+ id="tw-share"
+ className="icon-link twitter fab fa-twitter fa-2x"
+ href={this.props.twLink}
+ onClick={e => this.onClick(e, 'twitter')}
+ title="Share via Twitter!"
+ />
+ <a
+ id="rd-share"
+ className="icon-link fab reddit fa-reddit fa-2x"
+ href={this.props.rdLink}
+ onClick={e => this.onClick(e, 'reddit')}
+ title="Share via Reddit!"
+ />
+ <a
+ id="email-share"
+ className="icon-link email fa fa-envelope fa-2x"
+ href={this.props.emailLink}
+ onClick={e => this.onClick(e, 'email')}
+ title="Share via Email!"
+ />
</div>
);
}
diff --git a/web/js/components/sidebar/events/event.js b/web/js/components/sidebar/events/event.js
index b918d54a5..48aead7ed 100644
--- a/web/js/components/sidebar/events/event.js
+++ b/web/js/components/sidebar/events/event.js
@@ -52,9 +52,9 @@ class Event extends React.Component {
} else {
selectEvent(event.id, date);
googleTagManager.pushEvent({
- 'event': 'natural_event_selected',
- 'natural_events': {
- 'category': event.categories[0].title
+ event: 'natural_event_selected',
+ natural_events: {
+ category: event.categories[0].title
}
});
}
@@ -85,8 +85,8 @@ class Event extends React.Component {
e.stopPropagation();
}}
>
- <i className="fa fa-external-link fa-1" />
- {source.title}
+ <i className="fa fa-external-link-alt fa-1" />{' '}
+ {' ' + source.title}
</a>
);
} else {
@@ -123,9 +123,12 @@ class Event extends React.Component {
className={'event-icon event-icon-' + event.categories[0].slug}
title={event.categories[0].title}
/>
- <h4 className="title" dangerouslySetInnerHTML={{
- __html: event.title + '<br />' + dateString
- }}/>
+ <h4
+ className="title"
+ dangerouslySetInnerHTML={{
+ __html: event.title + '<br />' + dateString
+ }}
+ />
<p className="subtitle">{this.getReferenceList()}</p>
{this.getDateLists()}
diff --git a/web/js/components/sidebar/products/layer.js b/web/js/components/sidebar/products/layer.js
index 93156025c..2b17c2e02 100644
--- a/web/js/components/sidebar/products/layer.js
+++ b/web/js/components/sidebar/products/layer.js
@@ -173,10 +173,10 @@ class Layer extends React.Component {
<i
className={
isDisabled
- ? 'fa fa-ban layer-eye-icon'
+ ? 'far fa-ban layer-eye-icon'
: !isVisible
- ? 'fa fa-eye-slash layer-eye-icon'
- : 'fa fa-eye layer-eye-icon'
+ ? 'far fa-eye-slash layer-eye-icon'
+ : 'far fa-eye layer-eye-icon'
}
/>
</a>
@@ -197,10 +197,10 @@ class Layer extends React.Component {
<a
id={'close' + layerGroupName + util.encodeId(layer.id)}
title={'Remove Layer'}
- className="button close bank-item-img"
+ className="button wv-layers-close"
onClick={this.onRemoveClick.bind(this)}
>
- <i />
+ <i className="fa fa-times" />
</a>
<a
title={'Layer options for ' + names.title}
@@ -209,7 +209,7 @@ class Layer extends React.Component {
}
onClick={this.onOptionsClick.bind(this)}
>
- <i className="wv-layers-options-icon" />
+ <i className="fas fa-sliders-h wv-layers-options-icon" />
</a>
<a
title={'Layer description for ' + names.title}
diff --git a/web/js/data/ui.js b/web/js/data/ui.js
index 3a0e9d826..93b34fa78 100644
--- a/web/js/data/ui.js
+++ b/web/js/data/ui.js
@@ -345,7 +345,7 @@ var dataUiDownloadListPanel = function(config, model) {
collapsible: true,
active: false,
icons: {
- header: 'fa fa-caret-right fa-fw',
+ header: 'fas fa-caret-right fa-fw',
activeHeader: 'fa fa-caret-down fa-fw'
}
});
diff --git a/web/js/link/ui.js b/web/js/link/ui.js
index 5381207ca..ec79b6786 100644
--- a/web/js/link/ui.js
+++ b/web/js/link/ui.js
@@ -24,7 +24,7 @@ export function linkUi(models, config) {
$label = $('<label></label>')
.attr('for', 'wv-link-button-check')
.attr('title', 'Share this map');
- var $icon = $('<i></i>').addClass('fa fa-share-square-o fa-2x');
+ var $icon = $('<i></i>').addClass('fas fa-share-square fa-2x');
$label.append($icon);
$(selector).append($label);
$(selector).append($button);
@@ -35,7 +35,7 @@ export function linkUi(models, config) {
.click(function() {
var checked = $('#wv-link-button-check').prop('checked');
googleTagManager.pushEvent({
- 'event': 'social_link_share'
+ event: 'social_link_share'
});
if (checked) {
self.show();
@@ -117,8 +117,8 @@ export function linkUi(models, config) {
var twMessage = 'Check out what I found in #NASAWorldview -';
var emailBody = shareMessage + ' - ' + url;
googleTagManager.pushEvent({
- 'event': 'social_share_platform',
- 'social_type': type
+ event: 'social_share_platform',
+ social_type: type
});
switch (type) {
@@ -256,7 +256,7 @@ export function linkUi(models, config) {
if (checked) {
var promise = models.link.shorten();
googleTagManager.pushEvent({
- 'event': 'social_link_shorten'
+ event: 'social_link_shorten'
});
$('#permalink_content').val('Please wait...');
promise
diff --git a/web/js/map/compare/swipe.js b/web/js/map/compare/swipe.js
index 583360412..9dddc5a21 100644
--- a/web/js/map/compare/swipe.js
+++ b/web/js/map/compare/swipe.js
@@ -138,7 +138,7 @@ var addLineOverlay = function(map) {
firstLabel.appendChild(document.createTextNode('A'));
secondLabel.appendChild(document.createTextNode('B'));
- iconEl.className = 'fa fa-arrows-h';
+ iconEl.className = 'fas fa-arrows-alt-h';
draggerEl.className = 'ab-swipe-dragger';
lineCaseEl.className = 'ab-swipe-line';
lineCaseEl.appendChild(firstLabel);
diff --git a/web/js/map/rotation.js b/web/js/map/rotation.js
index 0584990b0..fa5f7b7f0 100644
--- a/web/js/map/rotation.js
+++ b/web/js/map/rotation.js
@@ -18,7 +18,7 @@ export function MapRotate(ui, models, map) {
*
* @returns {void}
*/
- this.init = function (map, id) {
+ this.init = function(map, id) {
this.buildRotationWidget(map);
this.setRotationEvents(map, id);
};
@@ -32,19 +32,23 @@ export function MapRotate(ui, models, map) {
*
* @returns {void}
*/
- this.buildRotationWidget = function (map) {
+ this.buildRotationWidget = function(map) {
var $map = $('#' + map.getTarget());
var $rotateLeftButton = $('<button></button>')
.addClass('wv-map-rotate-left wv-map-zoom')
- .attr('title', 'You may also rotate by holding Alt and dragging the mouse');
- var $lefticon = $('<i></i>')
- .addClass('fa fa-undo');
+ .attr(
+ 'title',
+ 'You may also rotate by holding Alt and dragging the mouse'
+ );
+ var $lefticon = $('<i></i>').addClass('fa fa-undo');
var $rotateRightButton = $('<button></button>')
.addClass('wv-map-rotate-right wv-map-zoom')
- .attr('title', 'You may also rotate by holding Alt and dragging the mouse');
- var $righticon = $('<i></i>')
- .addClass('fa fa-repeat');
+ .attr(
+ 'title',
+ 'You may also rotate by holding Alt and dragging the mouse'
+ );
+ var $righticon = $('<i></i>').addClass('fas fa-redo');
var $resetButton = $('<button></button>')
.addClass('wv-map-reset-rotation wv-map-zoom')
@@ -53,7 +57,8 @@ export function MapRotate(ui, models, map) {
$rotateLeftButton.append($lefticon);
$rotateRightButton.append($righticon);
- $map.append($rotateLeftButton)
+ $map
+ .append($rotateLeftButton)
.append($resetButton)
.append($rotateRightButton);
};
@@ -69,23 +74,24 @@ export function MapRotate(ui, models, map) {
*
* @returns {void}
*/
- this.setRotationEvents = function (map, id) {
+ this.setRotationEvents = function(map, id) {
var dur = 500;
var $leftButton = $('#wv-map-' + id + ' .wv-map-rotate-left');
var $rightButton = $('#wv-map-' + id + ' .wv-map-rotate-right');
var $resetButton = $('#wv-map-' + id + ' .wv-map-reset-rotation');
// Set buttons to animate rotation by 18 degrees. use setInterval to repeat the rotation when mouse button is held
- $leftButton.button({
- text: false
- })
- .mousedown(function () {
- self.intervalId = setInterval(function () {
+ $leftButton
+ .button({
+ text: false
+ })
+ .mousedown(function() {
+ self.intervalId = setInterval(function() {
self.rotate(10, dur, map);
}, dur);
self.rotate(10, dur, map);
})
- .mouseup(function () {
+ .mouseup(function() {
clearInterval(self.intervalId);
})
.mouseout(function() {
@@ -94,42 +100,43 @@ export function MapRotate(ui, models, map) {
// This component is inside the map viewport container. Allowing
// mouse move events to bubble up displays map coordinates--let those
// be blank when over a component.
- .mousemove((e) => e.stopPropagation());
+ .mousemove(e => e.stopPropagation());
- $rightButton.button({
- text: false
- })
- .mousedown(function () {
- self.intervalId = setInterval(function () {
+ $rightButton
+ .button({
+ text: false
+ })
+ .mousedown(function() {
+ self.intervalId = setInterval(function() {
self.rotate(-10, dur, map);
}, dur);
self.rotate(-10, dur, map);
})
- .mouseup(function () {
+ .mouseup(function() {
clearInterval(self.intervalId);
})
.mouseout(function() {
clearInterval(self.intervalId);
})
// See note above
- .mousemove((e) => e.stopPropagation());
+ .mousemove(e => e.stopPropagation());
- $resetButton.button({
- label: Number(models.map.rotation * (180 / Math.PI))
- .toFixed()
- })
- .mousedown(function () { // reset rotation
+ $resetButton
+ .button({
+ label: Number(models.map.rotation * (180 / Math.PI)).toFixed()
+ })
+ .mousedown(function() {
+ // reset rotation
clearInterval(self.intervalId); // stop repeating rotation on mobile
- map.getView()
- .animate({
- duration: 500,
- rotation: 0
- });
+ map.getView().animate({
+ duration: 500,
+ rotation: 0
+ });
$resetButton.button('option', 'label', '0');
})
// See note above
- .mousemove((e) => e.stopPropagation());
+ .mousemove(e => e.stopPropagation());
};
/**
@@ -141,11 +148,11 @@ export function MapRotate(ui, models, map) {
* This ensures the maximum degrees never exceeds +/- 360.
* The current view is then set to this new value.
*/
- this.saveRotation = function (currentDeg, currentView) {
+ this.saveRotation = function(currentDeg, currentView) {
if (Math.abs(currentDeg) === 360) {
currentView.setRotation(0);
} else if (Math.abs(currentDeg) >= 360) {
- var newNadVal = ((360 - Math.abs(currentDeg)) * (Math.PI / 180));
+ var newNadVal = (360 - Math.abs(currentDeg)) * (Math.PI / 180);
if (currentDeg < 0) {
currentView.setRotation(newNadVal);
} else {
@@ -162,17 +169,15 @@ export function MapRotate(ui, models, map) {
*
* @returns {void}
*/
- this.updateRotation = function () {
- var radians,
- currentView,
- currentDeg;
+ this.updateRotation = function() {
+ var radians, currentView, currentDeg;
currentView = ui.selected.getView();
radians = currentView.getRotation();
models.map.rotation = radians;
self.setResetButton(radians);
- currentDeg = (currentView.getRotation() * (180.0 / Math.PI));
+ currentDeg = currentView.getRotation() * (180.0 / Math.PI);
this.saveRotation(currentDeg, currentView);
};
@@ -187,28 +192,23 @@ export function MapRotate(ui, models, map) {
*
* @returns {void}
*/
- this.setResetButton = function (radians) {
+ this.setResetButton = function(radians) {
var button = $('.wv-map-reset-rotation');
var deg = radians * (180.0 / Math.PI);
// Set reset button content
- button.button('option', 'label', Number(deg % 360)
- .toFixed());
+ button.button('option', 'label', Number(deg % 360).toFixed());
switch (true) {
- case (deg >= 100.0):
- button.find('span')
- .attr('style', 'padding-left: 9px');
+ case deg >= 100.0:
+ button.find('span').attr('style', 'padding-left: 9px');
break;
- case (deg <= -100.0):
- button.find('span')
- .attr('style', 'padding-left: 6px');
+ case deg <= -100.0:
+ button.find('span').attr('style', 'padding-left: 6px');
break;
- case (deg <= -10.0):
- button.find('span')
- .attr('style', 'padding-left: 10px');
+ case deg <= -10.0:
+ button.find('span').attr('style', 'padding-left: 10px');
break;
default:
- button.find('span')
- .attr('style', 'padding-left: 14px');
+ button.find('span').attr('style', 'padding-left: 14px');
break;
}
};
@@ -227,18 +227,15 @@ export function MapRotate(ui, models, map) {
*
* @returns {void}
*/
- this.rotate = function (amount, duration, map) {
- var currentDeg = (map.getView()
- .getRotation() * (180.0 / Math.PI));
+ this.rotate = function(amount, duration, map) {
+ var currentDeg = map.getView().getRotation() * (180.0 / Math.PI);
var currentView = ui.selected.getView();
this.saveRotation(currentDeg, currentView);
- map.getView()
- .animate({
- rotation: map.getView()
- .getRotation() - (Math.PI / amount),
- duration: duration
- });
+ map.getView().animate({
+ rotation: map.getView().getRotation() - Math.PI / amount,
+ duration: duration
+ });
};
-};
+}
diff --git a/web/js/projection/ui.js b/web/js/projection/ui.js
index 42a1793e9..172e91457 100644
--- a/web/js/projection/ui.js
+++ b/web/js/projection/ui.js
@@ -11,13 +11,13 @@ export function projectionUi(models, config) {
var selector = '#wv-proj-button';
- var init = function () {
+ var init = function() {
if (config.ui && config.ui.projections) {
render();
}
};
- var render = function () {
+ var render = function() {
$button = $('<input></input>')
.attr('type', 'checkbox')
.attr('id', 'wv-proj-button-check');
@@ -25,49 +25,53 @@ export function projectionUi(models, config) {
.attr('for', 'wv-proj-button-check')
.attr('title', 'Switch projection');
var $icon = $('<i></i>')
- .addClass('fa')
- .addClass('fa-globe')
+ .addClass('fas')
+ .addClass('fa-globe-asia')
.addClass('fa-2x');
$label.append($icon);
- $(selector)
- .append($label);
- $(selector)
- .append($button);
+ $(selector).append($label);
+ $(selector).append($button);
$button.button({
text: false
});
- $button.click(function (event) {
+ $button.click(function(event) {
event.stopPropagation();
wvui.close();
- var checked = $('#wv-proj-button-check')
- .prop('checked');
+ var checked = $('#wv-proj-button-check').prop('checked');
if (checked) {
show();
}
});
};
- var show = function () {
- var $menu = wvui.getMenu()
- .attr('id', 'wv-proj-menu');
+ var show = function() {
+ var $menu = wvui.getMenu().attr('id', 'wv-proj-menu');
$menuItems = $('<ul></ul>');
- lodashEach(config.ui.projections, function (ui) {
+ lodashEach(config.ui.projections, function(ui) {
var $item = $(
- '<li data-proj=\'' + ui.id + '\'>' +
- '<a data-proj=\'' + ui.id + '\'>' +
- '<i class=\'ui-icon icon-large ' + ui.style + '\'>' +
- '</i>' + ui.name + '</a></li>');
+ "<li data-proj='" +
+ ui.id +
+ "'>" +
+ "<a data-proj='" +
+ ui.id +
+ "'>" +
+ "<i class='ui-icon icon-large " +
+ ui.style +
+ "'>" +
+ '</i>' +
+ ui.name +
+ '</a></li>'
+ );
$menuItems.append($item);
- $item.click(function () {
+ $item.click(function() {
googleTagManager.pushEvent({
- 'event': 'change_projection',
- 'projection': ui.name
+ event: 'change_projection',
+ projection: ui.name
});
models.proj.select(ui.id);
- $('#wv-proj-button-check')
- .prop('checked', false);
+ $('#wv-proj-button-check').prop('checked', false);
$button.button('refresh');
});
});
@@ -83,28 +87,24 @@ export function projectionUi(models, config) {
$menuItems.show('slide', {
direction: 'up'
});
- $('#wv-proj-menu li')
- .removeClass('wv-menu-item-selected');
- $('#wv-proj-menu li[data-proj=\'' + models.proj.selected.id + '\']')
- .addClass('wv-menu-item-selected');
+ $('#wv-proj-menu li').removeClass('wv-menu-item-selected');
+ $("#wv-proj-menu li[data-proj='" + models.proj.selected.id + "']").addClass(
+ 'wv-menu-item-selected'
+ );
- var clickOut = function (event) {
- if ($button.parent()
- .has(event.target)
- .length > 0) {
+ var clickOut = function(event) {
+ if ($button.parent().has(event.target).length > 0) {
return;
}
$menuItems.hide();
- $('#wv-proj-button-check')
- .prop('checked', false);
- $('#wv-proj-button label')
- .removeClass('ui-state-hover');
+ $('#wv-proj-button-check').prop('checked', false);
+ $('#wv-proj-button label').removeClass('ui-state-hover');
$button.button('refresh');
$('body')
.off('click', clickOut)
.off('touchstart', clickOut);
};
- $menuItems.on('touchstart', function (event) {
+ $menuItems.on('touchstart', function(event) {
event.stopPropagation();
});
$('body')
@@ -114,4 +114,4 @@ export function projectionUi(models, config) {
init();
return self;
-};
+}