@corpsmap/corpsmap 3.2.93 → 3.2.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/dist/corpsmap.css +1 -0
- package/dist/corpsmap.es.js +90955 -0
- package/dist/corpsmap.umd.js +401 -0
- package/dist/vite.svg +1 -0
- package/package.json +70 -87
- package/src/App.css +42 -0
- package/src/App.jsx +12 -0
- package/src/application-bundles/api-bundle.js +76 -74
- package/src/application-bundles/basic-toolbar-bundle.js +57 -57
- package/src/application-bundles/create-ol-map-bundle.jsx +278 -0
- package/src/application-bundles/identify-bundle.js +119 -119
- package/src/application-bundles/index.js +1 -1
- package/src/application-bundles/map-basemap-bundle.js +73 -69
- package/src/application-bundles/map-layers-bundle.js +42 -35
- package/src/application-bundles/map-view-bundle.jsx +334 -0
- package/src/application-bundles/notification-bundle.js +37 -32
- package/src/application-bundles/primary-panel-bundle.js +85 -85
- package/src/application-bundles/search-bundle.js +122 -122
- package/src/application-bundles/south-region-bundle.js +96 -88
- package/src/application-bundles/vertical-layout-bundle.js +88 -88
- package/src/application-bundles/viewport-bundle.js +19 -18
- package/src/application-bundles-old/ui-bundle.js +240 -179
- package/src/application-containers/{basic-toolbar.js → basic-toolbar.jsx} +24 -24
- package/src/application-containers/{corpsmap.js → corpsmap.jsx} +7 -2
- package/src/application-containers/{left-sidebar.js → left-sidebar.jsx} +3 -6
- package/src/application-containers/{lower-right-toolbar.js → lower-right-toolbar.jsx} +12 -11
- package/src/application-containers/map.jsx +57 -0
- package/src/application-containers/{modal-window.js → modal-window.jsx} +13 -15
- package/src/application-containers/{north-region.js → north-region.jsx} +26 -25
- package/src/application-containers/{notification-pane.js → notification-pane.jsx} +37 -37
- package/src/application-containers/{notification-quadrant.js → notification-quadrant.jsx} +20 -20
- package/src/application-containers/{notification.js → notification.jsx} +91 -91
- package/src/application-containers/{primary-panel.js → primary-panel.jsx} +94 -94
- package/src/application-containers/right-sidebar.jsx +44 -0
- package/src/application-containers/{south-region-tab.js → south-region-tab.jsx} +26 -17
- package/src/application-containers/south-region.jsx +75 -0
- package/src/application-containers/upper-right-toolbar.jsx +28 -0
- package/src/application-controls/{basic-toolbar-button.js → basic-toolbar-button.jsx} +124 -124
- package/src/application-controls/{index.js → index.jsx} +34 -34
- package/src/application-controls/{search-results-list-item.js → search-results-list-item.jsx} +50 -50
- package/src/application-controls/{sidebar-button.js → sidebar-button.jsx} +69 -69
- package/src/application-controls/{sidebar-panel-opener.js → sidebar-panel-opener.jsx} +4 -4
- package/src/application-controls/{tree-list-folder.js → tree-list-folder.jsx} +46 -46
- package/src/application-controls/tree-list-item.jsx +83 -0
- package/src/application-exports/{map-provider.js → map-provider.jsx} +122 -100
- package/src/assets/react.svg +1 -0
- package/src/config/default-config.js +53 -68
- package/src/core-plugins/add-data/{add-data-button.js → add-data-button.jsx} +34 -34
- package/src/core-plugins/add-data/{add-geojson.js → add-geojson.jsx} +47 -47
- package/src/core-plugins/add-data/{add-kmlfile.js → add-kmlfile.jsx} +46 -46
- package/src/core-plugins/add-data/add-shapefile.jsx +47 -0
- package/src/core-plugins/add-data/bundle.js +226 -225
- package/src/core-plugins/basemap-switcher/{basemap-switcher-list-item.js → basemap-switcher-list-item.jsx} +48 -45
- package/src/core-plugins/basemap-switcher/{basemap-switcher-list.js → basemap-switcher-list.jsx} +1 -1
- package/src/core-plugins/bookmarks/{bookmark-list-item.js → bookmark-list-item.jsx} +26 -22
- package/src/core-plugins/bookmarks/{bookmark-list.js → bookmark-list.jsx} +1 -1
- package/src/core-plugins/bookmarks/bookmark-panel.jsx +191 -0
- package/src/core-plugins/catalog/catalog-button.jsx +33 -0
- package/src/core-plugins/catalog/catalog-list-item.jsx +118 -0
- package/src/core-plugins/catalog/catalog-list.jsx +78 -0
- package/src/core-plugins/catalog/{catalog-modal-window.js → catalog-modal-window.jsx} +35 -25
- package/src/core-plugins/change-log/bundle.js +2 -2
- package/src/core-plugins/change-log/{change-log-button.js → change-log-button.jsx} +40 -44
- package/src/core-plugins/change-log/{change-log-modal.js → change-log-modal.jsx} +4 -11
- package/src/core-plugins/change-log/index.js +14 -14
- package/src/core-plugins/change-log/{select-district.js → select-district.jsx} +73 -73
- package/src/core-plugins/contact-form/bundle.js +239 -244
- package/src/core-plugins/contact-form/index.js +17 -17
- package/src/core-plugins/contact-form/{question-button.js → question-button.jsx} +36 -36
- package/src/core-plugins/contact-form/{question-modal.js → question-modal.jsx} +215 -189
- package/src/core-plugins/coordinate-display/bundle.jsx +269 -0
- package/src/core-plugins/coordinate-display/{coordinate-display-bar.js → coordinate-display-bar.jsx} +66 -66
- package/src/core-plugins/coordinate-display/{coordinate-display-settings.js → coordinate-display-settings.jsx} +3 -7
- package/src/core-plugins/coordinate-display/{coordinate-interaction-bar.js → coordinate-interaction-bar.jsx} +1 -1
- package/src/core-plugins/coordinate-display/{coordinate-lat-lon-input.js → coordinate-lat-lon-input.jsx} +35 -35
- package/src/core-plugins/coordinate-display/{coordinate-popup.js → coordinate-popup.jsx} +27 -27
- package/src/core-plugins/draw-tools/create-draw-bundle.js +148 -138
- package/src/core-plugins/draw-tools/draw-button.jsx +204 -0
- package/src/core-plugins/draw-tools-old/create-draw-bundle.js +137 -127
- package/src/core-plugins/draw-tools-old/draw-button.js +90 -78
- package/src/core-plugins/editor/editor-base.js +8 -10
- package/src/core-plugins/editor/editor-button.js +122 -92
- package/src/core-plugins/editor/editor-table.js +62 -61
- package/src/core-plugins/geocoder/{bundle.js → bundle.jsx} +186 -186
- package/src/core-plugins/geocoder/index.js +14 -14
- package/src/core-plugins/geocoder/{overlay.js → overlay.jsx} +30 -30
- package/src/core-plugins/geocoder/search-bar.js copy.save +123 -123
- package/src/core-plugins/geocoder/{search-bar.js → search-bar.jsx} +121 -122
- package/src/core-plugins/identify/{bundle.js → bundle.jsx} +709 -707
- package/src/core-plugins/identify/{identify-buffer-section.js → identify-buffer-section.jsx} +52 -52
- package/src/core-plugins/identify/{identify-buffer-settings.js → identify-buffer-settings.jsx} +48 -48
- package/src/core-plugins/identify/{identify-button.js → identify-button.jsx} +100 -100
- package/src/core-plugins/identify/{identify-details-table.js → identify-details-table.jsx} +121 -118
- package/src/core-plugins/identify/identify-details.js +69 -69
- package/src/core-plugins/identify/{identify-sidebar-list-item.js → identify-sidebar-list-item.jsx} +106 -99
- package/src/core-plugins/identify/{identify-sidebar.js → identify-sidebar.jsx} +103 -99
- package/src/core-plugins/identify/{identify-table-cell.js → identify-table-cell.jsx} +49 -49
- package/src/core-plugins/identify/{identify-table.js → identify-table.jsx} +319 -334
- package/src/core-plugins/identify/index.js +27 -27
- package/src/core-plugins/identify/listeners/arcgis.js +158 -158
- package/src/core-plugins/identify/listeners/geojson.jsx +164 -0
- package/src/core-plugins/identify/listeners/raster.js +89 -89
- package/src/core-plugins/identify/listeners/{vector.js → vector.jsx} +106 -106
- package/src/core-plugins/identify-arcgis-rest/bundle.js +169 -169
- package/src/core-plugins/identify-cm/bundle.js +82 -82
- package/src/core-plugins/identify-geojson/bundle.js +164 -143
- package/src/core-plugins/identify-vector/{bundle.js → bundle.jsx} +135 -135
- package/src/core-plugins/identify-wms/bundle.js +138 -138
- package/src/core-plugins/legend/bundle.js +753 -730
- package/src/core-plugins/legend/{legend-header.js → legend-header.jsx} +1 -1
- package/src/core-plugins/legend/{legend-item-multiple.js → legend-item-multiple.jsx} +32 -32
- package/src/core-plugins/legend/{legend-panel.js → legend-panel.jsx} +1 -1
- package/src/core-plugins/login/login-button.jsx +49 -0
- package/src/core-plugins/map-loading-indicator/{loading-indicator.js → loading-indicator.jsx} +1 -1
- package/src/core-plugins/measure-tools/{measure-options.js → measure-options.jsx} +5 -8
- package/src/core-plugins/measure-tools/{measure-tools-button.js → measure-tools-button.jsx} +1 -1
- package/src/core-plugins/permalink/{permalink-button.js → permalink-button.jsx} +13 -13
- package/src/core-plugins/permalink/permalink-modal.jsx +67 -0
- package/src/core-plugins/print-map/{bundle.js → bundle.jsx} +316 -316
- package/src/core-plugins/print-map/{button.js → button.jsx} +1 -1
- package/src/core-plugins/resources/bundle.js +55 -50
- package/src/core-plugins/resources/resources-button.jsx +40 -0
- package/src/core-plugins/resources/{resources-modal.js → resources-modal.jsx} +9 -3
- package/src/core-plugins/rotate-north/{rotate-north-button.js → rotate-north-button.jsx} +2 -2
- package/src/core-plugins/theme-switcher/{theme-list-item.js → theme-list-item.jsx} +3 -3
- package/src/core-plugins/theme-switcher/{theme-list.js → theme-list.jsx} +1 -1
- package/src/core-plugins/three-d/three-d-button.jsx +44 -0
- package/src/core-plugins/tree-view/bundle.js +513 -513
- package/src/core-plugins/tree-view/{dataset-info-modal.js → dataset-info-modal.jsx} +141 -141
- package/src/core-plugins/tree-view/{dataset-legend.js → dataset-legend.jsx} +122 -122
- package/src/core-plugins/tree-view/{defaults-container.js → defaults-container.jsx} +27 -27
- package/src/core-plugins/tree-view/download-bundle.js +156 -156
- package/src/core-plugins/tree-view/{favorites-container.js → favorites-container.jsx} +27 -27
- package/src/core-plugins/tree-view/index.js +25 -25
- package/src/core-plugins/tree-view/layer-subpanel/{defaults-toggle.js → defaults-toggle.jsx} +28 -28
- package/src/core-plugins/tree-view/layer-subpanel/{download-layer.js → download-layer.jsx} +54 -54
- package/src/core-plugins/tree-view/layer-subpanel/{favorites-toggle.js → favorites-toggle.jsx} +28 -28
- package/src/core-plugins/tree-view/layer-subpanel/{label-toggle.js → label-toggle.jsx} +15 -14
- package/src/core-plugins/tree-view/layer-subpanel/{layer-subpanel.js → layer-subpanel.jsx} +179 -180
- package/src/core-plugins/tree-view/layer-subpanel/{natick-rgb.js → natick-rgb.jsx} +49 -37
- package/src/core-plugins/tree-view/layer-subpanel/remove-layer.jsx +75 -0
- package/src/core-plugins/tree-view/{tree-list-container.js → tree-list-container.jsx} +2 -5
- package/src/core-plugins/tree-view/{tree-list-item-dataset.js → tree-list-item-dataset.jsx} +1 -1
- package/src/core-plugins/tree-view/{tree-list-item-folder.js → tree-list-item-folder.jsx} +161 -163
- package/src/core-plugins/tree-view/{tree-list-item.js → tree-list-item.jsx} +2 -2
- package/src/core-plugins/tree-view/{tree-list.js → tree-list.jsx} +37 -29
- package/src/core-plugins/tree-view/{tree-view-panel.js → tree-view-panel.jsx} +139 -148
- package/src/core-plugins/tree-view/tree-view-toolbar/{add-all.js → add-all.jsx} +1 -1
- package/src/core-plugins/tree-view/tree-view-toolbar/{defaults.js → defaults.jsx} +40 -40
- package/src/core-plugins/tree-view/tree-view-toolbar/{favorites.js → favorites.jsx} +40 -40
- package/src/core-plugins/tree-view/tree-view-toolbar/{remove-all.js → remove-all.jsx} +1 -1
- package/src/core-plugins/tree-view/tree-view-toolbar/{toggle-expand.js → toggle-expand.jsx} +1 -1
- package/src/core-plugins/tree-view/tree-view-toolbar/{toggle-filter.js → toggle-filter.jsx} +1 -1
- package/src/core-plugins/zoom-home/bundle.js +28 -22
- package/src/core-plugins/zoom-home/index.js +5 -3
- package/src/core-plugins/zoom-home/{zoom-home-button.js → zoom-home-button.jsx} +2 -2
- package/src/core-plugins/zoom-in-out/index.js +19 -14
- package/src/core-plugins/zoom-in-out/{zoom-in-button.js → zoom-in-button.jsx} +7 -10
- package/src/core-plugins/zoom-in-out/{zoom-out-button.js → zoom-out-button.jsx} +7 -10
- package/src/core-plugins/zoom-level/bundle.js +35 -32
- package/src/core-plugins/zoom-level/index.js +17 -16
- package/src/core-plugins/zoom-level/{zoom-indicator.js → zoom-indicator.jsx} +34 -35
- package/src/core-plugins/zoom-to-box/bundle.js +52 -42
- package/src/core-plugins/zoom-to-box/{zoom-to-box-button.js → zoom-to-box-button.jsx} +9 -13
- package/src/css/_deprecated_bootstrap/css/bootstrap-paper.css +399 -124
- package/src/css/_deprecated_bootstrap/css/bootstrap-paper.min.css +8075 -3
- package/src/css/_deprecated_bootstrap/css/bootstrap-simplex.min.css +7320 -3
- package/src/css/_deprecated_bootstrap/css/bootstrap.css +582 -202
- package/src/css/_deprecated_bootstrap/css/bootstrap.css.map +142 -1
- package/src/css/_deprecated_bootstrap/css/bootstrap.min.css +7128 -2
- package/src/css/_deprecated_bootstrap/css/bootstrap.min.css.map +143 -1
- package/src/css/bg-colors.css +120 -120
- package/src/css/corpsmap-namespaced.css +9505 -9505
- package/src/css/corpsmap.css +10067 -9161
- package/src/css/navigation.css +174 -174
- package/src/index.css +68 -0
- package/src/{index.js → index.jsx} +113 -109
- package/src/main.jsx +3 -0
- package/src/openlayers-utils/format-utilities.js +87 -71
- package/src/openlayers-utils/layer-utilities.js +309 -302
- package/src/openlayers-utils/vector-style.js +131 -131
- package/src/utils/load-plugins.test.js +35 -35
- package/src/utils/redux-bundler-react.jsx +69 -0
- package/src/utils/scale-to-zoom-level.js +18 -22
- package/.babelrc +0 -7
- package/css/corpsmap.css +0 -10178
- package/fonts/cm.eot +0 -0
- package/fonts/cm.svg +0 -27
- package/fonts/cm.ttf +0 -0
- package/fonts/cm.woff +0 -0
- package/fonts/glyphicons-halflings-regular.eot +0 -0
- package/fonts/glyphicons-halflings-regular.svg +0 -288
- package/fonts/glyphicons-halflings-regular.ttf +0 -0
- package/fonts/glyphicons-halflings-regular.woff +0 -0
- package/fonts/glyphicons-halflings-regular.woff2 +0 -0
- package/fonts/maki.eot +0 -0
- package/fonts/maki.svg +0 -98
- package/fonts/maki.ttf +0 -0
- package/fonts/maki.woff +0 -0
- package/fonts/mapskin.eot +0 -0
- package/fonts/mapskin.svg +0 -282
- package/fonts/mapskin.ttf +0 -0
- package/fonts/mapskin.woff +0 -0
- package/fonts/materialdesignicons-webfont.eot +0 -0
- package/fonts/materialdesignicons-webfont.svg +0 -7467
- package/fonts/materialdesignicons-webfont.ttf +0 -0
- package/fonts/materialdesignicons-webfont.woff +0 -0
- package/fonts/materialdesignicons-webfont.woff2 +0 -0
- package/fonts/roboto/Roboto-Black.ttf +0 -0
- package/fonts/roboto/Roboto-BlackItalic.ttf +0 -0
- package/fonts/roboto/Roboto-Bold.ttf +0 -0
- package/fonts/roboto/Roboto-BoldItalic.ttf +0 -0
- package/fonts/roboto/Roboto-Italic.ttf +0 -0
- package/fonts/roboto/Roboto-Light.ttf +0 -0
- package/fonts/roboto/Roboto-LightItalic.ttf +0 -0
- package/fonts/roboto/Roboto-Medium.ttf +0 -0
- package/fonts/roboto/Roboto-MediumItalic.ttf +0 -0
- package/fonts/roboto/Roboto-Regular.ttf +0 -0
- package/fonts/roboto/Roboto-Thin.ttf +0 -0
- package/fonts/roboto/Roboto-ThinItalic.ttf +0 -0
- package/index.js +0 -5
- package/lib/dev.js +0 -171156
- package/lib/prod.js +0 -171070
- package/rollup.config.js +0 -50
- package/src/application-bundles/create-ol-map-bundle.js +0 -257
- package/src/application-bundles/map-view-bundle.js +0 -312
- package/src/application-containers/map.js +0 -45
- package/src/application-containers/old_corpsmap.js +0 -97
- package/src/application-containers/right-sidebar.js +0 -41
- package/src/application-containers/secondary-panel.js +0 -0
- package/src/application-containers/south-region.js +0 -79
- package/src/application-containers/upper-right-toolbar.js +0 -27
- package/src/application-controls/tree-list-item.js +0 -71
- package/src/core-plugins/add-data/add-shapefile.js +0 -43
- package/src/core-plugins/basemap-switcher/basemap-switcher-list-item copy.js +0 -59
- package/src/core-plugins/bookmarks/bookmark-panel.js +0 -157
- package/src/core-plugins/catalog/catalog-button.js +0 -36
- package/src/core-plugins/catalog/catalog-list-item.js +0 -83
- package/src/core-plugins/catalog/catalog-list.js +0 -70
- package/src/core-plugins/coordinate-display/bundle.js +0 -246
- package/src/core-plugins/draw-tools/draw-button.js +0 -192
- package/src/core-plugins/identify/listeners/geojson.js +0 -158
- package/src/core-plugins/login/login-button.js +0 -49
- package/src/core-plugins/permalink/permalink-modal.js +0 -64
- package/src/core-plugins/resources/resources-button.js +0 -44
- package/src/core-plugins/three-d/three-d-button.js +0 -44
- package/src/core-plugins/tree-view/layer-subpanel/remove-layer.js +0 -61
- /package/src/application-controls/{basic-toolbar-menu-divider.js → basic-toolbar-menu-divider.jsx} +0 -0
- /package/src/application-controls/{basic-toolbar-menu-item.js → basic-toolbar-menu-item.jsx} +0 -0
- /package/src/application-controls/{basic-toolbar-menu-up.js → basic-toolbar-menu-up.jsx} +0 -0
- /package/src/application-controls/{basic-toolbar-menu.js → basic-toolbar-menu.jsx} +0 -0
- /package/src/application-controls/{basic-toolbar-submenu.js → basic-toolbar-submenu.jsx} +0 -0
- /package/src/application-controls/{loading-indicator.js → loading-indicator.jsx} +0 -0
- /package/src/application-controls/{search-input.js → search-input.jsx} +0 -0
- /package/src/application-controls/{search-results-list.js → search-results-list.jsx} +0 -0
- /package/src/application-controls/{tree-list.js → tree-list.jsx} +0 -0
- /package/src/application-controls/{tree-view.js → tree-view.jsx} +0 -0
- /package/src/core-plugins/basemap-switcher/{basemap-switcher-button.js → basemap-switcher-button.jsx} +0 -0
- /package/src/core-plugins/bookmarks/{bookmark-button.js → bookmark-button.jsx} +0 -0
- /package/src/core-plugins/catalog/{catalog-error-item.js → catalog-error-item.jsx} +0 -0
- /package/src/core-plugins/catalog/{catalog-list-item-loader.js → catalog-list-item-loader.jsx} +0 -0
- /package/src/core-plugins/coordinate-display/{coordinate-display-proj-item.js → coordinate-display-proj-item.jsx} +0 -0
- /package/src/core-plugins/draw-tools/{draw-save-bundle.js → draw-save-bundle.jsx} +0 -0
- /package/src/core-plugins/draw-tools/{draw-tool-item.js → draw-tool-item.jsx} +0 -0
- /package/src/core-plugins/identify/{identify-popup.js → identify-popup.jsx} +0 -0
- /package/src/core-plugins/identify/{identify-sidebar-list.js → identify-sidebar-list.jsx} +0 -0
- /package/src/core-plugins/legend/{legend-button.js → legend-button.jsx} +0 -0
- /package/src/core-plugins/legend/{legend-item.js → legend-item.jsx} +0 -0
- /package/src/core-plugins/theme-switcher/{theme-switcher-button.js → theme-switcher-button.jsx} +0 -0
- /package/src/core-plugins/tree-view/{boundary-drop-target.js → boundary-drop-target.jsx} +0 -0
- /package/src/core-plugins/tree-view/layer-subpanel/{natick-rgb-options.js → natick-rgb-options.jsx} +0 -0
- /package/src/core-plugins/tree-view/layer-subpanel/{opacity-slider.js → opacity-slider.jsx} +0 -0
- /package/src/core-plugins/tree-view/{tree-view-button.js → tree-view-button.jsx} +0 -0
- /package/src/core-plugins/zoom-to-box/{index.js → index.jsx} +0 -0
- /package/src/utils/{plugin-region.js → plugin-region.jsx} +0 -0
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { connect } from 'redux-bundler-react';
|
|
3
|
-
import CatalogErrorItem from './catalog-error-item';
|
|
4
|
-
import CatalogListItem from "./catalog-list-item";
|
|
5
|
-
import CatalogListItemLoader from "./catalog-list-item-loader";
|
|
6
|
-
|
|
7
|
-
class CatalogList extends React.Component {
|
|
8
|
-
constructor(props){
|
|
9
|
-
super(props);
|
|
10
|
-
this.amidonescrolling = this.amidonescrolling.bind(this);
|
|
11
|
-
this.addItems = this.addItems.bind(this);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
amidonescrolling(){
|
|
15
|
-
const clientHeight = this.el.clientHeight;
|
|
16
|
-
const scrollTop = this.el.scrollTop;
|
|
17
|
-
const scrollHeight = this.el.scrollHeight;
|
|
18
|
-
const isDone = (scrollHeight - (clientHeight + scrollTop) === 0);
|
|
19
|
-
if(isDone) this.addItems();
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
addItems(){
|
|
23
|
-
const { doCatalogPageUp } = this.props;
|
|
24
|
-
doCatalogPageUp();
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
componentDidMount(){
|
|
28
|
-
this.el.addEventListener('scroll', this.amidonescrolling.bind(this));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
componentWillUnmount(){
|
|
32
|
-
this.el.removeEventListener('scroll', this.amidonescrolling.bind(this));
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
render() {
|
|
36
|
-
const { catalogItems, catalogIsLoading, onSetSearchTerm, cmLayers } = this.props;
|
|
37
|
-
return (
|
|
38
|
-
<ul
|
|
39
|
-
ref={(el) => {this.el = el}}
|
|
40
|
-
className="cm-list-group thin-scrollbar"
|
|
41
|
-
style={{
|
|
42
|
-
position: "absolute",
|
|
43
|
-
top: '95px',
|
|
44
|
-
bottom: 0,
|
|
45
|
-
left: 0,
|
|
46
|
-
right: 0,
|
|
47
|
-
margin: "15px",
|
|
48
|
-
overflow: "auto",
|
|
49
|
-
border: "1px solid #dddddd"
|
|
50
|
-
}}
|
|
51
|
-
>
|
|
52
|
-
{
|
|
53
|
-
catalogItems.map((item, i) => {
|
|
54
|
-
if(item === 'error') return <CatalogErrorItem key={i}/>
|
|
55
|
-
return <CatalogListItem key={i + item.displayName} active={cmLayers.indexOf(item.teamDatasetId) !== -1} item={item} onSetSearchTerm={onSetSearchTerm}/>;
|
|
56
|
-
})
|
|
57
|
-
}
|
|
58
|
-
{ catalogIsLoading ? <CatalogListItemLoader /> : null}
|
|
59
|
-
</ul>
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export default connect(
|
|
65
|
-
'selectCatalogIsLoading',
|
|
66
|
-
'selectCatalogItems',
|
|
67
|
-
'selectCmLayers',
|
|
68
|
-
'doCatalogPageUp',
|
|
69
|
-
CatalogList
|
|
70
|
-
);
|
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
import ReactDOM from "react-dom";
|
|
2
|
-
import Popup from "./coordinate-popup";
|
|
3
|
-
import Overlay from "ol/Overlay";
|
|
4
|
-
import { transform } from "ol/proj";
|
|
5
|
-
import throttle from "lodash/throttle";
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
name: "coordinateDisplay",
|
|
9
|
-
|
|
10
|
-
getReducer() {
|
|
11
|
-
const initialData = {
|
|
12
|
-
values: {
|
|
13
|
-
X: "0.0000",
|
|
14
|
-
Y: "0.0000",
|
|
15
|
-
},
|
|
16
|
-
latLonInput: {
|
|
17
|
-
X: "",
|
|
18
|
-
Y: "",
|
|
19
|
-
},
|
|
20
|
-
copyActive: false,
|
|
21
|
-
overlay: null,
|
|
22
|
-
container: null,
|
|
23
|
-
_shouldInitialize: false,
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
return (state = initialData, { type, payload }) => {
|
|
27
|
-
switch (type) {
|
|
28
|
-
case "MAP_INITIALIZED":
|
|
29
|
-
return Object.assign({}, state, {
|
|
30
|
-
_shouldInitialize: true,
|
|
31
|
-
});
|
|
32
|
-
case "COORD_COPY_ACTIVE":
|
|
33
|
-
case "COORD_COPIED":
|
|
34
|
-
case "COORD_INPUT_UPDATED":
|
|
35
|
-
case "COORD_INPUT_INVALID":
|
|
36
|
-
case "COORD_INITIALIZE_START":
|
|
37
|
-
case "COORD_INITIALIZE_FINISH":
|
|
38
|
-
case "COORD_POSITION_UPDATE":
|
|
39
|
-
case "COORD_OVERLAY_RENDERED":
|
|
40
|
-
case "COORD_OVERLAY_REMOVED":
|
|
41
|
-
return Object.assign({}, state, payload);
|
|
42
|
-
default:
|
|
43
|
-
return state;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
},
|
|
47
|
-
doCoordsInitialize: () => ({ dispatch, store }) => {
|
|
48
|
-
dispatch({
|
|
49
|
-
type: "COORD_INITIALIZE_START",
|
|
50
|
-
payload: {
|
|
51
|
-
_shouldInitialize: false,
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
const map = store.selectMap();
|
|
56
|
-
map.on("pointermove", throttle(store.doCoordsPointerMove, 200));
|
|
57
|
-
|
|
58
|
-
dispatch({
|
|
59
|
-
type: "COORD_INITIALIZE_FINISH",
|
|
60
|
-
});
|
|
61
|
-
},
|
|
62
|
-
doCoordsPointerMove: (e) => ({ dispatch, store }) => {
|
|
63
|
-
e.preventDefault();
|
|
64
|
-
e.stopPropagation();
|
|
65
|
-
|
|
66
|
-
const displayProjection = store.selectDisplayProjection();
|
|
67
|
-
const coord = e.coordinate;
|
|
68
|
-
const projected = transform(coord, "EPSG:3857", displayProjection);
|
|
69
|
-
const X = Math.round(projected[0] * 10000) / 10000;
|
|
70
|
-
const Y = Math.round(projected[1] * 10000) / 10000;
|
|
71
|
-
|
|
72
|
-
dispatch({
|
|
73
|
-
type: "COORD_POSITION_UPDATE",
|
|
74
|
-
payload: {
|
|
75
|
-
values: { X, Y },
|
|
76
|
-
},
|
|
77
|
-
});
|
|
78
|
-
},
|
|
79
|
-
doRenderCoordsOverlay: (center, coords) => ({ dispatch, store }) => {
|
|
80
|
-
const map = store.selectMap();
|
|
81
|
-
const hasCoordsOverlay = store.selectCoordsOverlay();
|
|
82
|
-
|
|
83
|
-
if (hasCoordsOverlay) {
|
|
84
|
-
store.doClearCoordOverlay(hasCoordsOverlay);
|
|
85
|
-
}
|
|
86
|
-
//generate overlay
|
|
87
|
-
const el = document.createElement("div");
|
|
88
|
-
const overlay = new Overlay({
|
|
89
|
-
element: el,
|
|
90
|
-
positioning: "bottom-center",
|
|
91
|
-
offset: [0, -10],
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
//add overlay to map
|
|
95
|
-
map.addOverlay(overlay);
|
|
96
|
-
ReactDOM.render(
|
|
97
|
-
<Popup
|
|
98
|
-
overlay={overlay}
|
|
99
|
-
coords={coords}
|
|
100
|
-
map={map}
|
|
101
|
-
onClear={store.doClearPopup}
|
|
102
|
-
/>,
|
|
103
|
-
el
|
|
104
|
-
);
|
|
105
|
-
|
|
106
|
-
overlay.setPosition(center);
|
|
107
|
-
dispatch({ type: "COORD_OVERLAY_RENDERED", payload: { overlay: overlay } });
|
|
108
|
-
},
|
|
109
|
-
doClearPopup: (e, overlay) => ({ store }) => {
|
|
110
|
-
console.log(e);
|
|
111
|
-
e.preventDefault();
|
|
112
|
-
e.stopPropagation();
|
|
113
|
-
store.doClearCoordOverlay(overlay);
|
|
114
|
-
},
|
|
115
|
-
doClearCoordOverlay: (overlay) => ({ dispatch, store }) => {
|
|
116
|
-
const map = store.selectMap();
|
|
117
|
-
overlay.setPosition(undefined);
|
|
118
|
-
const el = overlay.getElement();
|
|
119
|
-
el.parentNode.removeChild(el);
|
|
120
|
-
map.removeOverlay(overlay);
|
|
121
|
-
dispatch({ type: "COORD_OVERLAY_REMOVED", payload: { overlay: null } });
|
|
122
|
-
},
|
|
123
|
-
doStartCoordCopy: () => ({ dispatch, store }) => {
|
|
124
|
-
const map = store.selectMap();
|
|
125
|
-
store.doSetCursor("crosshair");
|
|
126
|
-
|
|
127
|
-
//Parent container for coord copy.
|
|
128
|
-
const container = document.createElement("div");
|
|
129
|
-
container.id = "cm-copy-coords";
|
|
130
|
-
document.body.appendChild(container);
|
|
131
|
-
|
|
132
|
-
dispatch({
|
|
133
|
-
type: "COORD_COPY_ACTIVE",
|
|
134
|
-
payload: {
|
|
135
|
-
copyActive: true,
|
|
136
|
-
container: container,
|
|
137
|
-
notification: {
|
|
138
|
-
message: "Click on map to copy coordinates.",
|
|
139
|
-
level: "info",
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
//listen once for click event
|
|
145
|
-
map.once("singleclick", store.doCoordCopy);
|
|
146
|
-
},
|
|
147
|
-
doCoordCopy: (e) => ({ dispatch, store }) => {
|
|
148
|
-
e.preventDefault();
|
|
149
|
-
e.stopPropagation();
|
|
150
|
-
|
|
151
|
-
const copyContainer = store.selectCoordsContainer();
|
|
152
|
-
const displayProjection = store.selectDisplayProjection();
|
|
153
|
-
const coord = e.coordinate;
|
|
154
|
-
const projected = transform(coord, "EPSG:3857", displayProjection);
|
|
155
|
-
const x = Math.round(projected[0] * 10000) / 10000;
|
|
156
|
-
const y = Math.round(projected[1] * 10000) / 10000;
|
|
157
|
-
|
|
158
|
-
//Add temp input node to use execCommand.
|
|
159
|
-
const valueEl = document.createElement("input");
|
|
160
|
-
copyContainer.appendChild(valueEl);
|
|
161
|
-
valueEl.value = `${x}, ${y}`;
|
|
162
|
-
valueEl.select();
|
|
163
|
-
document.execCommand("copy");
|
|
164
|
-
|
|
165
|
-
store.doStopCoordCopy(x, y);
|
|
166
|
-
},
|
|
167
|
-
doStopCoordCopy: (x, y) => ({ dispatch, store }) => {
|
|
168
|
-
const copyContainer = store.selectCoordsContainer();
|
|
169
|
-
const msg = `Copied ${x}, ${y} to the clipboard.`;
|
|
170
|
-
store.doSetCursor("default");
|
|
171
|
-
|
|
172
|
-
dispatch({
|
|
173
|
-
type: "COORD_COPIED",
|
|
174
|
-
payload: {
|
|
175
|
-
copyActive: false,
|
|
176
|
-
container: null,
|
|
177
|
-
notification: {
|
|
178
|
-
title: "Coordinate Display",
|
|
179
|
-
message: msg,
|
|
180
|
-
level: "info",
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
copyContainer.remove(); //remove dynamically created node.
|
|
186
|
-
store.doBasicToolbarDeactivate(); //close tool after copy.
|
|
187
|
-
},
|
|
188
|
-
doUpdateCoordInput: (e, label) => ({ dispatch, store }) => {
|
|
189
|
-
e.preventDefault();
|
|
190
|
-
e.stopPropagation();
|
|
191
|
-
const latLonInput = store.selectCoordsLatLonInput();
|
|
192
|
-
|
|
193
|
-
dispatch({
|
|
194
|
-
type: "COORD_INPUT_UPDATED",
|
|
195
|
-
payload: {
|
|
196
|
-
latLonInput: {
|
|
197
|
-
...latLonInput,
|
|
198
|
-
[`${label}`]: e.currentTarget.value,
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
});
|
|
202
|
-
},
|
|
203
|
-
doCoordZoomTo: () => ({ dispatch, store }) => {
|
|
204
|
-
const latLonInput = store.selectCoordsLatLonInput();
|
|
205
|
-
const displayProjection = store.selectDisplayProjection();
|
|
206
|
-
const x = Number(latLonInput.X);
|
|
207
|
-
const y = Number(latLonInput.Y);
|
|
208
|
-
|
|
209
|
-
if (isNaN(x) || isNaN(y)) {
|
|
210
|
-
dispatch({
|
|
211
|
-
type: "COORD_INPUT_INVALID",
|
|
212
|
-
payload: {
|
|
213
|
-
notification: {
|
|
214
|
-
title: "Coordinate Display",
|
|
215
|
-
message: "Enter valid number.",
|
|
216
|
-
level: "danger",
|
|
217
|
-
},
|
|
218
|
-
},
|
|
219
|
-
});
|
|
220
|
-
} else {
|
|
221
|
-
const center = transform([x, y], displayProjection, "EPSG:3857");
|
|
222
|
-
store.doRenderCoordsOverlay(center, { x, y });
|
|
223
|
-
store.doZoomToLocation(center, 13);
|
|
224
|
-
store.doBasicToolbarDeactivate();
|
|
225
|
-
}
|
|
226
|
-
},
|
|
227
|
-
selectCoordsValues: (state) => {
|
|
228
|
-
return state.coordinateDisplay.values;
|
|
229
|
-
},
|
|
230
|
-
selectCoordsOverlay: (state) => {
|
|
231
|
-
return state.coordinateDisplay.overlay;
|
|
232
|
-
},
|
|
233
|
-
selectCoordsContainer: (state) => {
|
|
234
|
-
return state.coordinateDisplay.container;
|
|
235
|
-
},
|
|
236
|
-
selectCoordsCopyActive: (state) => {
|
|
237
|
-
return state.coordinateDisplay.copyActive;
|
|
238
|
-
},
|
|
239
|
-
selectCoordsLatLonInput: (state) => {
|
|
240
|
-
return state.coordinateDisplay.latLonInput;
|
|
241
|
-
},
|
|
242
|
-
reactCoordinateDisplayShouldInitialize: (state) => {
|
|
243
|
-
if (state.coordinateDisplay._shouldInitialize)
|
|
244
|
-
return { actionCreator: "doCoordsInitialize" };
|
|
245
|
-
},
|
|
246
|
-
};
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { connect } from 'redux-bundler-react';
|
|
3
|
-
import { BasicToolbarButton, BasicToolbarMenu, BasicToolbarMenuItem, BasicToolbarMenuDivider, BasicToolbarSubmenu } from '../../application-controls';
|
|
4
|
-
import DrawToolItem from './draw-tool-item';
|
|
5
|
-
import classnames from 'classnames';
|
|
6
|
-
|
|
7
|
-
class DrawButton extends React.Component{
|
|
8
|
-
constructor(props){
|
|
9
|
-
super(props);
|
|
10
|
-
this.state = {
|
|
11
|
-
mode: null
|
|
12
|
-
}
|
|
13
|
-
this.updateMode = this.updateMode.bind(this);
|
|
14
|
-
this.handleDeactivate = this.handleDeactivate.bind(this);
|
|
15
|
-
this.removeInteractions = this.removeInteractions.bind(this);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
handleDeactivate(){
|
|
19
|
-
this.setState({
|
|
20
|
-
mode: null
|
|
21
|
-
}, this.removeInteractions)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
addInteractions(){
|
|
25
|
-
this.removeInteractions();
|
|
26
|
-
const {
|
|
27
|
-
doDrawPointsAddInteractions,
|
|
28
|
-
doDrawLinesAddInteractions,
|
|
29
|
-
doDrawPolygonsAddInteractions,
|
|
30
|
-
doDrawLabelsAddInteractions,
|
|
31
|
-
doDrawModifyAddInteractions
|
|
32
|
-
} = this.props;
|
|
33
|
-
const { mode } = this.state;
|
|
34
|
-
switch(mode){
|
|
35
|
-
case 'Point':
|
|
36
|
-
return doDrawPointsAddInteractions();
|
|
37
|
-
case 'LineString':
|
|
38
|
-
return doDrawLinesAddInteractions();
|
|
39
|
-
case 'Polygon':
|
|
40
|
-
return doDrawPolygonsAddInteractions();
|
|
41
|
-
case 'Labels':
|
|
42
|
-
return doDrawLabelsAddInteractions();
|
|
43
|
-
case 'Modify':
|
|
44
|
-
return doDrawModifyAddInteractions();
|
|
45
|
-
default:
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
removeInteractions(){
|
|
51
|
-
const {
|
|
52
|
-
doDrawPointsRemoveInteractions,
|
|
53
|
-
doDrawLinesRemoveInteractions,
|
|
54
|
-
doDrawPolygonsRemoveInteractions,
|
|
55
|
-
doDrawLabelsRemoveInteractions,
|
|
56
|
-
doDrawModifyRemoveInteractions
|
|
57
|
-
} = this.props;
|
|
58
|
-
doDrawPointsRemoveInteractions();
|
|
59
|
-
doDrawLinesRemoveInteractions();
|
|
60
|
-
doDrawPolygonsRemoveInteractions();
|
|
61
|
-
doDrawLabelsRemoveInteractions();
|
|
62
|
-
doDrawModifyRemoveInteractions();
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
updateMode(e){
|
|
66
|
-
const mode = e.currentTarget.dataset.mode;
|
|
67
|
-
this.setState({
|
|
68
|
-
mode: mode
|
|
69
|
-
}, this.addInteractions)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
render(){
|
|
73
|
-
const {
|
|
74
|
-
drawPointsVisible,
|
|
75
|
-
drawPointsActive,
|
|
76
|
-
doDrawPointsToggleVisible ,
|
|
77
|
-
|
|
78
|
-
drawLinesVisible,
|
|
79
|
-
drawLinesActive,
|
|
80
|
-
doDrawLinesToggleVisible ,
|
|
81
|
-
|
|
82
|
-
drawPolygonsVisible,
|
|
83
|
-
drawPolygonsActive,
|
|
84
|
-
doDrawPolygonsToggleVisible,
|
|
85
|
-
|
|
86
|
-
drawLabelsActive,
|
|
87
|
-
drawModifyActive,
|
|
88
|
-
|
|
89
|
-
doDrawSaveDownload
|
|
90
|
-
} = this.props;
|
|
91
|
-
return (
|
|
92
|
-
<BasicToolbarButton
|
|
93
|
-
enabled={true}
|
|
94
|
-
iconClass="mdi mdi-pencil"
|
|
95
|
-
title="Draw Tools"
|
|
96
|
-
onDeactivate={ this.handleDeactivate }
|
|
97
|
-
>
|
|
98
|
-
<BasicToolbarMenu>
|
|
99
|
-
<BasicToolbarMenuItem
|
|
100
|
-
active={ drawModifyActive }
|
|
101
|
-
iconClass="ms ms-draw icon-inline"
|
|
102
|
-
title="Modify Draw Features"
|
|
103
|
-
text="Modify Draw Features"
|
|
104
|
-
onClick={ this.updateMode }
|
|
105
|
-
passProps={{"data-mode": 'Modify'}}
|
|
106
|
-
/>
|
|
107
|
-
<BasicToolbarMenuItem
|
|
108
|
-
active={ drawLabelsActive }
|
|
109
|
-
iconClass="ms ms-label-o icon-inline"
|
|
110
|
-
title="Add / Edit Labels"
|
|
111
|
-
text="Add / Edit Labels"
|
|
112
|
-
onClick={ this.updateMode }
|
|
113
|
-
passProps={{"data-mode": 'Labels'}}
|
|
114
|
-
/>
|
|
115
|
-
<BasicToolbarMenuDivider />
|
|
116
|
-
<DrawToolItem
|
|
117
|
-
active={ drawPointsActive }
|
|
118
|
-
visible={ drawPointsVisible }
|
|
119
|
-
iconClass="ms ms-draw-point icon-inline"
|
|
120
|
-
title="Draw Points"
|
|
121
|
-
text="Draw Points"
|
|
122
|
-
onClick={ this.updateMode }
|
|
123
|
-
passProps={{"data-mode": 'Point'}}
|
|
124
|
-
onToggleVisibility={ doDrawPointsToggleVisible }
|
|
125
|
-
/>
|
|
126
|
-
<DrawToolItem
|
|
127
|
-
active={ drawLinesActive }
|
|
128
|
-
visible={ drawLinesVisible }
|
|
129
|
-
iconClass="ms ms-draw-line icon-inline"
|
|
130
|
-
title="Draw Lines"
|
|
131
|
-
text="Draw Lines"
|
|
132
|
-
onClick={ this.updateMode }
|
|
133
|
-
passProps={{"data-mode": 'LineString'}}
|
|
134
|
-
onToggleVisibility={ doDrawLinesToggleVisible }
|
|
135
|
-
/>
|
|
136
|
-
<DrawToolItem
|
|
137
|
-
active={ drawPolygonsActive }
|
|
138
|
-
visible={ drawPolygonsVisible }
|
|
139
|
-
iconClass="ms ms-draw-polygon icon-inline"
|
|
140
|
-
title="Draw Polygons"
|
|
141
|
-
text="Draw Polygons"
|
|
142
|
-
onClick={ this.updateMode }
|
|
143
|
-
passProps={{"data-mode": 'Polygon'}}
|
|
144
|
-
onToggleVisibility={ doDrawPolygonsToggleVisible }
|
|
145
|
-
/>
|
|
146
|
-
<BasicToolbarMenuDivider />
|
|
147
|
-
<BasicToolbarMenuItem
|
|
148
|
-
active={ false }
|
|
149
|
-
iconClass="mdi mdi-download icon-inline"
|
|
150
|
-
title="Download Draw Layers as GeoJSON"
|
|
151
|
-
text="Download Draw Layers"
|
|
152
|
-
onClick={ doDrawSaveDownload }
|
|
153
|
-
passProps={{}}
|
|
154
|
-
/>
|
|
155
|
-
</BasicToolbarMenu>
|
|
156
|
-
</BasicToolbarButton>
|
|
157
|
-
)
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export default connect(
|
|
162
|
-
'selectDrawPointsVisible',
|
|
163
|
-
'selectDrawPointsActive',
|
|
164
|
-
'doDrawPointsToggleVisible',
|
|
165
|
-
'doDrawPointsAddInteractions',
|
|
166
|
-
'doDrawPointsRemoveInteractions',
|
|
167
|
-
|
|
168
|
-
'selectDrawLinesVisible',
|
|
169
|
-
'selectDrawLinesActive',
|
|
170
|
-
'doDrawLinesToggleVisible',
|
|
171
|
-
'doDrawLinesAddInteractions',
|
|
172
|
-
'doDrawLinesRemoveInteractions',
|
|
173
|
-
|
|
174
|
-
'selectDrawPolygonsVisible',
|
|
175
|
-
'selectDrawPolygonsActive',
|
|
176
|
-
'doDrawPolygonsToggleVisible',
|
|
177
|
-
'doDrawPolygonsAddInteractions',
|
|
178
|
-
'doDrawPolygonsRemoveInteractions',
|
|
179
|
-
|
|
180
|
-
'selectDrawLabelsActive',
|
|
181
|
-
'doDrawLabelsAddInteractions',
|
|
182
|
-
'doDrawLabelsRemoveInteractions',
|
|
183
|
-
|
|
184
|
-
'selectDrawModifyActive',
|
|
185
|
-
'doDrawModifyAddInteractions',
|
|
186
|
-
'doDrawModifyRemoveInteractions',
|
|
187
|
-
|
|
188
|
-
'doDrawSave',
|
|
189
|
-
'doDrawSaveDownload',
|
|
190
|
-
|
|
191
|
-
DrawButton
|
|
192
|
-
);
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import buffer from "@turf/buffer";
|
|
2
|
-
import { point } from "@turf/helpers";
|
|
3
|
-
import { polygon } from "@turf/helpers";
|
|
4
|
-
import disjoint from "@turf/boolean-disjoint";
|
|
5
|
-
import { join } from "path";
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
name: "geojsonIdent",
|
|
9
|
-
|
|
10
|
-
getReducer() {
|
|
11
|
-
const initialData = {
|
|
12
|
-
shouldRegister: false,
|
|
13
|
-
shouldHandleRemove: false,
|
|
14
|
-
removedUid: null,
|
|
15
|
-
data: {},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
return (state = initialData, { type, payload }) => {
|
|
19
|
-
switch (type) {
|
|
20
|
-
case "GEOJSON_IDENT_REGISTERED":
|
|
21
|
-
case "GEOJSON_IDENT_ADDED_FEATURES":
|
|
22
|
-
case "GEOJSON_IDENT_REMOVED_FEATURES":
|
|
23
|
-
case "GEOJSON_IDENT_HANDLED_REMOVE":
|
|
24
|
-
return Object.assign({}, state, payload);
|
|
25
|
-
case "LAYER_REMOVED":
|
|
26
|
-
return Object.assign({}, state, {
|
|
27
|
-
removedUid: payload.uid,
|
|
28
|
-
shouldHandleRemove: true,
|
|
29
|
-
});
|
|
30
|
-
default:
|
|
31
|
-
return state;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
doGeojsonIdentRegister: () => ({ dispatch, store }) => {
|
|
37
|
-
dispatch({
|
|
38
|
-
type: "GEOJSON_IDENT_REGISTERED",
|
|
39
|
-
payload: { shouldRegister: false },
|
|
40
|
-
});
|
|
41
|
-
store.doIdentifyAddCollection({
|
|
42
|
-
onIdentify: store.doGeojsonIdentFire,
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
doGeojsonIdentRemoveFeatures: (uid) => ({ dispatch, store }) => {
|
|
47
|
-
dispatch({
|
|
48
|
-
type: "GEOJSON_IDENT_HANDLED_REMOVE",
|
|
49
|
-
payload: { shouldHandleRemove: false },
|
|
50
|
-
});
|
|
51
|
-
const uid = store.selectGeojsonRemovedUid();
|
|
52
|
-
const data = store.selectGeojsonIdentFeatures();
|
|
53
|
-
delete data[uid];
|
|
54
|
-
dispatch({
|
|
55
|
-
type: "GEOJSON_IDENT_REMOVED_FEATURES",
|
|
56
|
-
payload: { data: Object.assign({}, data), removedUid: null },
|
|
57
|
-
});
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
doGeojsonIdentAddFeatures: (uid, geojson, mapLayer) => ({
|
|
61
|
-
dispatch,
|
|
62
|
-
store,
|
|
63
|
-
}) => {
|
|
64
|
-
const data = store.selectGeojsonIdentFeatures();
|
|
65
|
-
|
|
66
|
-
if (!data[uid])
|
|
67
|
-
data[uid] = {
|
|
68
|
-
features: [],
|
|
69
|
-
maplayer: null,
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
if (geojson) {
|
|
73
|
-
let newFeatures = [];
|
|
74
|
-
if (geojson.length) {
|
|
75
|
-
newFeatures = geojson;
|
|
76
|
-
} else if (geojson.features) {
|
|
77
|
-
newFeatures = geojson.features;
|
|
78
|
-
} else {
|
|
79
|
-
newFeatures = [geojson];
|
|
80
|
-
}
|
|
81
|
-
data[uid].features = [...data[uid].features, ...newFeatures];
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (mapLayer) {
|
|
85
|
-
data[uid].mapLayer = mapLayer;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
dispatch({
|
|
89
|
-
type: "GEOJSON_IDENT_ADDED_FEATURES",
|
|
90
|
-
payload: { data: Object.assign({}, data) },
|
|
91
|
-
});
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
doGeojsonIdentFire: (callback) => ({ dispatch, store }) => {
|
|
95
|
-
const coords = store.selectIdentifyCoordinates();
|
|
96
|
-
const resolution = store.selectResolution();
|
|
97
|
-
const data = store.selectGeojsonIdentFeatures();
|
|
98
|
-
let identifyFeature = null;
|
|
99
|
-
|
|
100
|
-
if (typeof coords[0] === "number") {
|
|
101
|
-
const pt = point(coords);
|
|
102
|
-
const radius = (resolution * 5) / 1000;
|
|
103
|
-
identifyFeature = buffer(pt, radius, {
|
|
104
|
-
units: "kilometers",
|
|
105
|
-
});
|
|
106
|
-
} else {
|
|
107
|
-
identifyFeature = polygon(coords);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
try {
|
|
111
|
-
const out = [];
|
|
112
|
-
|
|
113
|
-
Object.keys(data).forEach((key) => {
|
|
114
|
-
const outFeatures = [];
|
|
115
|
-
const inFeatures = data[key].features;
|
|
116
|
-
const mapLayer = data[key].mapLayer;
|
|
117
|
-
if (mapLayer.getVisible()) {
|
|
118
|
-
inFeatures.forEach((feature) => {
|
|
119
|
-
if (!disjoint(identifyFeature, feature)) outFeatures.push(feature);
|
|
120
|
-
});
|
|
121
|
-
out.push({
|
|
122
|
-
dataset: key,
|
|
123
|
-
err: null,
|
|
124
|
-
result: {
|
|
125
|
-
[key]: {
|
|
126
|
-
type: "FeatureCollection",
|
|
127
|
-
features: outFeatures,
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
callback(null, out);
|
|
135
|
-
} catch (err) {
|
|
136
|
-
console.log(err);
|
|
137
|
-
callback(err);
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
selectGeojsonIdentFeatures: (state) => {
|
|
142
|
-
return state.geojsonIdent.data;
|
|
143
|
-
},
|
|
144
|
-
|
|
145
|
-
selectGeojsonRemovedUid: (state) => {
|
|
146
|
-
return state.geojsonIdent.removedUid;
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
reactGeojsonIdentShouldRegister: (state) => {
|
|
150
|
-
if (state.geojsonIdent.shouldRegister)
|
|
151
|
-
return { actionCreator: "doGeojsonIdentRegister" };
|
|
152
|
-
},
|
|
153
|
-
|
|
154
|
-
reactGeojsonIdentShouldHandleRemove: (state) => {
|
|
155
|
-
if (state.geojsonIdent.shouldHandleRemove)
|
|
156
|
-
return { actionCreator: "doGeojsonIdentRemoveFeatures" };
|
|
157
|
-
},
|
|
158
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { connect } from 'redux-bundler-react';
|
|
3
|
-
import { SidebarButton } from '../../application-controls/index';
|
|
4
|
-
import classnames from 'classnames';
|
|
5
|
-
|
|
6
|
-
class LoginButton extends React.Component {
|
|
7
|
-
constructor(props){
|
|
8
|
-
super(props);
|
|
9
|
-
this.handleClick = this.handleClick.bind(this);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
handleClick(){
|
|
13
|
-
const { doLogin, doLogout, isLoggedIn } = this.props;
|
|
14
|
-
if(isLoggedIn){
|
|
15
|
-
doLogout();
|
|
16
|
-
}else{
|
|
17
|
-
doLogin();
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
render() {
|
|
22
|
-
const { isLoggedIn } = this.props;
|
|
23
|
-
|
|
24
|
-
const btnClass = classnames({
|
|
25
|
-
'mdi': true,
|
|
26
|
-
'mdi-login-variant': !isLoggedIn,
|
|
27
|
-
'mdi-account-check': isLoggedIn
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
const title = isLoggedIn ? 'Log Out' : 'Log Into CorpsMap';
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<SidebarButton
|
|
34
|
-
iconClass={ btnClass }
|
|
35
|
-
label={title}
|
|
36
|
-
title={title}
|
|
37
|
-
onClick={ this.handleClick }
|
|
38
|
-
/>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export default connect(
|
|
44
|
-
'doLogin',
|
|
45
|
-
'doLogout',
|
|
46
|
-
'selectIsLoggedIn',
|
|
47
|
-
'selectTokenPayload',
|
|
48
|
-
LoginButton
|
|
49
|
-
);
|