Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Add OL5.2.0, change import naming, add register proj4

ZachTRice2adce3470ff4
diff --git a/package-lock.json b/package-lock.json
index 0ed31e123..44d568b2e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -11537,13 +11537,23 @@
"dev": true
},
"ol": {
- "version": "4.5.0",
- "resolved": "https://registry.npmjs.org/ol/-/ol-4.5.0.tgz",
- "integrity": "sha512-ICZkndY8XRXgZT/Dlf6Dn/B1ZGpPNKINyv5WoiFKuddeirSNBZoUGZCeZO0NUgiAOqO8YffztylzxoZaNRAJ0g==",
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/ol/-/ol-5.2.0.tgz",
+ "integrity": "sha512-/sXlXKMT7W/4txYmEJiqZousQ5GScDoqVrltyQDl0himUD1oEV460bH74eD49AMm0OmQL9+TIn6DXKqOYzjTLw==",
"requires": {
"pbf": "3.1.0",
"pixelworks": "1.1.0",
- "rbush": "2.0.1"
+ "rbush": "2.0.2"
+ },
+ "dependencies": {
+ "rbush": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/rbush/-/rbush-2.0.2.tgz",
+ "integrity": "sha512-XBOuALcTm+O/H8G90b6pzu6nX6v2zCKiFG4BJho8a+bY6AER6t8uQUZdi5bomQc0AprCWhEGa7ncAbbRap0bRA==",
+ "requires": {
+ "quickselect": "1.1.1"
+ }
+ }
}
},
"on-finished": {
@@ -14478,14 +14488,6 @@
}
}
},
- "rbush": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/rbush/-/rbush-2.0.1.tgz",
- "integrity": "sha1-TPrKKMMGS8DudUMaG3mZDode76k=",
- "requires": {
- "quickselect": "1.1.1"
- }
- },
"rc": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
diff --git a/package.json b/package.json
index 5110cf2f0..0c4a469be 100644
--- a/package.json
+++ b/package.json
@@ -163,7 +163,7 @@
"jscrollpane": "^2.0.22",
"lodash": "^4.15.0",
"nouislider": "7.0.10",
- "ol": "~4.5.0",
+ "ol": "^5.2.0",
"perfect-scrollbar": "^0.8.1",
"proj4": "2.3.3",
"promise-queue": "2.2.3",
diff --git a/web/js/data/cmr.js b/web/js/data/cmr.js
index 3673c89b9..e7545a1d0 100644
--- a/web/js/data/cmr.js
+++ b/web/js/data/cmr.js
@@ -1,6 +1,6 @@
import $ from 'jquery';
import util from '../util/util';
-import OlGeomPolygon from 'ol/geom/polygon';
+import OlGeomPolygon from 'ol/geom/Polygon';
export const REL_DATA = 'http://esipfed.org/ns/fedsearch/1.1/data#';
export const REL_METADATA = 'http://esipfed.org/ns/fedsearch/1.1/metadata#';
diff --git a/web/js/data/map.js b/web/js/data/map.js
index 6b123234b..07f2dc737 100644
--- a/web/js/data/map.js
+++ b/web/js/data/map.js
@@ -1,15 +1,15 @@
import $ from 'jquery';
import lodashEach from 'lodash/each';
-import OlStyleStyle from 'ol/style/style';
-import OlStyleIcon from 'ol/style/icon';
-import OlStyleText from 'ol/style/text';
-import OlStyleFill from 'ol/style/fill';
-import OlStyleStroke from 'ol/style/stroke';
-import OlLayerVector from 'ol/layer/vector';
-import OlSourceVector from 'ol/source/vector';
-import OlGeomLineString from 'ol/geom/linestring';
-import OlFormatGeoJSON from 'ol/format/geojson';
-import OlFeature from 'ol/feature';
+import OlStyleStyle from 'ol/style/Style';
+import OlStyleIcon from 'ol/style/Icon';
+import OlStyleText from 'ol/style/Text';
+import OlStyleFill from 'ol/style/Fill';
+import OlStyleStroke from 'ol/style/Stroke';
+import OlLayerVector from 'ol/layer/Vector';
+import OlSourceVector from 'ol/source/Vector';
+import OlGeomLineString from 'ol/geom/LineString';
+import OlFormatGeoJSON from 'ol/format/GeoJSON';
+import OlFeature from 'ol/Feature';
import { CRS_WGS_84, mapToPolys, mapDistanceX } from '../map/map';
diff --git a/web/js/data/results.js b/web/js/data/results.js
index 05e2db284..ab64d52fb 100644
--- a/web/js/data/results.js
+++ b/web/js/data/results.js
@@ -1,10 +1,10 @@
import $ from 'jquery';
-import OlGeomMultiPolygon from 'ol/geom/multipolygon';
-import OlGeomMultiPoint from 'ol/geom/multipoint';
-import OlFormatGeoJSON from 'ol/format/geojson';
-import OlGeomPolygon from 'ol/geom/polygon';
-import OlGeomPoint from 'ol/geom/point';
+import OlGeomMultiPolygon from 'ol/geom/MultiPolygon';
+import OlGeomMultiPoint from 'ol/geom/MultiPoint';
+import OlFormatGeoJSON from 'ol/format/GeoJSON';
+import OlGeomPolygon from 'ol/geom/Polygon';
+import OlGeomPoint from 'ol/geom/Point';
import olExtent from 'ol/extent';
import lodashEach from 'lodash/each';
import { dataCmrRoundTime, dataCmrGeometry } from './cmr';
diff --git a/web/js/map/animate.js b/web/js/map/animate.js
index 8cc3ab0a1..664b16840 100644
--- a/web/js/map/animate.js
+++ b/web/js/map/animate.js
@@ -1,5 +1,5 @@
import olExtent from 'ol/extent';
-import OlGeomLineString from 'ol/geom/linestring';
+import OlGeomLineString from 'ol/geom/LineString';
export function mapAnimate(models, config, ui) {
var self = {};
diff --git a/web/js/map/datelinebuilder.js b/web/js/map/datelinebuilder.js
index 8cb23d885..045159377 100644
--- a/web/js/map/datelinebuilder.js
+++ b/web/js/map/datelinebuilder.js
@@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
-import OlOverlay from 'ol/overlay';
+import OlOverlay from 'ol/Overlay';
import util from '../util/util';
import DateLine from '../components/dateline/dateline';
diff --git a/web/js/map/layerbuilder.js b/web/js/map/layerbuilder.js
index 54bc6b7d5..de8e1e221 100644
--- a/web/js/map/layerbuilder.js
+++ b/web/js/map/layerbuilder.js
@@ -1,13 +1,13 @@
import util from '../util/util';
-import OlTileGridWMTS from 'ol/tilegrid/wmts';
-import OlSourceWMTS from 'ol/source/wmts';
-import OlSourceTileWMS from 'ol/source/tilewms';
-import OlLayerGroup from 'ol/layer/group';
-import OlLayerTile from 'ol/layer/tile';
-import OlTileGridTileGrid from 'ol/tilegrid/tilegrid';
-import MVT from 'ol/format/mvt';
-import LayerVectorTile from 'ol/layer/vectortile';
-import SourceVectorTile from 'ol/source/vectortile';
+import OlTileGridWMTS from 'ol/tilegrid/WMTS';
+import OlSourceWMTS from 'ol/source/WMTS';
+import OlSourceTileWMS from 'ol/source/TileWMS';
+import OlLayerGroup from 'ol/layer/Group';
+import OlLayerTile from 'ol/layer/Tile';
+import OlTileGridTileGrid from 'ol/tilegrid/TileGrid';
+import MVT from 'ol/format/MVT';
+import LayerVectorTile from 'ol/layer/VectorTile';
+import SourceVectorTile from 'ol/source/VectorTile';
import lodashCloneDeep from 'lodash/cloneDeep';
import lodashMerge from 'lodash/merge';
import lodashEach from 'lodash/each';
diff --git a/web/js/map/map.js b/web/js/map/map.js
index 24421e2c1..33d3c9ded 100644
--- a/web/js/map/map.js
+++ b/web/js/map/map.js
@@ -2,7 +2,7 @@ import lodashMap from 'lodash/map';
import lodashEach from 'lodash/each';
import lodashIsUndefined from 'lodash/isUndefined';
import lodashFind from 'lodash/find';
-import OlGeomPolygon from 'ol/geom/polygon';
+import OlGeomPolygon from 'ol/geom/Polygon';
export const CRS_WGS_84 = 'EPSG:4326';
diff --git a/web/js/map/precachetile.js b/web/js/map/precachetile.js
index 335801ee1..ba3d80736 100644
--- a/web/js/map/precachetile.js
+++ b/web/js/map/precachetile.js
@@ -1,6 +1,6 @@
import lodashEach from 'lodash/each';
import olExtent from 'ol/extent';
-import OlRendererCanvasTileLayer from 'ol/renderer/canvas/tilelayer';
+import OlRendererCanvasTileLayer from 'ol/renderer/canvas/TileLayer';
export function mapPrecacheTile(models, config, cache, parent) {
/**
diff --git a/web/js/map/ui.js b/web/js/map/ui.js
index bb7d375b7..3d1e47628 100644
--- a/web/js/map/ui.js
+++ b/web/js/map/ui.js
@@ -7,21 +7,21 @@ import lodashThrottle from 'lodash/throttle';
import lodashCloneDeep from 'lodash/cloneDeep';
import lodashFind from 'lodash/find';
import util from '../util/util';
-import OlMap from 'ol/map';
-import OlView from 'ol/view';
-import OlKinetic from 'ol/kinetic';
-import OlGraticule from 'ol/graticule';
-import OlStyleStroke from 'ol/style/stroke';
-import OlControlScaleLine from 'ol/control/scaleline';
+import OlMap from 'ol/Map';
+import OlView from 'ol/View';
+import OlKinetic from 'ol/Kinetic';
+import OlGraticule from 'ol/Graticule';
+import OlStyleStroke from 'ol/style/Stroke';
+import OlControlScaleLine from 'ol/control/ScaleLine';
import olEventsCondition from 'ol/events/condition';
-import OlInteractionPinchRotate from 'ol/interaction/pinchrotate';
-import OlInteractionDragRotate from 'ol/interaction/dragrotate';
-import OlInteractionDoubleClickZoom from 'ol/interaction/doubleclickzoom';
-import OlInteractionPinchZoom from 'ol/interaction/pinchzoom';
-import OlInteractionDragPan from 'ol/interaction/dragpan';
-import OlInteractionMouseWheelZoom from 'ol/interaction/mousewheelzoom';
-import OlInteractionDragZoom from 'ol/interaction/dragzoom';
-import OlLayerGroup from 'ol/layer/group';
+import OlInteractionPinchRotate from 'ol/interaction/PinchRotate';
+import OlInteractionDragRotate from 'ol/interaction/DragRotate';
+import OlInteractionDoubleClickZoom from 'ol/interaction/DoubleClickZoom';
+import OlInteractionPinchZoom from 'ol/interaction/PinchZoom';
+import OlInteractionDragPan from 'ol/interaction/DragPan';
+import OlInteractionMouseWheelZoom from 'ol/interaction/MouseWheelZoom';
+import OlInteractionDragZoom from 'ol/interaction/DragZoom';
+import OlLayerGroup from 'ol/layer/Group';
import olExtent from 'ol/extent';
import olProj from 'ol/proj';
import { MapRotate } from './rotation';
diff --git a/web/js/natural-events/markers.js b/web/js/natural-events/markers.js
index 778679151..d9ff02b22 100644
--- a/web/js/natural-events/markers.js
+++ b/web/js/natural-events/markers.js
@@ -1,13 +1,13 @@
import lodashFind from 'lodash/find';
import lodashIsEmpty from 'lodash/isEmpty';
import olExtent from 'ol/extent';
-import OlOverlay from 'ol/overlay';
-import OlFeature from 'ol/feature';
-import OlStyleStyle from 'ol/style/style';
-import OlStyleStroke from 'ol/style/stroke';
-import OlLayerVector from 'ol/layer/vector';
-import OlSourceVector from 'ol/source/vector';
-import OlGeomPolygon from 'ol/geom/polygon';
+import OlOverlay from 'ol/Overlay';
+import OlFeature from 'ol/Feature';
+import OlStyleStyle from 'ol/style/Style';
+import OlStyleStroke from 'ol/style/Stroke';
+import OlLayerVector from 'ol/layer/Vector';
+import OlSourceVector from 'ol/source/Vector';
+import OlGeomPolygon from 'ol/geom/Polygon';
import olProj from 'ol/proj';
export default function markers (models, ui) {
diff --git a/web/js/natural-events/track.js b/web/js/natural-events/track.js
index adfe03671..1a9b713a1 100644
--- a/web/js/natural-events/track.js
+++ b/web/js/natural-events/track.js
@@ -1,10 +1,10 @@
-import OlFeature from 'ol/feature';
-import OlOverlay from 'ol/overlay';
-import OlLayerVector from 'ol/layer/vector';
-import OlSourceVector from 'ol/source/vector';
-import OlStyleStroke from 'ol/style/stroke';
-import OlStyleStyle from 'ol/style/style';
-import OlGeomMultiLineString from 'ol/geom/multilinestring';
+import OlFeature from 'ol/Feature';
+import OlOverlay from 'ol/Overlay';
+import OlLayerVector from 'ol/layer/Vector';
+import OlSourceVector from 'ol/source/Vector';
+import OlStyleStroke from 'ol/style/Stroke';
+import OlStyleStyle from 'ol/style/Style';
+import OlGeomMultiLineString from 'ol/geom/MultiLineString';
import olProj from 'ol/proj';
import lodashEach from 'lodash/each';
import lodashDebounce from 'lodash/debounce';
diff --git a/web/js/ol/lookupimagetile.js b/web/js/ol/lookupimagetile.js
index 72dcde4e6..d1b4ab0a8 100644
--- a/web/js/ol/lookupimagetile.js
+++ b/web/js/ol/lookupimagetile.js
@@ -1,5 +1,5 @@
-import OlImageTile from 'ol/imagetile';
-import OlTileState from 'ol/tilestate';
+import OlImageTile from 'ol/ImageTile';
+import OlTileState from 'ol/TileState';
class LookupImageTile extends OlImageTile {
constructor(lookup, tileCoord, state, src, crossOrigin, tileLoadFunction, sourceOptions) {
diff --git a/web/js/projection/model.js b/web/js/projection/model.js
index 25fce56f6..b4bab1f13 100644
--- a/web/js/projection/model.js
+++ b/web/js/projection/model.js
@@ -1,5 +1,6 @@
import lodashEach from 'lodash/each';
import olProj from 'ol/proj';
+import { register } from 'ol/proj/proj4';
import proj4 from 'proj4';
import util from '../util/util';
@@ -10,7 +11,8 @@ export function projectionModel(config) {
var init = function () {
self.selectDefault();
- olProj.setProj4(proj4);
+ // olProj.setProj4(proj4);
+ register(proj4);
lodashEach(config.projections, function (proj) {
if (proj.crs && proj.proj4) {
self.register(proj.crs, proj.proj4);