@corpsmap/corpsmap 4.0.36 → 4.1.1
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 +63856 -0
- package/dist/corpsmap.umd.js +384 -0
- package/dist/vite.svg +1 -0
- package/package.json +74 -32
- package/src/App.css +42 -0
- package/src/application-bundles/_create-container-bundle.js +102 -0
- package/src/application-bundles/api-bundle.js +76 -0
- package/src/application-bundles/basic-toolbar-bundle.js +57 -0
- package/src/application-bundles/config-bundle.js +38 -0
- package/src/application-bundles/create-ol-map-bundle.jsx +278 -0
- package/src/application-bundles/export-bundle.js +125 -0
- package/src/application-bundles/identify-bundle.js +119 -0
- package/src/application-bundles/index.js +53 -0
- package/src/application-bundles/map-basemap-bundle.js +73 -0
- package/src/application-bundles/map-core-bundle.js +25 -0
- package/src/application-bundles/map-drawing-bundle.js +120 -0
- package/src/application-bundles/map-interaction-bundle.js +50 -0
- package/src/application-bundles/map-layers-bundle.js +816 -0
- package/src/application-bundles/map-proj-bundle.js +144 -0
- package/src/application-bundles/map-view-bundle.jsx +334 -0
- package/src/application-bundles/modal-window-bundle.js +5 -0
- package/src/application-bundles/notification-bundle.js +56 -0
- package/src/application-bundles/plugin-bundle.js +180 -0
- package/src/application-bundles/primary-panel-bundle.js +85 -0
- package/src/application-bundles/search-bundle.js +122 -0
- package/src/application-bundles/south-region-bundle.js +96 -0
- package/src/application-bundles/theme-bundle.js +45 -0
- package/src/application-bundles/vertical-layout-bundle.js +88 -0
- package/src/application-bundles/viewport-bundle.js +43 -0
- package/src/application-bundles/window-location-bundle.js +90 -0
- package/src/application-containers/basic-toolbar.jsx +24 -0
- package/src/application-containers/corpsmap.jsx +91 -0
- package/src/application-containers/left-sidebar.jsx +43 -0
- package/src/application-containers/lower-right-toolbar.jsx +29 -0
- package/src/application-containers/map.jsx +57 -0
- package/src/application-containers/modal-window.jsx +34 -0
- package/src/application-containers/north-region.jsx +26 -0
- package/src/application-containers/notification-pane.jsx +37 -0
- package/src/application-containers/notification-quadrant.jsx +20 -0
- package/src/application-containers/notification.jsx +91 -0
- package/src/application-containers/primary-panel.jsx +94 -0
- package/src/application-containers/right-sidebar.jsx +44 -0
- package/src/application-containers/south-region-tab.jsx +60 -0
- 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.jsx +124 -0
- package/src/application-controls/basic-toolbar-menu-divider.jsx +11 -0
- package/src/application-controls/basic-toolbar-menu-item.jsx +91 -0
- package/src/application-controls/basic-toolbar-menu-up.jsx +13 -0
- package/src/application-controls/basic-toolbar-menu.jsx +13 -0
- package/src/application-controls/basic-toolbar-submenu.jsx +14 -0
- package/src/application-controls/index.jsx +35 -0
- package/src/application-controls/loading-indicator.jsx +19 -0
- package/src/application-controls/search-input.jsx +55 -0
- package/src/application-controls/search-results-list-item.jsx +50 -0
- package/src/application-controls/search-results-list.jsx +19 -0
- package/src/application-controls/sidebar-button.jsx +69 -0
- package/src/application-controls/sidebar-panel-opener.jsx +63 -0
- package/src/application-controls/tree-list-folder.jsx +46 -0
- package/src/application-controls/tree-list-item.jsx +83 -0
- package/src/application-controls/tree-list.jsx +35 -0
- package/src/application-controls/tree-view.jsx +42 -0
- package/src/application-exports/map-provider.jsx +122 -0
- package/src/assets/react.svg +1 -0
- package/src/config/default-config.js +593 -0
- package/src/core-plugins/add-data/add-data-button.jsx +34 -0
- package/src/core-plugins/add-data/add-geojson.jsx +47 -0
- package/src/core-plugins/add-data/add-kmlfile.jsx +46 -0
- package/src/core-plugins/add-data/add-shapefile.jsx +47 -0
- package/src/core-plugins/add-data/bundle.js +226 -0
- package/src/core-plugins/add-data/index.js +15 -0
- package/src/core-plugins/basemap-switcher/basemap-switcher-button.jsx +18 -0
- package/src/core-plugins/basemap-switcher/basemap-switcher-list-item.jsx +48 -0
- package/src/core-plugins/basemap-switcher/basemap-switcher-list.jsx +37 -0
- package/src/core-plugins/basemap-switcher/index.js +13 -0
- package/src/core-plugins/bookmarks/bookmark-button.jsx +18 -0
- package/src/core-plugins/bookmarks/bookmark-list-item.jsx +79 -0
- package/src/core-plugins/bookmarks/bookmark-list.jsx +31 -0
- package/src/core-plugins/bookmarks/bookmark-panel.jsx +191 -0
- package/src/core-plugins/bookmarks/bundle.js +92 -0
- package/src/core-plugins/bookmarks/index.js +15 -0
- package/src/core-plugins/catalog/bundle.js +109 -0
- package/src/core-plugins/catalog/catalog-button.jsx +33 -0
- package/src/core-plugins/catalog/catalog-error-item.jsx +14 -0
- package/src/core-plugins/catalog/catalog-list-item-loader.jsx +12 -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.jsx +100 -0
- package/src/core-plugins/catalog/index.js +15 -0
- package/src/core-plugins/change-log/bundle.js +180 -0
- package/src/core-plugins/change-log/change-log-button.jsx +40 -0
- package/src/core-plugins/change-log/change-log-modal.jsx +190 -0
- package/src/core-plugins/change-log/index.js +15 -0
- package/src/core-plugins/change-log/select-district.jsx +73 -0
- package/src/core-plugins/contact-form/bundle.js +239 -0
- package/src/core-plugins/contact-form/index.js +17 -0
- package/src/core-plugins/contact-form/question-button.jsx +36 -0
- package/src/core-plugins/contact-form/question-modal.jsx +215 -0
- package/src/core-plugins/coordinate-display/bundle.jsx +269 -0
- package/src/core-plugins/coordinate-display/coordinate-display-bar.jsx +66 -0
- package/src/core-plugins/coordinate-display/coordinate-display-proj-item.jsx +60 -0
- package/src/core-plugins/coordinate-display/coordinate-display-settings.jsx +173 -0
- package/src/core-plugins/coordinate-display/coordinate-interaction-bar.jsx +60 -0
- package/src/core-plugins/coordinate-display/coordinate-lat-lon-input.jsx +35 -0
- package/src/core-plugins/coordinate-display/coordinate-popup.jsx +27 -0
- package/src/core-plugins/coordinate-display/index.js +20 -0
- package/src/core-plugins/draw-tools/create-draw-bundle.js +242 -0
- package/src/core-plugins/draw-tools/draw-button.jsx +204 -0
- package/src/core-plugins/draw-tools/draw-label-bundle.js +116 -0
- package/src/core-plugins/draw-tools/draw-modify-bundle.js +156 -0
- package/src/core-plugins/draw-tools/draw-save-bundle.jsx +181 -0
- package/src/core-plugins/draw-tools/draw-styles.js +110 -0
- package/src/core-plugins/draw-tools/draw-tool-item.jsx +67 -0
- package/src/core-plugins/draw-tools/index.js +34 -0
- package/src/core-plugins/editor/bundle.js +472 -0
- package/src/core-plugins/editor/date-editor.js +63 -0
- package/src/core-plugins/editor/date-formatter.js +17 -0
- package/src/core-plugins/editor/editor-base.js +29 -0
- package/src/core-plugins/editor/editor-button.js +224 -0
- package/src/core-plugins/editor/editor-table.js +151 -0
- package/src/core-plugins/editor/index.js +15 -0
- package/src/core-plugins/editor/number-editor.js +57 -0
- package/src/core-plugins/editor/string-editor.js +42 -0
- package/src/core-plugins/geocoder/bundle.jsx +186 -0
- package/src/core-plugins/geocoder/index.js +15 -0
- package/src/core-plugins/geocoder/overlay.jsx +30 -0
- package/src/core-plugins/geocoder/search-bar.js copy.save +123 -0
- package/src/core-plugins/geocoder/search-bar.jsx +121 -0
- package/src/core-plugins/identify/bundle.jsx +709 -0
- package/src/core-plugins/identify/identify-buffer-section.jsx +52 -0
- package/src/core-plugins/identify/identify-buffer-settings.jsx +48 -0
- package/src/core-plugins/identify/identify-button.jsx +100 -0
- package/src/core-plugins/identify/identify-details-table.jsx +121 -0
- package/src/core-plugins/identify/identify-details.js +69 -0
- package/src/core-plugins/identify/identify-popup.jsx +136 -0
- package/src/core-plugins/identify/identify-sidebar-list-item.jsx +106 -0
- package/src/core-plugins/identify/identify-sidebar-list.jsx +63 -0
- package/src/core-plugins/identify/identify-sidebar.jsx +103 -0
- package/src/core-plugins/identify/identify-table-cell.jsx +49 -0
- package/src/core-plugins/identify/identify-table.jsx +319 -0
- package/src/core-plugins/identify/index.js +27 -0
- package/src/core-plugins/identify/listeners/arcgis.js +158 -0
- package/src/core-plugins/identify/listeners/geojson.jsx +164 -0
- package/src/core-plugins/identify/listeners/raster.js +89 -0
- package/src/core-plugins/identify/listeners/vector.jsx +106 -0
- package/src/core-plugins/identify-arcgis-rest/bundle.js +169 -0
- package/src/core-plugins/identify-arcgis-rest/index.js +10 -0
- package/src/core-plugins/identify-cm/bundle.js +82 -0
- package/src/core-plugins/identify-cm/index.js +10 -0
- package/src/core-plugins/identify-geojson/bundle.js +164 -0
- package/src/core-plugins/identify-geojson/index.js +10 -0
- package/src/core-plugins/identify-raster/bundle.js +89 -0
- package/src/core-plugins/identify-raster/index.js +10 -0
- package/src/core-plugins/identify-vector/bundle.jsx +135 -0
- package/src/core-plugins/identify-vector/index.js +10 -0
- package/src/core-plugins/identify-wms/bundle.js +138 -0
- package/src/core-plugins/identify-wms/index.js +10 -0
- package/src/core-plugins/legend/bundle.js +1044 -0
- package/src/core-plugins/legend/index.js +17 -0
- package/src/core-plugins/legend/legend-button.jsx +18 -0
- package/src/core-plugins/legend/legend-header.jsx +43 -0
- package/src/core-plugins/legend/legend-item-multiple.jsx +32 -0
- package/src/core-plugins/legend/legend-item.jsx +20 -0
- package/src/core-plugins/legend/legend-panel.jsx +73 -0
- package/src/core-plugins/login/index.js +13 -0
- package/src/core-plugins/login/login-button.jsx +49 -0
- package/src/core-plugins/map-loading-indicator/bundle.js +31 -0
- package/src/core-plugins/map-loading-indicator/index.js +17 -0
- package/src/core-plugins/map-loading-indicator/loading-indicator.jsx +30 -0
- package/src/core-plugins/measure-tools/bundle.js +286 -0
- package/src/core-plugins/measure-tools/index.js +15 -0
- package/src/core-plugins/measure-tools/measure-options.jsx +89 -0
- package/src/core-plugins/measure-tools/measure-tools-button.jsx +129 -0
- package/src/core-plugins/measure-tools/measure-utils.js +76 -0
- package/src/core-plugins/permalink/bundle.js +57 -0
- package/src/core-plugins/permalink/index.js +15 -0
- package/src/core-plugins/permalink/permalink-button.jsx +38 -0
- package/src/core-plugins/permalink/permalink-modal.jsx +67 -0
- package/src/core-plugins/print-map/bundle.jsx +316 -0
- package/src/core-plugins/print-map/button.jsx +17 -0
- package/src/core-plugins/print-map/index.js +17 -0
- package/src/core-plugins/resources/bundle.js +96 -0
- package/src/core-plugins/resources/index.js +15 -0
- package/src/core-plugins/resources/resources-button.jsx +40 -0
- package/src/core-plugins/resources/resources-modal.jsx +151 -0
- package/src/core-plugins/rotate-north/index.js +13 -0
- package/src/core-plugins/rotate-north/rotate-north-button.jsx +38 -0
- package/src/core-plugins/theme-switcher/bundle.js +16 -0
- package/src/core-plugins/theme-switcher/index.js +15 -0
- package/src/core-plugins/theme-switcher/theme-list-item.jsx +25 -0
- package/src/core-plugins/theme-switcher/theme-list.jsx +28 -0
- package/src/core-plugins/theme-switcher/theme-switcher-button.jsx +18 -0
- package/src/core-plugins/theme-switcher/themes.js +121 -0
- package/src/core-plugins/three-d/index.js +13 -0
- package/src/core-plugins/three-d/three-d-button.jsx +44 -0
- package/src/core-plugins/tree-view/boundary-drop-target.jsx +42 -0
- package/src/core-plugins/tree-view/bundle.js +513 -0
- package/src/core-plugins/tree-view/dataset-info-modal.jsx +141 -0
- package/src/core-plugins/tree-view/dataset-legend.jsx +122 -0
- package/src/core-plugins/tree-view/defaults-container.jsx +27 -0
- package/src/core-plugins/tree-view/download-bundle.js +156 -0
- package/src/core-plugins/tree-view/favorites-container.jsx +27 -0
- package/src/core-plugins/tree-view/index.js +25 -0
- package/src/core-plugins/tree-view/layer-subpanel/defaults-toggle.jsx +28 -0
- package/src/core-plugins/tree-view/layer-subpanel/download-layer.jsx +54 -0
- package/src/core-plugins/tree-view/layer-subpanel/favorites-toggle.jsx +28 -0
- package/src/core-plugins/tree-view/layer-subpanel/label-toggle.jsx +39 -0
- package/src/core-plugins/tree-view/layer-subpanel/layer-subpanel.jsx +179 -0
- package/src/core-plugins/tree-view/layer-subpanel/natick-rgb-options.jsx +66 -0
- package/src/core-plugins/tree-view/layer-subpanel/natick-rgb.jsx +112 -0
- package/src/core-plugins/tree-view/layer-subpanel/opacity-slider.jsx +51 -0
- package/src/core-plugins/tree-view/layer-subpanel/remove-layer.jsx +75 -0
- package/src/core-plugins/tree-view/tree-list-container.jsx +22 -0
- package/src/core-plugins/tree-view/tree-list-item-dataset.jsx +174 -0
- package/src/core-plugins/tree-view/tree-list-item-folder.jsx +161 -0
- package/src/core-plugins/tree-view/tree-list-item.jsx +35 -0
- package/src/core-plugins/tree-view/tree-list.jsx +37 -0
- package/src/core-plugins/tree-view/tree-view-button.jsx +18 -0
- package/src/core-plugins/tree-view/tree-view-panel.jsx +139 -0
- package/src/core-plugins/tree-view/tree-view-toolbar/add-all.jsx +28 -0
- package/src/core-plugins/tree-view/tree-view-toolbar/defaults.jsx +40 -0
- package/src/core-plugins/tree-view/tree-view-toolbar/favorites.jsx +40 -0
- package/src/core-plugins/tree-view/tree-view-toolbar/remove-all.jsx +28 -0
- package/src/core-plugins/tree-view/tree-view-toolbar/toggle-expand.jsx +47 -0
- package/src/core-plugins/tree-view/tree-view-toolbar/toggle-filter.jsx +39 -0
- package/src/core-plugins/vector-search/bundle.js +96 -0
- package/src/core-plugins/vector-search/index.js +10 -0
- package/src/core-plugins/zoom-home/bundle.js +77 -0
- package/src/core-plugins/zoom-home/index.js +19 -0
- package/src/core-plugins/zoom-home/zoom-home-button.jsx +57 -0
- package/src/core-plugins/zoom-in-out/index.js +23 -0
- package/src/core-plugins/zoom-in-out/zoom-in-button.jsx +28 -0
- package/src/core-plugins/zoom-in-out/zoom-out-button.jsx +28 -0
- package/src/core-plugins/zoom-level/bundle.js +35 -0
- package/src/core-plugins/zoom-level/index.js +17 -0
- package/src/core-plugins/zoom-level/zoom-indicator.jsx +34 -0
- package/src/core-plugins/zoom-to-box/bundle.js +80 -0
- package/src/core-plugins/zoom-to-box/index.jsx +15 -0
- package/src/core-plugins/zoom-to-box/zoom-to-box-button.jsx +53 -0
- package/src/css/_deprecated_maki/css/maki.css +304 -0
- package/src/css/_deprecated_maki/fonts/maki.eot +0 -0
- package/src/css/_deprecated_maki/fonts/maki.svg +98 -0
- package/src/css/_deprecated_maki/fonts/maki.ttf +0 -0
- package/src/css/_deprecated_maki/fonts/maki.woff +0 -0
- package/src/css/bg-colors.css +121 -0
- package/src/css/cm-icons/css/cm-icons.css +90 -0
- package/src/css/cm-icons/fonts/cm.eot +0 -0
- package/src/css/cm-icons/fonts/cm.svg +27 -0
- package/src/css/cm-icons/fonts/cm.ttf +0 -0
- package/src/css/cm-icons/fonts/cm.woff +0 -0
- package/src/css/corpsmap-namespaced.css +9505 -0
- package/src/css/corpsmap.css +10178 -0
- package/src/css/loading-indicator.css +109 -0
- package/src/css/mapskin/OFL.txt +94 -0
- package/src/css/mapskin/css/mapskin.css +815 -0
- package/src/css/mapskin/css/mapskin.min.css +8 -0
- package/src/css/mapskin/fonts/mapskin.eot +0 -0
- package/src/css/mapskin/fonts/mapskin.svg +282 -0
- package/src/css/mapskin/fonts/mapskin.ttf +0 -0
- package/src/css/mapskin/fonts/mapskin.woff +0 -0
- package/src/css/mdi/.github/ISSUE_TEMPLATE.md +3 -0
- package/src/css/mdi/README.md +24 -0
- package/src/css/mdi/bower.json +22 -0
- package/src/css/mdi/css/materialdesignicons.css +18654 -0
- package/src/css/mdi/css/materialdesignicons.css.map +16 -0
- package/src/css/mdi/css/materialdesignicons.min.css +3 -0
- package/src/css/mdi/css/materialdesignicons.min.css.map +16 -0
- package/src/css/mdi/fonts/materialdesignicons-webfont.eot +0 -0
- package/src/css/mdi/fonts/materialdesignicons-webfont.ttf +0 -0
- package/src/css/mdi/fonts/materialdesignicons-webfont.woff +0 -0
- package/src/css/mdi/fonts/materialdesignicons-webfont.woff2 +0 -0
- package/src/css/mdi/license.md +97 -0
- package/src/css/mdi/package.json +37 -0
- package/src/css/mdi/preview.html +717 -0
- package/src/css/mdi/scss/_animated.scss +27 -0
- package/src/css/mdi/scss/_core.scss +10 -0
- package/src/css/mdi/scss/_extras.scss +65 -0
- package/src/css/mdi/scss/_functions.scss +20 -0
- package/src/css/mdi/scss/_icons.scss +10 -0
- package/src/css/mdi/scss/_path.scss +10 -0
- package/src/css/mdi/scss/_variables.scss +4606 -0
- package/src/css/mdi/scss/materialdesignicons.scss +8 -0
- package/src/css/navigation.css +174 -0
- package/src/css/parse-css.js +26 -0
- package/src/css/reset.css +48 -0
- package/src/index.css +68 -0
- package/src/index.jsx +113 -0
- package/src/main.jsx +3 -0
- package/src/openlayers-utils/format-utilities.js +178 -0
- package/src/openlayers-utils/interaction-creator.js +31 -0
- package/src/openlayers-utils/layer-utilities.js +309 -0
- package/src/openlayers-utils/map-utils.js +25 -0
- package/src/openlayers-utils/resource-utilities.js +38 -0
- package/src/openlayers-utils/vector-style.js +131 -0
- package/src/utils/cache.js +6 -0
- package/src/utils/check-webgl.js +6 -0
- package/src/utils/error-boundary.js +26 -0
- package/src/utils/load-plugins.js +32 -0
- package/src/utils/load-plugins.test.js +36 -0
- package/src/utils/plugin-region.jsx +26 -0
- package/src/utils/redux-bundler-react.jsx +69 -0
- package/src/utils/scale-to-zoom-level.js +37 -0
- package/src/utils/vector-styles.js +7 -0
- package/.babelrc +0 -7
- package/config/basemaps.js +0 -22
- package/css/corpsmap.css +0 -7982
- package/index.js +0 -5
- package/lib/dev.js +0 -41440
- package/lib/prod.js +0 -41406
- package/rollup.config.js +0 -30
- package/src/bundles/DEPRECATE_map-view-bundle.js +0 -34
- package/src/bundles/_template-bundle-creator.js +0 -49
- package/src/bundles/create-basemap-bundle-old.js +0 -107
- package/src/bundles/create-basemap-bundle.js +0 -133
- package/src/bundles/create-ol-map-bundle.js +0 -166
- package/src/bundles/create-ol-view-bundle.js +0 -79
- package/src/bundles/map-basemap-bundle.js +0 -42
- package/src/bundles/map-bundle.js +0 -90
- package/src/bundles/map-interaction-bundle.js +0 -57
- package/src/bundles/map-measure-bundle.js +0 -61
- package/src/components/BasemapSwitcherLight/BasemapMenu.js +0 -26
- package/src/components/BasemapSwitcherLight/BasemapMenuItem.js +0 -31
- package/src/components/BasemapSwitcherLight/index.js +0 -25
- package/src/components/Control-Regions/BtnContainer.js +0 -20
- package/src/components/Control-Regions/Right.js +0 -30
- package/src/components/Control-Regions/Top.js +0 -19
- package/src/components/Control-Regions/index.js +0 -4
- package/src/components/LayerTree/index.js +0 -10
- package/src/components/Map.js +0 -56
- package/src/components/MeasureTool/Content.js +0 -53
- package/src/components/MeasureTool/index.js +0 -169
- package/src/components/MeasureTool/measure-utils.js +0 -69
- package/src/components/Zoom/index.js +0 -48
- package/src/components/index.js +0 -3
- package/src/index.js +0 -10
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import ReactDOM from "react-dom/client";
|
|
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:
|
|
48
|
+
() =>
|
|
49
|
+
({ dispatch, store }) => {
|
|
50
|
+
dispatch({
|
|
51
|
+
type: "COORD_INITIALIZE_START",
|
|
52
|
+
payload: {
|
|
53
|
+
_shouldInitialize: false,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const map = store.selectMap();
|
|
58
|
+
map.on("pointermove", throttle(store.doCoordsPointerMove, 200));
|
|
59
|
+
|
|
60
|
+
dispatch({
|
|
61
|
+
type: "COORD_INITIALIZE_FINISH",
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
doCoordsPointerMove:
|
|
65
|
+
(e) =>
|
|
66
|
+
({ dispatch, store }) => {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
e.stopPropagation();
|
|
69
|
+
|
|
70
|
+
const displayProjection = store.selectDisplayProjection();
|
|
71
|
+
const coord = e.coordinate;
|
|
72
|
+
const projected = transform(coord, "EPSG:3857", displayProjection);
|
|
73
|
+
const X = Math.round(projected[0] * 10000) / 10000;
|
|
74
|
+
const Y = Math.round(projected[1] * 10000) / 10000;
|
|
75
|
+
|
|
76
|
+
dispatch({
|
|
77
|
+
type: "COORD_POSITION_UPDATE",
|
|
78
|
+
payload: {
|
|
79
|
+
values: { X, Y },
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
doRenderCoordsOverlay:
|
|
84
|
+
(center, coords) =>
|
|
85
|
+
({ dispatch, store }) => {
|
|
86
|
+
const map = store.selectMap();
|
|
87
|
+
const hasCoordsOverlay = store.selectCoordsOverlay();
|
|
88
|
+
|
|
89
|
+
if (hasCoordsOverlay) {
|
|
90
|
+
store.doClearCoordOverlay(hasCoordsOverlay);
|
|
91
|
+
}
|
|
92
|
+
//generate overlay
|
|
93
|
+
const el = document.createElement("div");
|
|
94
|
+
const overlay = new Overlay({
|
|
95
|
+
element: el,
|
|
96
|
+
positioning: "bottom-center",
|
|
97
|
+
offset: [0, -10],
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
//add overlay to map
|
|
101
|
+
map.addOverlay(overlay);
|
|
102
|
+
ReactDOM.render(
|
|
103
|
+
<Popup
|
|
104
|
+
overlay={overlay}
|
|
105
|
+
coords={coords}
|
|
106
|
+
map={map}
|
|
107
|
+
onClear={store.doClearPopup}
|
|
108
|
+
/>,
|
|
109
|
+
el
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
overlay.setPosition(center);
|
|
113
|
+
dispatch({
|
|
114
|
+
type: "COORD_OVERLAY_RENDERED",
|
|
115
|
+
payload: { overlay: overlay },
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
doClearPopup:
|
|
119
|
+
(e, overlay) =>
|
|
120
|
+
({ store }) => {
|
|
121
|
+
console.log(e);
|
|
122
|
+
e.preventDefault();
|
|
123
|
+
e.stopPropagation();
|
|
124
|
+
store.doClearCoordOverlay(overlay);
|
|
125
|
+
},
|
|
126
|
+
doClearCoordOverlay:
|
|
127
|
+
(overlay) =>
|
|
128
|
+
({ dispatch, store }) => {
|
|
129
|
+
const map = store.selectMap();
|
|
130
|
+
overlay.setPosition(undefined);
|
|
131
|
+
const el = overlay.getElement();
|
|
132
|
+
el.parentNode.removeChild(el);
|
|
133
|
+
map.removeOverlay(overlay);
|
|
134
|
+
dispatch({ type: "COORD_OVERLAY_REMOVED", payload: { overlay: null } });
|
|
135
|
+
},
|
|
136
|
+
doStartCoordCopy:
|
|
137
|
+
() =>
|
|
138
|
+
({ dispatch, store }) => {
|
|
139
|
+
const map = store.selectMap();
|
|
140
|
+
store.doSetCursor("crosshair");
|
|
141
|
+
|
|
142
|
+
//Parent container for coord copy.
|
|
143
|
+
const container = document.createElement("div");
|
|
144
|
+
container.id = "cm-copy-coords";
|
|
145
|
+
document.body.appendChild(container);
|
|
146
|
+
|
|
147
|
+
dispatch({
|
|
148
|
+
type: "COORD_COPY_ACTIVE",
|
|
149
|
+
payload: {
|
|
150
|
+
copyActive: true,
|
|
151
|
+
container: container,
|
|
152
|
+
notification: {
|
|
153
|
+
message: "Click on map to copy coordinates.",
|
|
154
|
+
level: "info",
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
//listen once for click event
|
|
160
|
+
map.once("singleclick", store.doCoordCopy);
|
|
161
|
+
},
|
|
162
|
+
doCoordCopy:
|
|
163
|
+
(e) =>
|
|
164
|
+
({ dispatch, store }) => {
|
|
165
|
+
e.preventDefault();
|
|
166
|
+
e.stopPropagation();
|
|
167
|
+
|
|
168
|
+
const copyContainer = store.selectCoordsContainer();
|
|
169
|
+
const displayProjection = store.selectDisplayProjection();
|
|
170
|
+
const coord = e.coordinate;
|
|
171
|
+
const projected = transform(coord, "EPSG:3857", displayProjection);
|
|
172
|
+
const x = Math.round(projected[0] * 10000) / 10000;
|
|
173
|
+
const y = Math.round(projected[1] * 10000) / 10000;
|
|
174
|
+
|
|
175
|
+
//Add temp input node to use execCommand.
|
|
176
|
+
const valueEl = document.createElement("input");
|
|
177
|
+
copyContainer.appendChild(valueEl);
|
|
178
|
+
valueEl.value = `${x}, ${y}`;
|
|
179
|
+
valueEl.select();
|
|
180
|
+
document.execCommand("copy");
|
|
181
|
+
|
|
182
|
+
store.doStopCoordCopy(x, y);
|
|
183
|
+
},
|
|
184
|
+
doStopCoordCopy:
|
|
185
|
+
(x, y) =>
|
|
186
|
+
({ dispatch, store }) => {
|
|
187
|
+
const copyContainer = store.selectCoordsContainer();
|
|
188
|
+
const msg = `Copied ${x}, ${y} to the clipboard.`;
|
|
189
|
+
store.doSetCursor("default");
|
|
190
|
+
|
|
191
|
+
dispatch({
|
|
192
|
+
type: "COORD_COPIED",
|
|
193
|
+
payload: {
|
|
194
|
+
copyActive: false,
|
|
195
|
+
container: null,
|
|
196
|
+
notification: {
|
|
197
|
+
title: "Coordinate Display",
|
|
198
|
+
message: msg,
|
|
199
|
+
level: "info",
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
copyContainer.remove(); //remove dynamically created node.
|
|
205
|
+
store.doBasicToolbarDeactivate(); //close tool after copy.
|
|
206
|
+
},
|
|
207
|
+
doUpdateCoordInput:
|
|
208
|
+
(e, label) =>
|
|
209
|
+
({ dispatch, store }) => {
|
|
210
|
+
e.preventDefault();
|
|
211
|
+
e.stopPropagation();
|
|
212
|
+
const latLonInput = store.selectCoordsLatLonInput();
|
|
213
|
+
|
|
214
|
+
dispatch({
|
|
215
|
+
type: "COORD_INPUT_UPDATED",
|
|
216
|
+
payload: {
|
|
217
|
+
latLonInput: {
|
|
218
|
+
...latLonInput,
|
|
219
|
+
[`${label}`]: e.currentTarget.value,
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
});
|
|
223
|
+
},
|
|
224
|
+
doCoordZoomTo:
|
|
225
|
+
() =>
|
|
226
|
+
({ dispatch, store }) => {
|
|
227
|
+
const latLonInput = store.selectCoordsLatLonInput();
|
|
228
|
+
const displayProjection = store.selectDisplayProjection();
|
|
229
|
+
const x = Number(latLonInput.X);
|
|
230
|
+
const y = Number(latLonInput.Y);
|
|
231
|
+
|
|
232
|
+
if (isNaN(x) || isNaN(y)) {
|
|
233
|
+
dispatch({
|
|
234
|
+
type: "COORD_INPUT_INVALID",
|
|
235
|
+
payload: {
|
|
236
|
+
notification: {
|
|
237
|
+
title: "Coordinate Display",
|
|
238
|
+
message: "Enter valid number.",
|
|
239
|
+
level: "danger",
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
});
|
|
243
|
+
} else {
|
|
244
|
+
const center = transform([x, y], displayProjection, "EPSG:3857");
|
|
245
|
+
store.doRenderCoordsOverlay(center, { x, y });
|
|
246
|
+
store.doZoomToLocation(center, 13);
|
|
247
|
+
store.doBasicToolbarDeactivate();
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
selectCoordsValues: (state) => {
|
|
251
|
+
return state.coordinateDisplay.values;
|
|
252
|
+
},
|
|
253
|
+
selectCoordsOverlay: (state) => {
|
|
254
|
+
return state.coordinateDisplay.overlay;
|
|
255
|
+
},
|
|
256
|
+
selectCoordsContainer: (state) => {
|
|
257
|
+
return state.coordinateDisplay.container;
|
|
258
|
+
},
|
|
259
|
+
selectCoordsCopyActive: (state) => {
|
|
260
|
+
return state.coordinateDisplay.copyActive;
|
|
261
|
+
},
|
|
262
|
+
selectCoordsLatLonInput: (state) => {
|
|
263
|
+
return state.coordinateDisplay.latLonInput;
|
|
264
|
+
},
|
|
265
|
+
reactCoordinateDisplayShouldInitialize: (state) => {
|
|
266
|
+
if (state.coordinateDisplay._shouldInitialize)
|
|
267
|
+
return { actionCreator: "doCoordsInitialize" };
|
|
268
|
+
},
|
|
269
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { connect } from "../../utils/redux-bundler-react";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
BasicToolbarButton,
|
|
6
|
+
BasicToolbarMenuUp,
|
|
7
|
+
BasicToolbarMenuItem,
|
|
8
|
+
} from "../../application-controls";
|
|
9
|
+
import CoordinateLatLonInput from "./coordinate-lat-lon-input";
|
|
10
|
+
|
|
11
|
+
const CoordinateDisplay = (props) => {
|
|
12
|
+
const {
|
|
13
|
+
doStartCoordCopy,
|
|
14
|
+
coordsCopyActive,
|
|
15
|
+
coordsLatLonInput,
|
|
16
|
+
doCoordZoomTo,
|
|
17
|
+
coordsValues,
|
|
18
|
+
} = props;
|
|
19
|
+
|
|
20
|
+
const goToDisabled =
|
|
21
|
+
coordsLatLonInput.X.length > 0 && coordsLatLonInput.Y.length > 0
|
|
22
|
+
? false
|
|
23
|
+
: true;
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<BasicToolbarButton
|
|
27
|
+
enabled={true}
|
|
28
|
+
dropup={true}
|
|
29
|
+
iconClass=""
|
|
30
|
+
title="Coordinate Display"
|
|
31
|
+
text={`${coordsValues.X}, ${coordsValues.Y}`}
|
|
32
|
+
passProps={{ style: { minWidth: 180 } }}
|
|
33
|
+
>
|
|
34
|
+
<BasicToolbarMenuUp>
|
|
35
|
+
<BasicToolbarMenuItem
|
|
36
|
+
active={false}
|
|
37
|
+
iconClass="mdi mdi-content-copy icon-inline"
|
|
38
|
+
title="Copy Coordinate to Clipboard"
|
|
39
|
+
text="Copy Coordinate to Clipboard"
|
|
40
|
+
onClick={doStartCoordCopy}
|
|
41
|
+
disabled={coordsCopyActive}
|
|
42
|
+
passProps={{}}
|
|
43
|
+
/>
|
|
44
|
+
<CoordinateLatLonInput label="X" placeholder="Enter Longitude.." />
|
|
45
|
+
<CoordinateLatLonInput label="Y" placeholder="Enter Latitude.." />
|
|
46
|
+
<BasicToolbarMenuItem
|
|
47
|
+
active={false}
|
|
48
|
+
iconClass="mdi mdi-map-marker-radius icon-inline"
|
|
49
|
+
title="Go to Coordinate"
|
|
50
|
+
text="Go to Coordinate"
|
|
51
|
+
onClick={doCoordZoomTo}
|
|
52
|
+
passProps={{}}
|
|
53
|
+
disabled={goToDisabled}
|
|
54
|
+
/>
|
|
55
|
+
</BasicToolbarMenuUp>
|
|
56
|
+
</BasicToolbarButton>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
export default connect(
|
|
60
|
+
"doStartCoordCopy",
|
|
61
|
+
"doCoordZoomTo",
|
|
62
|
+
"selectCoordsCopyActive",
|
|
63
|
+
"selectCoordsLatLonInput",
|
|
64
|
+
"selectCoordsValues",
|
|
65
|
+
CoordinateDisplay
|
|
66
|
+
);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
class CoordinateDisplayProjItem extends React.Component {
|
|
4
|
+
constructor(props) {
|
|
5
|
+
super(props);
|
|
6
|
+
this.onSelect = this.onSelect.bind(this);
|
|
7
|
+
this.onRemove = this.onRemove.bind(this);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
onSelect() {
|
|
11
|
+
const { proj, onSelect } = this.props;
|
|
12
|
+
onSelect(proj.epsg, proj.name);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
onRemove() {
|
|
16
|
+
const { proj, onRemove } = this.props;
|
|
17
|
+
onRemove(proj.epsg);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
render() {
|
|
21
|
+
const { proj, epsg, i } = this.props;
|
|
22
|
+
const link = "https://epsg.io/" + proj.epsg.split(":")[1];
|
|
23
|
+
return (
|
|
24
|
+
<li className="cm-list-group-item clearfix">
|
|
25
|
+
<div className="col-md-6">
|
|
26
|
+
<div style={{ margin: 0 }} className="radio">
|
|
27
|
+
<label>
|
|
28
|
+
<input
|
|
29
|
+
onChange={this.onSelect}
|
|
30
|
+
type="radio"
|
|
31
|
+
name="choose-epsg"
|
|
32
|
+
id={"choose-epsg" + i}
|
|
33
|
+
value={proj.epsg}
|
|
34
|
+
checked={proj.epsg === epsg}
|
|
35
|
+
></input>
|
|
36
|
+
{proj.name}
|
|
37
|
+
</label>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
<div className="col-md-3">
|
|
41
|
+
<a href={link} target="_blank" title="More information on epsg.io">
|
|
42
|
+
{proj.epsg}
|
|
43
|
+
</a>
|
|
44
|
+
</div>
|
|
45
|
+
<div className="col-md-3">
|
|
46
|
+
<div className="pull-right">
|
|
47
|
+
<button
|
|
48
|
+
onClick={this.onRemove}
|
|
49
|
+
className="cm-btn cm-btn-link cm-btn-xs"
|
|
50
|
+
>
|
|
51
|
+
Remove
|
|
52
|
+
</button>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</li>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export default CoordinateDisplayProjItem;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { connect } from "../../utils/redux-bundler-react";
|
|
3
|
+
import CoordinateDisplayProjItem from "./coordinate-display-proj-item";
|
|
4
|
+
import _ from "lodash";
|
|
5
|
+
|
|
6
|
+
class CoordinateDisplaySettings extends React.Component {
|
|
7
|
+
constructor(props) {
|
|
8
|
+
super(props);
|
|
9
|
+
this.state = {
|
|
10
|
+
addEpsg: "",
|
|
11
|
+
filterString: "",
|
|
12
|
+
height: window.innerHeight * 0.5,
|
|
13
|
+
};
|
|
14
|
+
this.close = this.close.bind(this);
|
|
15
|
+
this.filterFn = this.filterFn.bind(this);
|
|
16
|
+
this.updateAddEpsg = this.updateAddEpsg.bind(this);
|
|
17
|
+
this.updateFilterString = this.updateFilterString.bind(this);
|
|
18
|
+
this.onSelect = this.onSelect.bind(this);
|
|
19
|
+
this.onRemove = this.onRemove.bind(this);
|
|
20
|
+
this.getProjDef = this.getProjDef.bind(this);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
close() {
|
|
24
|
+
const { doModalClose } = this.props;
|
|
25
|
+
doModalClose();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
filterFn(proj) {
|
|
29
|
+
const { filterString } = this.state;
|
|
30
|
+
const testString = proj.name.toLowerCase() + " " + proj.epsg.toLowerCase();
|
|
31
|
+
return testString.indexOf(filterString) !== -1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
updateAddEpsg(e) {
|
|
35
|
+
const val = e.currentTarget.value;
|
|
36
|
+
this.setState({ addEpsg: "" + val.toUpperCase() });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
updateFilterString(e) {
|
|
40
|
+
const val = e.currentTarget.value;
|
|
41
|
+
this.setState({ filterString: val.toLowerCase() });
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
onSelect(epsg, name) {
|
|
45
|
+
const { doSelectProjection } = this.props;
|
|
46
|
+
doSelectProjection(epsg, name);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
onRemove(epsg) {
|
|
50
|
+
const { doRemoveProjection } = this.props;
|
|
51
|
+
doRemoveProjection(epsg);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
getProjDef() {
|
|
55
|
+
const { doLoadProjDef } = this.props;
|
|
56
|
+
let epsg = this.state.addEpsg;
|
|
57
|
+
if (epsg.indexOf("EPSG") === -1) epsg = "EPSG:" + epsg;
|
|
58
|
+
doLoadProjDef(epsg);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
render() {
|
|
62
|
+
const { theme, projectionList, displayProjection, projectionCanUseEPSGIO } =
|
|
63
|
+
this.props;
|
|
64
|
+
const { addEpsg, filterString, height } = this.state;
|
|
65
|
+
const filteredProjections = _.filter(projectionList, this.filterFn);
|
|
66
|
+
return (
|
|
67
|
+
<div>
|
|
68
|
+
<div className={"cm-modal-header " + theme}>
|
|
69
|
+
Coordinate Display Settings
|
|
70
|
+
</div>
|
|
71
|
+
<div
|
|
72
|
+
className="cm-modal-body"
|
|
73
|
+
style={{ height: height, overflow: "auto" }}
|
|
74
|
+
>
|
|
75
|
+
<div className="row">
|
|
76
|
+
<div className="col-xs-6">
|
|
77
|
+
<div className="cm-form-group">
|
|
78
|
+
<label className="cm-control-label">
|
|
79
|
+
Filter the list by searching names and EPSG codes here:
|
|
80
|
+
</label>
|
|
81
|
+
<input
|
|
82
|
+
onChange={this.updateFilterString}
|
|
83
|
+
value={filterString}
|
|
84
|
+
type="text"
|
|
85
|
+
className="cm-form-control cm-input-sm"
|
|
86
|
+
placeholder="Filter list..."
|
|
87
|
+
></input>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
<div className="col-xs-6">
|
|
91
|
+
<div className="cm-form-group">
|
|
92
|
+
<label className="cm-control-label">
|
|
93
|
+
Add more supported projections from{" "}
|
|
94
|
+
<a
|
|
95
|
+
target="_blank"
|
|
96
|
+
rel="noopener noreferrer"
|
|
97
|
+
href="https://epsg.io"
|
|
98
|
+
>
|
|
99
|
+
epsg.io
|
|
100
|
+
</a>
|
|
101
|
+
</label>
|
|
102
|
+
{projectionCanUseEPSGIO ? (
|
|
103
|
+
<div className="cm-input-group">
|
|
104
|
+
<input
|
|
105
|
+
onChange={this.updateAddEpsg}
|
|
106
|
+
value={addEpsg}
|
|
107
|
+
type="text"
|
|
108
|
+
className="cm-form-control cm-input-sm"
|
|
109
|
+
placeholder="Enter the EPSG code i.e. EPSG:4326 or 4326"
|
|
110
|
+
></input>
|
|
111
|
+
<span className="cm-input-group-btn">
|
|
112
|
+
<button
|
|
113
|
+
onClick={this.getProjDef}
|
|
114
|
+
className={"cm-btn cm-btn-theme cm-btn-sm " + theme}
|
|
115
|
+
type="button"
|
|
116
|
+
>
|
|
117
|
+
Go
|
|
118
|
+
</button>
|
|
119
|
+
</span>
|
|
120
|
+
</div>
|
|
121
|
+
) : (
|
|
122
|
+
<div>Connection to EPSG.io unavailable at this time</div>
|
|
123
|
+
)}
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
<div className="row">
|
|
128
|
+
<ul
|
|
129
|
+
className="cm-list-group thin-scrollbar"
|
|
130
|
+
style={{
|
|
131
|
+
margin: "15px",
|
|
132
|
+
overflow: "auto",
|
|
133
|
+
}}
|
|
134
|
+
>
|
|
135
|
+
{filteredProjections.map((proj, i) => {
|
|
136
|
+
return (
|
|
137
|
+
<CoordinateDisplayProjItem
|
|
138
|
+
proj={proj}
|
|
139
|
+
epsg={displayProjection}
|
|
140
|
+
key={proj.epsg}
|
|
141
|
+
i={i}
|
|
142
|
+
onSelect={this.onSelect}
|
|
143
|
+
onRemove={this.onRemove}
|
|
144
|
+
/>
|
|
145
|
+
);
|
|
146
|
+
})}
|
|
147
|
+
</ul>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
<div className="cm-modal-footer">
|
|
151
|
+
<button
|
|
152
|
+
className={"cm-btn cm-btn-theme " + theme}
|
|
153
|
+
onClick={this.close}
|
|
154
|
+
>
|
|
155
|
+
Close
|
|
156
|
+
</button>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export default connect(
|
|
164
|
+
"selectTheme",
|
|
165
|
+
"selectProjectionList",
|
|
166
|
+
"selectDisplayProjection",
|
|
167
|
+
"selectProjectionCanUseEPSGIO",
|
|
168
|
+
"doModalClose",
|
|
169
|
+
"doRemoveProjection",
|
|
170
|
+
"doSelectProjection",
|
|
171
|
+
"doLoadProjDef",
|
|
172
|
+
CoordinateDisplaySettings
|
|
173
|
+
);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { connect } from "../../utils/redux-bundler-react";
|
|
3
|
+
import {
|
|
4
|
+
BasicToolbarButton,
|
|
5
|
+
BasicToolbarMenuUp,
|
|
6
|
+
BasicToolbarMenuItem,
|
|
7
|
+
} from "../../application-controls";
|
|
8
|
+
import Settings from "./coordinate-display-settings";
|
|
9
|
+
|
|
10
|
+
class CoordinateInteraction extends React.Component {
|
|
11
|
+
constructor(props) {
|
|
12
|
+
super(props);
|
|
13
|
+
|
|
14
|
+
this.openSettings = this.openSettings.bind(this);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
openSettings() {
|
|
18
|
+
const { doModalOpen, doBasicToolbarDeactivate } = this.props;
|
|
19
|
+
doModalOpen({
|
|
20
|
+
children: [Settings],
|
|
21
|
+
options: {},
|
|
22
|
+
openedBy: "PositionText",
|
|
23
|
+
});
|
|
24
|
+
doBasicToolbarDeactivate();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
render() {
|
|
28
|
+
const { displayProjection, displayProjectionName } = this.props;
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<BasicToolbarButton
|
|
32
|
+
enabled={true}
|
|
33
|
+
dropup={true}
|
|
34
|
+
iconClass=""
|
|
35
|
+
title={`Current Coordinate System: ${displayProjectionName}`}
|
|
36
|
+
text={displayProjection}
|
|
37
|
+
onDeactivate={this.cleanUp}
|
|
38
|
+
>
|
|
39
|
+
<BasicToolbarMenuUp>
|
|
40
|
+
<BasicToolbarMenuItem
|
|
41
|
+
active={false}
|
|
42
|
+
iconClass="mdi mdi-settings icon-inline"
|
|
43
|
+
title="Set Display Coordinate System"
|
|
44
|
+
text="Set Display Coordinate System"
|
|
45
|
+
onClick={this.openSettings}
|
|
46
|
+
passProps={{}}
|
|
47
|
+
/>
|
|
48
|
+
</BasicToolbarMenuUp>
|
|
49
|
+
</BasicToolbarButton>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export default connect(
|
|
55
|
+
"selectDisplayProjection",
|
|
56
|
+
"selectDisplayProjectionName",
|
|
57
|
+
"doModalOpen",
|
|
58
|
+
"doBasicToolbarDeactivate",
|
|
59
|
+
CoordinateInteraction
|
|
60
|
+
);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { connect } from "../../utils/redux-bundler-react";
|
|
3
|
+
|
|
4
|
+
const CoordinateLatLonInput = (props) => {
|
|
5
|
+
const { label, placeholder, doUpdateCoordInput, coordsLatLonInput } = props;
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<li>
|
|
9
|
+
<span className="cm-form-horizontal">
|
|
10
|
+
<div className="cm-form-group" style={{ marginBottom: 0 }}>
|
|
11
|
+
<label className="col-md-1" style={{ paddingTop: "3px" }}>
|
|
12
|
+
{label}
|
|
13
|
+
</label>
|
|
14
|
+
<div className="col-md-10">
|
|
15
|
+
<input
|
|
16
|
+
type="text"
|
|
17
|
+
className="cm-form-control cm-input-sm"
|
|
18
|
+
onChange={(e) => {
|
|
19
|
+
doUpdateCoordInput(e, label);
|
|
20
|
+
}}
|
|
21
|
+
value={coordsLatLonInput[`${label}`]}
|
|
22
|
+
placeholder={placeholder}
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</span>
|
|
27
|
+
</li>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default connect(
|
|
32
|
+
"doUpdateCoordInput",
|
|
33
|
+
"selectCoordsLatLonInput",
|
|
34
|
+
CoordinateLatLonInput
|
|
35
|
+
);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
const CoordinatePopup = (props) => {
|
|
4
|
+
const { coords, onClear, overlay } = props;
|
|
5
|
+
return (
|
|
6
|
+
<div
|
|
7
|
+
className="panel panel-default top clearfix"
|
|
8
|
+
style={{ marginBottom: 0 }}
|
|
9
|
+
>
|
|
10
|
+
<div className="pull-right">
|
|
11
|
+
<i
|
|
12
|
+
style={{ cursor: "pointer" }}
|
|
13
|
+
title="Clear"
|
|
14
|
+
className="mdi mdi-close"
|
|
15
|
+
onClick={(e) => onClear(e, overlay)}
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
18
|
+
<div className="arrow"></div>
|
|
19
|
+
<div className="panel-body">
|
|
20
|
+
<div style={{ minWidth: "125px", textAlign: "center" }}>
|
|
21
|
+
{`${coords.x}, ${coords.y}`}
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
export default CoordinatePopup;
|