@corpsmap/corpsmap 4.0.35 → 4.1.0
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 +73 -32
- package/src/App.css +42 -0
- package/src/App.jsx +12 -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-bundles-old/auth-bundle.js +130 -0
- package/src/application-bundles-old/config-bundle.js +29 -0
- package/src/application-bundles-old/ui-bundle.js +406 -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/draw-tools-old/create-draw-bundle.js +222 -0
- package/src/core-plugins/draw-tools-old/draw-button.js +189 -0
- package/src/core-plugins/draw-tools-old/draw-label-bundle.js +116 -0
- package/src/core-plugins/draw-tools-old/draw-modify-bundle.js +156 -0
- package/src/core-plugins/draw-tools-old/draw-styles.js +110 -0
- package/src/core-plugins/draw-tools-old/draw-tool-item.js +67 -0
- package/src/core-plugins/draw-tools-old/index.js +32 -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_bootstrap/css/bootstrap-paper.css +7606 -0
- package/src/css/_deprecated_bootstrap/css/bootstrap-paper.min.css +8083 -0
- package/src/css/_deprecated_bootstrap/css/bootstrap-simplex.min.css +7328 -0
- package/src/css/_deprecated_bootstrap/css/bootstrap-theme.css +587 -0
- package/src/css/_deprecated_bootstrap/css/bootstrap-theme.css.map +1 -0
- package/src/css/_deprecated_bootstrap/css/bootstrap-theme.min.css +6 -0
- package/src/css/_deprecated_bootstrap/css/bootstrap-theme.min.css.map +1 -0
- package/src/css/_deprecated_bootstrap/css/bootstrap.css +7137 -0
- package/src/css/_deprecated_bootstrap/css/bootstrap.css.map +142 -0
- package/src/css/_deprecated_bootstrap/css/bootstrap.min.css +7132 -0
- package/src/css/_deprecated_bootstrap/css/bootstrap.min.css.map +143 -0
- package/src/css/_deprecated_bootstrap/fonts/glyphicons-halflings-regular.eot +0 -0
- package/src/css/_deprecated_bootstrap/fonts/glyphicons-halflings-regular.svg +288 -0
- package/src/css/_deprecated_bootstrap/fonts/glyphicons-halflings-regular.ttf +0 -0
- package/src/css/_deprecated_bootstrap/fonts/glyphicons-halflings-regular.woff +0 -0
- package/src/css/_deprecated_bootstrap/fonts/glyphicons-halflings-regular.woff2 +0 -0
- package/src/css/_deprecated_bootstrap/js/bootstrap.js +2377 -0
- package/src/css/_deprecated_bootstrap/js/bootstrap.min.js +7 -0
- package/src/css/_deprecated_bootstrap/js/npm.js +13 -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 -41517
- package/lib/prod.js +0 -41483
- package/rollup.config.js +0 -30
- 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/bundles/map-view-bundle.js +0 -34
- 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 -38
- package/src/components/MeasureTool/index.js +0 -125
- package/src/components/MeasureTool/measure-utils.js +0 -57
- package/src/components/Zoom/index.js +0 -28
- package/src/components/index.js +0 -3
- package/src/index.js +0 -11
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
import { createSelector } from "redux-bundler";
|
|
2
|
+
import _ from "lodash";
|
|
3
|
+
import TreeviewPanel from "./tree-view-panel";
|
|
4
|
+
import LayerSubpanel from "./layer-subpanel/layer-subpanel";
|
|
5
|
+
|
|
6
|
+
export const treeView = (controls) => {
|
|
7
|
+
return {
|
|
8
|
+
name: "treeview",
|
|
9
|
+
|
|
10
|
+
getReducer() {
|
|
11
|
+
const initialData = {
|
|
12
|
+
rootNodeCreated: false,
|
|
13
|
+
configLayersLoaded: false,
|
|
14
|
+
shouldRenderDetails: false,
|
|
15
|
+
selectedItem: null,
|
|
16
|
+
toggleExpanded: true,
|
|
17
|
+
controls: controls,
|
|
18
|
+
hideCounter: false,
|
|
19
|
+
showSelectAll: false,
|
|
20
|
+
toggleFavorites: false,
|
|
21
|
+
toggleUserDefaultLayers: false,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
return (state = initialData, { type, payload }) => {
|
|
25
|
+
switch (type) {
|
|
26
|
+
case "TREEVIEW_ROOT_CREATED":
|
|
27
|
+
case "TREEVIEW_LOADED":
|
|
28
|
+
case "TREEVIEW_DETAILS_PICKED":
|
|
29
|
+
case "TREEVIEW_DETAILS_DISPLAYED":
|
|
30
|
+
case "TREEVIEW_FOLDERS_TOGGLED":
|
|
31
|
+
case "TREEVIEW_TRIGGER_HIDE_COUNTER":
|
|
32
|
+
case "TREEVIEW_TRIGGER_SHOW_SELECT_ALL":
|
|
33
|
+
case "TREEVIEW_TOGGLE_FAVORITES_VIEW":
|
|
34
|
+
case "TREEVIEW_ORM_FAVORITES_ERROR":
|
|
35
|
+
case "TREEVIEW_ORM_FAVORITES_SAVE":
|
|
36
|
+
case "TREEVIEW_ORM_FAVORITES_REMOVE":
|
|
37
|
+
case "TREEVIEW_ORM_REMOVE_FAVORITES_ERROR":
|
|
38
|
+
case "TREEVIEW_TOGGLE_USER_DEFAULT_LAYERS_VIEW":
|
|
39
|
+
case "TREEVIEW_ORM_USER_DEFAULT_LAYERS_ERROR":
|
|
40
|
+
case "TREEVIEW_ORM_USER_DEFAULT_LAYERS_SAVE":
|
|
41
|
+
case "TREEVIEW_ORM_USER_DEFAULT_LAYERS_REMOVE":
|
|
42
|
+
case "TREEVIEW_ORM_REMOVE_USER_DEFAULT_LAYERS_ERROR":
|
|
43
|
+
return Object.assign({}, state, payload);
|
|
44
|
+
default:
|
|
45
|
+
return state;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
doTreeCreateRootNode:
|
|
51
|
+
() =>
|
|
52
|
+
({ dispatch, store }) => {
|
|
53
|
+
dispatch({
|
|
54
|
+
type: "TREEVIEW_ROOT_CREATED",
|
|
55
|
+
payload: { rootNodeCreated: true },
|
|
56
|
+
});
|
|
57
|
+
store.doAddLayer({
|
|
58
|
+
id: "treeview-root",
|
|
59
|
+
root: true,
|
|
60
|
+
leaf: false,
|
|
61
|
+
teamDatasetId: null,
|
|
62
|
+
collapsed: false,
|
|
63
|
+
visible: false,
|
|
64
|
+
sortOrder: 0,
|
|
65
|
+
displayName: "Root",
|
|
66
|
+
type: "Folder",
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
doTreeLoadDefaultLayers:
|
|
71
|
+
() =>
|
|
72
|
+
({ dispatch, store }) => {
|
|
73
|
+
dispatch({
|
|
74
|
+
type: "TREEVIEW_LOADED",
|
|
75
|
+
payload: { configLayersLoaded: true },
|
|
76
|
+
});
|
|
77
|
+
const params = store.selectWindowLocationParams();
|
|
78
|
+
const turnOn = !params.layers
|
|
79
|
+
? []
|
|
80
|
+
: params.layers.split(",").map(Number);
|
|
81
|
+
const layers = store.selectDefaultLayers();
|
|
82
|
+
const sortedLayers = _.orderBy(
|
|
83
|
+
layers,
|
|
84
|
+
["parentId", "layerOrder"],
|
|
85
|
+
["desc", "asc"]
|
|
86
|
+
);
|
|
87
|
+
sortedLayers.forEach((lyr) => {
|
|
88
|
+
if (lyr.parentId) {
|
|
89
|
+
const idMap = store.selectIdMap();
|
|
90
|
+
lyr.parentUid = idMap[lyr.parentId];
|
|
91
|
+
} else {
|
|
92
|
+
lyr.parentUid = store.selectTreeViewRootId();
|
|
93
|
+
}
|
|
94
|
+
if (lyr.teamDatasetId && turnOn.indexOf(lyr.teamDatasetId) !== -1) {
|
|
95
|
+
lyr.visible = true;
|
|
96
|
+
}
|
|
97
|
+
store.doAddLayer(lyr);
|
|
98
|
+
});
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
doRenderTreeView:
|
|
102
|
+
() =>
|
|
103
|
+
({ dispatch, store }) => {
|
|
104
|
+
store.doPrimaryPanelOpen({
|
|
105
|
+
openedBy: "LayerTree",
|
|
106
|
+
children: [TreeviewPanel],
|
|
107
|
+
});
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
doOpenLayerDetails:
|
|
111
|
+
(item) =>
|
|
112
|
+
({ dispatch, store }) => {
|
|
113
|
+
dispatch({
|
|
114
|
+
type: "TREEVIEW_DETAILS_PICKED",
|
|
115
|
+
payload: { shouldRenderDetails: true, selectedItem: item },
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
doRenderLayerDetails:
|
|
120
|
+
() =>
|
|
121
|
+
({ dispatch, store }) => {
|
|
122
|
+
dispatch({
|
|
123
|
+
type: "TREEVIEW_DETAILS_DISPLAYED",
|
|
124
|
+
payload: { shouldRenderDetails: false },
|
|
125
|
+
});
|
|
126
|
+
store.doPrimaryPanelOpen({
|
|
127
|
+
openedBy: "LayerTree",
|
|
128
|
+
children: [LayerSubpanel],
|
|
129
|
+
});
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
doTriggerCounterHide:
|
|
133
|
+
() =>
|
|
134
|
+
({ dispatch }) => {
|
|
135
|
+
dispatch({
|
|
136
|
+
type: "TREEVIEW_TRIGGER_HIDE_COUNTER",
|
|
137
|
+
payload: { hideCounter: true },
|
|
138
|
+
});
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
doTriggerShowSelectAll:
|
|
142
|
+
() =>
|
|
143
|
+
({ dispatch }) => {
|
|
144
|
+
dispatch({
|
|
145
|
+
type: "TREEVIEW_TRIGGER_SHOW_SELECT_ALL",
|
|
146
|
+
payload: { showSelectAll: true },
|
|
147
|
+
});
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
selectTreeRootNode: createSelector(
|
|
151
|
+
"selectLayers",
|
|
152
|
+
"selectTreeViewRootId",
|
|
153
|
+
"selectAppTime",
|
|
154
|
+
(layers, uid, appTime) => {
|
|
155
|
+
return Object.assign({}, layers[uid]);
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
doTreeViewToggleExpand:
|
|
159
|
+
() =>
|
|
160
|
+
({ dispatch, store }) => {
|
|
161
|
+
const state = store.selectTreeViewToggleExpanded();
|
|
162
|
+
const treeViewRootId = store.selectTreeViewRootId();
|
|
163
|
+
store.doTreeSetCollapsedAll(treeViewRootId, !state);
|
|
164
|
+
|
|
165
|
+
dispatch({
|
|
166
|
+
type: "TREEVIEW_FOLDERS_TOGGLED",
|
|
167
|
+
payload: { toggleExpanded: !state },
|
|
168
|
+
});
|
|
169
|
+
},
|
|
170
|
+
doTreeViewAddAll:
|
|
171
|
+
() =>
|
|
172
|
+
({ dispatch, store }) => {
|
|
173
|
+
const treeViewRootId = store.selectTreeViewRootId();
|
|
174
|
+
store.doTreeSetVisibleAll(treeViewRootId, true);
|
|
175
|
+
},
|
|
176
|
+
doTreeViewRemoveAll:
|
|
177
|
+
() =>
|
|
178
|
+
({ dispatch, store }) => {
|
|
179
|
+
const treeViewRootId = store.selectTreeViewRootId();
|
|
180
|
+
store.doTreeSetVisibleAll(treeViewRootId, false);
|
|
181
|
+
},
|
|
182
|
+
|
|
183
|
+
doToggleFavoritesView:
|
|
184
|
+
() =>
|
|
185
|
+
({ dispatch, store }) => {
|
|
186
|
+
const showView = store.selectTreeViewToggleFavoritesView();
|
|
187
|
+
|
|
188
|
+
dispatch({
|
|
189
|
+
type: "TREEVIEW_TOGGLE_FAVORITES_VIEW",
|
|
190
|
+
payload: { toggleFavorites: !showView, toggleUserDefaultLayers: false },
|
|
191
|
+
});
|
|
192
|
+
},
|
|
193
|
+
doSaveFavoriteLayerToOrm:
|
|
194
|
+
(fLyr, lyr) =>
|
|
195
|
+
({ dispatch, store }) => {
|
|
196
|
+
const layer = JSON.stringify(fLyr);
|
|
197
|
+
|
|
198
|
+
window.CM_FAVORITE_SAVE(encodeURIComponent(layer), (err, response) => {
|
|
199
|
+
const responseItems = response.split(";");
|
|
200
|
+
const status = responseItems[0];
|
|
201
|
+
const msg = decodeURIComponent(responseItems[1]);
|
|
202
|
+
|
|
203
|
+
if (err) {
|
|
204
|
+
dispatch({
|
|
205
|
+
type: "TREEVIEW_ORM_FAVORITES_ERROR",
|
|
206
|
+
payload: {
|
|
207
|
+
notification: {
|
|
208
|
+
title: "Error Saving Layer",
|
|
209
|
+
message: msg,
|
|
210
|
+
level: "danger",
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
});
|
|
214
|
+
} else {
|
|
215
|
+
if (status === "OK") {
|
|
216
|
+
dispatch({
|
|
217
|
+
type: "TREEVIEW_ORM_FAVORITES_SAVE",
|
|
218
|
+
payload: {
|
|
219
|
+
notification: {
|
|
220
|
+
message: msg,
|
|
221
|
+
level: "success",
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
//update layer tree state, after successful save.
|
|
227
|
+
store.doUpdateFavoriteLayers("add", lyr);
|
|
228
|
+
store.doLayerSetFavorite(lyr.uid, true);
|
|
229
|
+
} else {
|
|
230
|
+
dispatch({
|
|
231
|
+
type: "TREEVIEW_ORM_FAVORITES_ERROR",
|
|
232
|
+
payload: {
|
|
233
|
+
notification: {
|
|
234
|
+
title: "Error Saving Layer",
|
|
235
|
+
message: msg,
|
|
236
|
+
level: "danger",
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
},
|
|
244
|
+
doRemoveFavoriteLayerFromOrm:
|
|
245
|
+
(fLyr, lyr) =>
|
|
246
|
+
({ dispatch, store }) => {
|
|
247
|
+
const layer = JSON.stringify(fLyr);
|
|
248
|
+
|
|
249
|
+
window.CM_FAVORITE_REMOVE(
|
|
250
|
+
encodeURIComponent(layer),
|
|
251
|
+
(err, response) => {
|
|
252
|
+
const responseItems = response.split(";");
|
|
253
|
+
const status = responseItems[0];
|
|
254
|
+
const msg = decodeURIComponent(responseItems[1]);
|
|
255
|
+
|
|
256
|
+
if (err) {
|
|
257
|
+
dispatch({
|
|
258
|
+
type: "TREEVIEW_ORM_REMOVE_FAVORITES_ERROR",
|
|
259
|
+
payload: {
|
|
260
|
+
notification: {
|
|
261
|
+
title: "Error Saving Layer",
|
|
262
|
+
message: msg,
|
|
263
|
+
level: "danger",
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
});
|
|
267
|
+
} else {
|
|
268
|
+
if (status === "OK") {
|
|
269
|
+
dispatch({
|
|
270
|
+
type: "TREEVIEW_ORM_FAVORITES_REMOVE",
|
|
271
|
+
payload: {
|
|
272
|
+
notification: {
|
|
273
|
+
message: msg,
|
|
274
|
+
level: "success",
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
//update layer tree state, after successful remove.
|
|
280
|
+
store.doUpdateFavoriteLayers("remove", lyr);
|
|
281
|
+
store.doLayerSetFavorite(lyr.uid, false);
|
|
282
|
+
} else {
|
|
283
|
+
dispatch({
|
|
284
|
+
type: "TREEVIEW_ORM_REMOVE_FAVORITES_ERROR",
|
|
285
|
+
payload: {
|
|
286
|
+
notification: {
|
|
287
|
+
title: "Error Removing Layer from Favorites",
|
|
288
|
+
message: msg,
|
|
289
|
+
level: "danger",
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
},
|
|
298
|
+
|
|
299
|
+
doToggleLayerFavoritesAdd:
|
|
300
|
+
(lyr, favorite) =>
|
|
301
|
+
({ dispatch, store }) => {
|
|
302
|
+
const favoritesDB = store.selectPrimaryPanelFavoritesDB();
|
|
303
|
+
|
|
304
|
+
switch (favoritesDB) {
|
|
305
|
+
case "orm":
|
|
306
|
+
const fLayer = {
|
|
307
|
+
id: lyr.id,
|
|
308
|
+
parentId: lyr.parent.id,
|
|
309
|
+
displayName: lyr.displayName,
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
if (favorite) {
|
|
313
|
+
store.doSaveFavoriteLayerToOrm(fLayer, lyr);
|
|
314
|
+
} else {
|
|
315
|
+
store.doRemoveFavoriteLayerFromOrm(fLayer, lyr);
|
|
316
|
+
}
|
|
317
|
+
default:
|
|
318
|
+
break;
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
doToggleUserDefaultLayersAdd:
|
|
322
|
+
(lyr, userDefaultLayer) =>
|
|
323
|
+
({ dispatch, store }) => {
|
|
324
|
+
const userDefaultLayersDB = store.selectPrimaryPanelUserDefaultLayersDB();
|
|
325
|
+
|
|
326
|
+
switch (userDefaultLayersDB) {
|
|
327
|
+
case "orm":
|
|
328
|
+
const defaultLayer = {
|
|
329
|
+
id: lyr.id,
|
|
330
|
+
parentId: lyr.parent.id,
|
|
331
|
+
displayName: lyr.displayName,
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
if (userDefaultLayer) {
|
|
335
|
+
store.doSaveUserDefaultLayerToOrm(defaultLayer, lyr);
|
|
336
|
+
const layers = store.selectLayers();
|
|
337
|
+
const node = layers[lyr.uid];
|
|
338
|
+
if (node && node.mapLayer) {
|
|
339
|
+
node.visible = true;
|
|
340
|
+
node.mapLayer.setVisible(true);
|
|
341
|
+
dispatch({
|
|
342
|
+
type: "LAYERS_LIST_UPDATED",
|
|
343
|
+
payload: Object.assign({}, layers),
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
} else {
|
|
348
|
+
store.doRemoveUserDefaultLayerFromOrm(defaultLayer, lyr);
|
|
349
|
+
}
|
|
350
|
+
default:
|
|
351
|
+
break;
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
doToggleUserDefaultLayersView:
|
|
355
|
+
() =>
|
|
356
|
+
({ dispatch, store }) => {
|
|
357
|
+
const showView = store.selectTreeViewToggleUserDefaultLayersView();
|
|
358
|
+
|
|
359
|
+
dispatch({
|
|
360
|
+
type: "TREEVIEW_TOGGLE_USER_DEFAULT_LAYERS_VIEW",
|
|
361
|
+
payload: { toggleUserDefaultLayers: !showView, toggleFavorites: false },
|
|
362
|
+
});
|
|
363
|
+
},
|
|
364
|
+
|
|
365
|
+
doSaveUserDefaultLayerToOrm:
|
|
366
|
+
(fLyr, lyr) =>
|
|
367
|
+
({ dispatch, store }) => {
|
|
368
|
+
const layer = JSON.stringify(fLyr);
|
|
369
|
+
|
|
370
|
+
window.CM_USER_DEFAULT_LAYER_SAVE(encodeURIComponent(layer), (err, response) => {
|
|
371
|
+
const responseItems = response.split(";");
|
|
372
|
+
const status = responseItems[0];
|
|
373
|
+
const msg = decodeURIComponent(responseItems[1]);
|
|
374
|
+
|
|
375
|
+
if (err) {
|
|
376
|
+
dispatch({
|
|
377
|
+
type: "TREEVIEW_ORM_USER_DEFAULT_LAYERS_ERROR",
|
|
378
|
+
payload: {
|
|
379
|
+
notification: {
|
|
380
|
+
title: "Error Saving Layer",
|
|
381
|
+
message: msg,
|
|
382
|
+
level: "danger",
|
|
383
|
+
},
|
|
384
|
+
},
|
|
385
|
+
});
|
|
386
|
+
} else {
|
|
387
|
+
if (status === "OK") {
|
|
388
|
+
dispatch({
|
|
389
|
+
type: "TREEVIEW_ORM_USER_DEFAULT_LAYERS_SAVE",
|
|
390
|
+
payload: {
|
|
391
|
+
notification: {
|
|
392
|
+
message: msg,
|
|
393
|
+
level: "success",
|
|
394
|
+
},
|
|
395
|
+
},
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
//update layer tree state, after successful save.
|
|
399
|
+
store.doUpdateUserDefaultLayers("add", lyr);
|
|
400
|
+
store.doLayerSetUserDefaultLayers(lyr.uid, true);
|
|
401
|
+
} else {
|
|
402
|
+
dispatch({
|
|
403
|
+
type: "TREEVIEW_ORM_USER_DEFAULT_LAYERS_ERROR",
|
|
404
|
+
payload: {
|
|
405
|
+
notification: {
|
|
406
|
+
title: "Error Saving Layer",
|
|
407
|
+
message: msg,
|
|
408
|
+
level: "danger",
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
},
|
|
416
|
+
|
|
417
|
+
doRemoveUserDefaultLayerFromOrm:
|
|
418
|
+
(fLyr, lyr) =>
|
|
419
|
+
({ dispatch, store }) => {
|
|
420
|
+
const layer = JSON.stringify(fLyr);
|
|
421
|
+
|
|
422
|
+
window.CM_USER_DEFAULT_LAYER_REMOVE(
|
|
423
|
+
encodeURIComponent(layer),
|
|
424
|
+
(err, response) => {
|
|
425
|
+
const responseItems = response.split(";");
|
|
426
|
+
const status = responseItems[0];
|
|
427
|
+
const msg = decodeURIComponent(responseItems[1]);
|
|
428
|
+
|
|
429
|
+
if (err) {
|
|
430
|
+
dispatch({
|
|
431
|
+
type: "TREEVIEW_ORM_REMOVE_USER_DEFAULT_LAYERS_ERROR",
|
|
432
|
+
payload: {
|
|
433
|
+
notification: {
|
|
434
|
+
title: "Error Saving Layer",
|
|
435
|
+
message: msg,
|
|
436
|
+
level: "danger",
|
|
437
|
+
},
|
|
438
|
+
},
|
|
439
|
+
});
|
|
440
|
+
} else {
|
|
441
|
+
if (status === "OK") {
|
|
442
|
+
dispatch({
|
|
443
|
+
type: "TREEVIEW_ORM_USER_DEFAULT_LAYERS_REMOVE",
|
|
444
|
+
payload: {
|
|
445
|
+
notification: {
|
|
446
|
+
message: msg,
|
|
447
|
+
level: "success",
|
|
448
|
+
},
|
|
449
|
+
},
|
|
450
|
+
});
|
|
451
|
+
|
|
452
|
+
//update layer tree state, after successful remove.
|
|
453
|
+
store.doUpdateUserDefaultLayers("remove", lyr);
|
|
454
|
+
store.doLayerSetUserDefaultLayers(lyr.uid, false);
|
|
455
|
+
} else {
|
|
456
|
+
dispatch({
|
|
457
|
+
type: "TREEVIEW_ORM_REMOVE_USER_DEFAULT_LAYERS_ERROR",
|
|
458
|
+
payload: {
|
|
459
|
+
notification: {
|
|
460
|
+
title: "Error Removing Layer from Favorites",
|
|
461
|
+
message: msg,
|
|
462
|
+
level: "danger",
|
|
463
|
+
},
|
|
464
|
+
},
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
);
|
|
470
|
+
},
|
|
471
|
+
|
|
472
|
+
selectTreeViewRootId: createSelector("selectIdMap", (idMap) => {
|
|
473
|
+
return idMap["treeview-root"];
|
|
474
|
+
}),
|
|
475
|
+
|
|
476
|
+
selectTreeViewToggleExpanded: (state) => {
|
|
477
|
+
return state.treeview.toggleExpanded;
|
|
478
|
+
},
|
|
479
|
+
selectTreeViewSelectedItem: (state) => {
|
|
480
|
+
return state.treeview.selectedItem;
|
|
481
|
+
},
|
|
482
|
+
selectTreeViewControls: (state) => {
|
|
483
|
+
return state.treeview.controls;
|
|
484
|
+
},
|
|
485
|
+
selectTreeViewHideCounter: (state) => {
|
|
486
|
+
return state.treeview.hideCounter;
|
|
487
|
+
},
|
|
488
|
+
selectTreeViewShowSelectAll: (state) => {
|
|
489
|
+
return state.treeview.showSelectAll;
|
|
490
|
+
},
|
|
491
|
+
selectTreeViewToggleFavoritesView: (state) => {
|
|
492
|
+
return state.treeview.toggleFavorites;
|
|
493
|
+
},
|
|
494
|
+
selectTreeViewToggleUserDefaultLayersView: (state) => {
|
|
495
|
+
return state.treeview.toggleUserDefaultLayers;
|
|
496
|
+
},
|
|
497
|
+
reactCreateRootNode: (state) => {
|
|
498
|
+
if (!state.treeview.rootNodeCreated)
|
|
499
|
+
return { actionCreator: "doTreeCreateRootNode" };
|
|
500
|
+
},
|
|
501
|
+
|
|
502
|
+
reactLoadLayersFromConfig: (state) => {
|
|
503
|
+
if (state.treeview.rootNodeCreated && !state.treeview.configLayersLoaded)
|
|
504
|
+
return { actionCreator: "doTreeLoadDefaultLayers" };
|
|
505
|
+
},
|
|
506
|
+
|
|
507
|
+
reactShouldRenderLayerDetails: (state) => {
|
|
508
|
+
if (state.treeview.shouldRenderDetails)
|
|
509
|
+
return { actionCreator: "doRenderLayerDetails" };
|
|
510
|
+
},
|
|
511
|
+
};
|
|
512
|
+
};
|
|
513
|
+
export default treeView;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { connect } from "../../utils/redux-bundler-react";
|
|
3
|
+
import MarkdownIt from "markdown-it";
|
|
4
|
+
import xhr from "xhr";
|
|
5
|
+
|
|
6
|
+
class DatasetInfo extends React.Component {
|
|
7
|
+
constructor(props) {
|
|
8
|
+
super(props);
|
|
9
|
+
this.state = {
|
|
10
|
+
__html: "<p>Loading</p>",
|
|
11
|
+
};
|
|
12
|
+
this.close = this.close.bind(this);
|
|
13
|
+
this.renderAsync = this.renderAsync.bind(this);
|
|
14
|
+
this.renderContent = this.renderContent.bind(this);
|
|
15
|
+
this.renderMarkdown = this.renderMarkdown.bind(this);
|
|
16
|
+
this.renderIframe = this.renderIframe.bind(this);
|
|
17
|
+
this.renderImage = this.renderImage.bind(this);
|
|
18
|
+
this.renderRawAsync = this.renderRawAsync.bind(this);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
componentDidMount() {
|
|
22
|
+
const { item } = this.props;
|
|
23
|
+
if (item.info) {
|
|
24
|
+
if (item.info.url) {
|
|
25
|
+
if (item.info.iframe) {
|
|
26
|
+
return this.renderIframe();
|
|
27
|
+
} else if (item.info.img) {
|
|
28
|
+
return this.renderImage();
|
|
29
|
+
} else if (item.info.raw) {
|
|
30
|
+
return this.renderRawAsync();
|
|
31
|
+
} else {
|
|
32
|
+
return this.renderAsync();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (item.info.content) {
|
|
36
|
+
if (item.info.raw) {
|
|
37
|
+
return this.renderRawContent();
|
|
38
|
+
} else {
|
|
39
|
+
return this.renderContent();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
close() {
|
|
46
|
+
const { doModalClose } = this.props;
|
|
47
|
+
doModalClose();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
renderMarkdown(content) {
|
|
51
|
+
const md = new MarkdownIt();
|
|
52
|
+
this.setState({
|
|
53
|
+
__html: md.render(content),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
renderContent() {
|
|
58
|
+
const { item } = this.props;
|
|
59
|
+
const { content } = item.info;
|
|
60
|
+
return this.renderMarkdown(content);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
renderRawContent() {
|
|
64
|
+
const { item } = this.props;
|
|
65
|
+
const { content } = item.info;
|
|
66
|
+
return this.setState({ __html: content });
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
renderAsync() {
|
|
70
|
+
const { item } = this.props;
|
|
71
|
+
const { url } = item.info;
|
|
72
|
+
xhr.get(url, (err, response, body) => {
|
|
73
|
+
if (err) {
|
|
74
|
+
this.renderMarkdown("Error Loading Content");
|
|
75
|
+
} else {
|
|
76
|
+
this.renderMarkdown(body);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
renderRawAsync() {
|
|
82
|
+
const { item } = this.props;
|
|
83
|
+
const { url } = item.info;
|
|
84
|
+
xhr.get(url, (err, response, body) => {
|
|
85
|
+
if (err) {
|
|
86
|
+
this.setState({ __html: "<p>Error Loading Content</p>" });
|
|
87
|
+
} else {
|
|
88
|
+
this.setState({ __html: body });
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
renderIframe() {
|
|
94
|
+
const { item } = this.props;
|
|
95
|
+
const { url } = item.info;
|
|
96
|
+
this.setState({
|
|
97
|
+
__html: `<iframe src="${url}" frameborder="0"></iframe>`,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
renderImage() {
|
|
102
|
+
const { item } = this.props;
|
|
103
|
+
const { url } = item.info;
|
|
104
|
+
this.setState({
|
|
105
|
+
__html: `<img src="${url}"></img>`,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
render() {
|
|
110
|
+
const { theme, item } = this.props;
|
|
111
|
+
return (
|
|
112
|
+
<div>
|
|
113
|
+
<div className={"cm-modal-header " + theme}>
|
|
114
|
+
{item.displayName} Metadata
|
|
115
|
+
</div>
|
|
116
|
+
<div
|
|
117
|
+
className="cm-modal-body thin-scrollbar"
|
|
118
|
+
style={{
|
|
119
|
+
height: window.innerHeight * 0.75,
|
|
120
|
+
top: 0,
|
|
121
|
+
bottom: 0,
|
|
122
|
+
left: 0,
|
|
123
|
+
right: 0,
|
|
124
|
+
overflow: "auto",
|
|
125
|
+
}}
|
|
126
|
+
dangerouslySetInnerHTML={this.state}
|
|
127
|
+
></div>
|
|
128
|
+
<div className="cm-modal-footer">
|
|
129
|
+
<button
|
|
130
|
+
className={"cm-btn cm-btn-theme " + theme}
|
|
131
|
+
onClick={this.close}
|
|
132
|
+
>
|
|
133
|
+
Close
|
|
134
|
+
</button>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export default connect("selectTheme", "doModalClose", DatasetInfo);
|