@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,316 @@
|
|
|
1
|
+
import sortBy from "lodash/sortBy";
|
|
2
|
+
import max from "lodash/max";
|
|
3
|
+
import sum from "lodash/sum";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: "print",
|
|
7
|
+
|
|
8
|
+
getReducer: () => {
|
|
9
|
+
const initialData = {
|
|
10
|
+
mapCanvas: null,
|
|
11
|
+
legendCanvas: null,
|
|
12
|
+
_shouldExport: false,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
return (state = initialData, { type, payload }) => {
|
|
16
|
+
switch (type) {
|
|
17
|
+
case "PRINT_ERROR":
|
|
18
|
+
case "PRINT_LOADING":
|
|
19
|
+
case "PRINT_MAP_CANVAS_GENERATED":
|
|
20
|
+
case "PRINT_LEGEND_CANVAS_GENERATED":
|
|
21
|
+
case "PRINT_EXPORTING":
|
|
22
|
+
return Object.assign({}, state, payload);
|
|
23
|
+
default:
|
|
24
|
+
return state;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
doSetMapCanvas: (map) => ({ dispatch }) => {
|
|
29
|
+
let mapCanvas = document.createElement("canvas");
|
|
30
|
+
const size = map.getSize();
|
|
31
|
+
mapCanvas.width = size[0];
|
|
32
|
+
mapCanvas.height = size[1];
|
|
33
|
+
let mapContext = mapCanvas.getContext("2d");
|
|
34
|
+
|
|
35
|
+
//Get visible layers on map
|
|
36
|
+
Array.prototype.forEach.call(
|
|
37
|
+
document.querySelectorAll(".ol-layer canvas"),
|
|
38
|
+
function (canvas) {
|
|
39
|
+
if (canvas.width > 0) {
|
|
40
|
+
const opacity = canvas.parentNode.style.opacity;
|
|
41
|
+
mapContext.globalAlpha = opacity === "" ? 1 : Number(opacity);
|
|
42
|
+
var transform = canvas.style.transform;
|
|
43
|
+
// Get the transform parameters from the style's transform matrix
|
|
44
|
+
const matrix = transform
|
|
45
|
+
.match(/^matrix\(([^\(]*)\)$/)[1]
|
|
46
|
+
.split(",")
|
|
47
|
+
.map(Number);
|
|
48
|
+
// Apply the transform to the export map context
|
|
49
|
+
CanvasRenderingContext2D.prototype.setTransform.apply(
|
|
50
|
+
mapContext,
|
|
51
|
+
matrix
|
|
52
|
+
);
|
|
53
|
+
mapContext.drawImage(canvas, 0, 0);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
//Get scale on map
|
|
59
|
+
Array.prototype.forEach.call(
|
|
60
|
+
document.querySelectorAll(".ol-scale-line .ol-scale-line-inner"),
|
|
61
|
+
function (node) {
|
|
62
|
+
//Get scale value & width of scale div
|
|
63
|
+
const scaleValue = node.textContent;
|
|
64
|
+
const scaleWidth = node.style.width.replace("px", "").trim();
|
|
65
|
+
|
|
66
|
+
//Calculate rect positioning
|
|
67
|
+
const rectH = 20;
|
|
68
|
+
const rectW = Number(scaleWidth); //width in pixels
|
|
69
|
+
const rectX = 5; // x-coordinate of the upper-left corner
|
|
70
|
+
const rectY = 5;
|
|
71
|
+
|
|
72
|
+
//Draw/Style rect
|
|
73
|
+
mapContext.fillStyle = "#000";
|
|
74
|
+
mapContext.fillRect(rectX, rectY, rectW, rectH);
|
|
75
|
+
|
|
76
|
+
//Draw/Style path within rect
|
|
77
|
+
const pathStartX = rectX + 3;
|
|
78
|
+
const pathStartY = rectY + 3;
|
|
79
|
+
mapContext.beginPath();
|
|
80
|
+
mapContext.moveTo(pathStartX, pathStartY);
|
|
81
|
+
mapContext.lineTo(pathStartX, pathStartY + rectH / 2);
|
|
82
|
+
mapContext.lineTo(pathStartX + (rectW - 6), pathStartY + rectH / 2);
|
|
83
|
+
mapContext.lineTo(pathStartX + (rectW - 6), pathStartY);
|
|
84
|
+
mapContext.strokeStyle = "#fff";
|
|
85
|
+
|
|
86
|
+
//draw defined path
|
|
87
|
+
mapContext.stroke();
|
|
88
|
+
|
|
89
|
+
//Draw/Style text
|
|
90
|
+
const txtX = pathStartX + (rectW / 2 - 6);
|
|
91
|
+
const txtY = pathStartY + (rectH / 2 - 4);
|
|
92
|
+
mapContext.font = "10px";
|
|
93
|
+
mapContext.fillStyle = "#fff";
|
|
94
|
+
mapContext.textAlign = "center";
|
|
95
|
+
mapContext.fillText(scaleValue, txtX, txtY);
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
dispatch({
|
|
100
|
+
type: "PRINT_MAP_CANVAS_GENERATED",
|
|
101
|
+
payload: {
|
|
102
|
+
mapCanvas: mapCanvas,
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
},
|
|
106
|
+
doSetLegendCanvas: () => ({ dispatch, store }) => {
|
|
107
|
+
const legendCanvases = store.selectLegendCanvases();
|
|
108
|
+
const visibleLayers = store.selectVisibleLayers();
|
|
109
|
+
const sortedLayers = sortBy(visibleLayers, ["sortOrder"]).reverse();
|
|
110
|
+
let canvases = [];
|
|
111
|
+
|
|
112
|
+
let legendCanvas = document.createElement("canvas");
|
|
113
|
+
let legendCTX = legendCanvas.getContext("2d");
|
|
114
|
+
|
|
115
|
+
sortedLayers.forEach((layer) => {
|
|
116
|
+
if (legendCanvases.hasOwnProperty(layer.uid)) {
|
|
117
|
+
// create single canvas for layer
|
|
118
|
+
let layerCanvas = document.createElement("canvas");
|
|
119
|
+
let layerCTX = layerCanvas.getContext("2d");
|
|
120
|
+
|
|
121
|
+
// get displayName width
|
|
122
|
+
const titleWidth =
|
|
123
|
+
Number(
|
|
124
|
+
layerCTX.measureText(legendCanvases[layer.uid].displayName).width
|
|
125
|
+
) + 50;
|
|
126
|
+
|
|
127
|
+
//check if layer has a canvas
|
|
128
|
+
if (legendCanvases[layer.uid].canvas.length) {
|
|
129
|
+
//get largest width
|
|
130
|
+
const largestWidth = max(legendCanvases[layer.uid].widths);
|
|
131
|
+
|
|
132
|
+
//set canvas dimensions
|
|
133
|
+
layerCanvas.width =
|
|
134
|
+
titleWidth > largestWidth ? titleWidth : largestWidth;
|
|
135
|
+
layerCanvas.height = sum(legendCanvases[layer.uid].heights) + 70;
|
|
136
|
+
|
|
137
|
+
//set background
|
|
138
|
+
layerCTX.fillStyle = "white";
|
|
139
|
+
layerCTX.fillRect(0, 0, layerCanvas.width, layerCanvas.height);
|
|
140
|
+
|
|
141
|
+
//add header
|
|
142
|
+
layerCTX.font = "bold 12px Arial";
|
|
143
|
+
layerCTX.fillStyle = "black";
|
|
144
|
+
layerCTX.fillText(legendCanvases[layer.uid].displayName, 0, 15);
|
|
145
|
+
|
|
146
|
+
let dy = 20; //starting y position
|
|
147
|
+
|
|
148
|
+
legendCanvases[layer.uid].canvas.forEach((item) => {
|
|
149
|
+
layerCTX.drawImage(item, 0, dy);
|
|
150
|
+
dy += Number(item.height);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
if(legendCanvases[layer.uid].attributions) {
|
|
154
|
+
dy += 20;
|
|
155
|
+
layerCTX.font = "bold 12px Arial";
|
|
156
|
+
layerCTX.fillStyle = "black";
|
|
157
|
+
layerCTX.fillText(`Credits: ${legendCanvases[layer.uid].attributions}`, 0, dy);
|
|
158
|
+
dy += 50;
|
|
159
|
+
layerCTX.fillText(``, 0, dy);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
canvases.push(layerCanvas);
|
|
163
|
+
} else {
|
|
164
|
+
//set canvas dimensions
|
|
165
|
+
layerCanvas.width = titleWidth;
|
|
166
|
+
layerCanvas.height = 90;
|
|
167
|
+
|
|
168
|
+
//set background
|
|
169
|
+
layerCTX.fillStyle = "white";
|
|
170
|
+
layerCTX.fillRect(0, 0, layerCanvas.width, layerCanvas.height);
|
|
171
|
+
|
|
172
|
+
//add header
|
|
173
|
+
layerCTX.font = "bold 12px Arial";
|
|
174
|
+
layerCTX.fillStyle = "black";
|
|
175
|
+
layerCTX.fillText(legendCanvases[layer.uid].displayName, 0, 15);
|
|
176
|
+
|
|
177
|
+
//add text
|
|
178
|
+
layerCTX.font = "10px Arial";
|
|
179
|
+
layerCTX.fillStyle = "black";
|
|
180
|
+
layerCTX.fillText("N/A", 5, 30);
|
|
181
|
+
|
|
182
|
+
if(legendCanvases[layer.uid].attributions) {
|
|
183
|
+
let dy = 20;
|
|
184
|
+
layerCTX.font = "bold 12px Arial";
|
|
185
|
+
layerCTX.fillStyle = "black";
|
|
186
|
+
layerCTX.fillText(`Credits: ${legendCanvases[layer.uid].attributions}`, 0, dy);
|
|
187
|
+
dy += 50;
|
|
188
|
+
layerCTX.fillText(``, 0, dy);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
canvases.push(layerCanvas);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
//calculate width & height for legend canvas.
|
|
197
|
+
let legendCanvasHeight = 0;
|
|
198
|
+
let legendCanvasWidth = 0;
|
|
199
|
+
canvases.forEach((canvas) => {
|
|
200
|
+
legendCanvasHeight += canvas.height;
|
|
201
|
+
legendCanvasWidth =
|
|
202
|
+
legendCanvasWidth > canvas.width ? legendCanvasWidth : canvas.width;
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
//set legend canvas dimensions
|
|
206
|
+
legendCanvas.height = legendCanvasHeight;
|
|
207
|
+
legendCanvas.width = legendCanvasWidth;
|
|
208
|
+
|
|
209
|
+
//set legend canvas background
|
|
210
|
+
legendCTX.fillStyle = "white";
|
|
211
|
+
legendCTX.fillRect(0, 0, legendCanvas.width, legendCanvas.height);
|
|
212
|
+
|
|
213
|
+
//add layer canvases to legend canvas
|
|
214
|
+
let legendDY = 0;
|
|
215
|
+
canvases.forEach((canvas) => {
|
|
216
|
+
legendCTX.drawImage(canvas, 0, legendDY);
|
|
217
|
+
legendDY += Number(canvas.height);
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
dispatch({
|
|
221
|
+
type: "PRINT_LEGEND_CANVAS_GENERATED",
|
|
222
|
+
payload: {
|
|
223
|
+
legendCanvas: legendCanvas,
|
|
224
|
+
_shouldExport: true,
|
|
225
|
+
},
|
|
226
|
+
});
|
|
227
|
+
},
|
|
228
|
+
doPrintMap: () => ({ dispatch, store }) => {
|
|
229
|
+
if (window.navigator.msSaveBlob) {
|
|
230
|
+
// check browser support
|
|
231
|
+
dispatch({
|
|
232
|
+
type: "PRINT_ERROR",
|
|
233
|
+
payload: {
|
|
234
|
+
notification: {
|
|
235
|
+
title: "Print Notification",
|
|
236
|
+
message: "Browser not supported.",
|
|
237
|
+
level: "danger",
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
});
|
|
241
|
+
store.doBasicToolbarDeactivate();
|
|
242
|
+
} else {
|
|
243
|
+
dispatch({
|
|
244
|
+
type: "PRINT_LOADING",
|
|
245
|
+
payload: {
|
|
246
|
+
notification: {
|
|
247
|
+
title: "Print Notification",
|
|
248
|
+
message: "Loading Image..",
|
|
249
|
+
level: "success",
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
});
|
|
253
|
+
const map = store.selectMap();
|
|
254
|
+
|
|
255
|
+
map.once("rendercomplete", () => {
|
|
256
|
+
//Draw map canvas
|
|
257
|
+
store.doSetMapCanvas(map);
|
|
258
|
+
|
|
259
|
+
//Draw legend canvas
|
|
260
|
+
store.doSetLegendCanvas();
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
//https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html#renderSync
|
|
264
|
+
map.renderSync();
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
doPrintMapExport: () => ({ dispatch, store }) => {
|
|
268
|
+
dispatch({
|
|
269
|
+
type: "PRINT_EXPORTING",
|
|
270
|
+
payload: {
|
|
271
|
+
_shouldExport: false,
|
|
272
|
+
},
|
|
273
|
+
});
|
|
274
|
+
let print = document.createElement("a");
|
|
275
|
+
const mapCanvas = store.selectPrintMapCanvas();
|
|
276
|
+
const legendCanvas = store.selectPrintLegendCanvas();
|
|
277
|
+
|
|
278
|
+
//create single canvas for map and legend
|
|
279
|
+
let canvas = document.createElement("canvas");
|
|
280
|
+
let ctx = canvas.getContext("2d");
|
|
281
|
+
|
|
282
|
+
//set dimensions
|
|
283
|
+
canvas.width = Number(mapCanvas.width) + Number(legendCanvas.width);
|
|
284
|
+
canvas.height =
|
|
285
|
+
Number(mapCanvas.height) > Number(legendCanvas.height)
|
|
286
|
+
? Number(mapCanvas.height)
|
|
287
|
+
: Number(legendCanvas.height);
|
|
288
|
+
|
|
289
|
+
//set background
|
|
290
|
+
ctx.fillStyle = "white";
|
|
291
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
292
|
+
|
|
293
|
+
ctx.drawImage(mapCanvas, 0, 0);
|
|
294
|
+
|
|
295
|
+
if(legendCanvas.height !== 0 && legendCanvas.width !== 0) {
|
|
296
|
+
ctx.drawImage(legendCanvas, mapCanvas.width, 0); //draw legend to the right of mapCanvas
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
print.download = "map.png";
|
|
300
|
+
print.href = canvas.toDataURL();
|
|
301
|
+
document.body.appendChild(print);
|
|
302
|
+
print.click();
|
|
303
|
+
print.remove();
|
|
304
|
+
|
|
305
|
+
store.doBasicToolbarDeactivate();
|
|
306
|
+
},
|
|
307
|
+
selectPrintMapCanvas: (state) => {
|
|
308
|
+
return state.print.mapCanvas;
|
|
309
|
+
},
|
|
310
|
+
selectPrintLegendCanvas: (state) => {
|
|
311
|
+
return state.print.legendCanvas;
|
|
312
|
+
},
|
|
313
|
+
reactLegendShouldExport: (state) => {
|
|
314
|
+
if (state.print._shouldExport) return { actionCreator: "doPrintMapExport" };
|
|
315
|
+
},
|
|
316
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { connect } from "../../utils/redux-bundler-react";
|
|
3
|
+
import { BasicToolbarButton } from "../../application-controls";
|
|
4
|
+
|
|
5
|
+
const Button = ({ doPrintMap }) => {
|
|
6
|
+
return (
|
|
7
|
+
<BasicToolbarButton
|
|
8
|
+
enabled={true}
|
|
9
|
+
iconClass="mdi mdi-printer"
|
|
10
|
+
title="Print Map"
|
|
11
|
+
onDeactivate={() => {}}
|
|
12
|
+
onActivate={doPrintMap}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default connect("doPrintMap", Button);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import bundle from "./bundle";
|
|
2
|
+
import Button from "./button";
|
|
3
|
+
|
|
4
|
+
const plugin = {
|
|
5
|
+
pluginName: "Print Map",
|
|
6
|
+
enabled: true,
|
|
7
|
+
bundle: bundle,
|
|
8
|
+
components: [
|
|
9
|
+
{
|
|
10
|
+
component: Button,
|
|
11
|
+
region: "basic-toolbar",
|
|
12
|
+
sortOrder: 200
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default plugin;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import ResourcesModal from "./resources-modal";
|
|
2
|
+
import { createResourceGroup } from "../../openlayers-utils/resource-utilities";
|
|
3
|
+
|
|
4
|
+
// const url = `${process.env.REACT_APP_FUDS_RESOURCES_URL}`;
|
|
5
|
+
const url = `${import.meta.env.VITE_APP_FUDS_RESOURCES_URL}`;
|
|
6
|
+
const defaultHtml = [
|
|
7
|
+
{
|
|
8
|
+
name: "FUDSMIS Portal - Default",
|
|
9
|
+
url: "https://fudsportal.usace.army.mil/",
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: "IPaC Information for Planning and Consultation - Default",
|
|
13
|
+
url: "https://ipac.ecosphere.fws.gov/",
|
|
14
|
+
},
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
name: "resources",
|
|
19
|
+
|
|
20
|
+
getReducer: () => {
|
|
21
|
+
const initialData = {
|
|
22
|
+
items: defaultHtml,
|
|
23
|
+
groups: {},
|
|
24
|
+
renderModal: false,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return (state = initialData, { type, payload }) => {
|
|
28
|
+
switch (type) {
|
|
29
|
+
case "RESOURCES_LOAD_TEST_DATA":
|
|
30
|
+
case "RESOURCES_LOAD_PRODUCTION_DATA":
|
|
31
|
+
case "RESOURCES_MODAL_WINDOW_OPENED":
|
|
32
|
+
return Object.assign({}, state, payload);
|
|
33
|
+
default:
|
|
34
|
+
return state;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
doGetResourceData:
|
|
40
|
+
() =>
|
|
41
|
+
({ dispatch, store, anonGet }) => {
|
|
42
|
+
anonGet(url, (err, response, body) => {
|
|
43
|
+
if (err || response.statusCode !== 200) {
|
|
44
|
+
// On Error Load Test Data
|
|
45
|
+
dispatch({
|
|
46
|
+
type: "RESOURCES_LOAD_TEST_DATA",
|
|
47
|
+
payload: { items: defaultHtml, groups: {}, renderModal: true },
|
|
48
|
+
});
|
|
49
|
+
} else {
|
|
50
|
+
try {
|
|
51
|
+
console.log("Production Resource Data");
|
|
52
|
+
let data = JSON.parse(body);
|
|
53
|
+
let items = data.items;
|
|
54
|
+
let groups = {};
|
|
55
|
+
groups = createResourceGroup(items);
|
|
56
|
+
console.log(items);
|
|
57
|
+
console.log(groups);
|
|
58
|
+
dispatch({
|
|
59
|
+
type: "RESOURCES_LOAD_PRODUCTION_DATA",
|
|
60
|
+
payload: { groups: groups, items: items, renderModal: true },
|
|
61
|
+
});
|
|
62
|
+
} catch (err) {
|
|
63
|
+
// alert(" ! ! ! ERROR IN CATCH BLOCK ! ! ! ")
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
doOpenModalResources:
|
|
70
|
+
() =>
|
|
71
|
+
({ dispatch, store }) => {
|
|
72
|
+
store.doModalOpen({
|
|
73
|
+
children: [ResourcesModal],
|
|
74
|
+
options: {},
|
|
75
|
+
openedBy: "ResourcesButton",
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
dispatch({
|
|
79
|
+
type: "RESOURCES_MODAL_WINDOW_OPENED",
|
|
80
|
+
payload: { renderModal: false },
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
selectResourceItems: (state) => {
|
|
85
|
+
return state.resources.items;
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
selectResourceGroups: (state) => {
|
|
89
|
+
return state.resources.groups;
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
reactRenderResourceModal: (state) => {
|
|
93
|
+
if (state.resources.renderModal === true)
|
|
94
|
+
return { actionCreator: "doOpenModalResources" };
|
|
95
|
+
},
|
|
96
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import bundle from './bundle';
|
|
2
|
+
import resourcesButton from './resources-button';
|
|
3
|
+
|
|
4
|
+
const plugin = {
|
|
5
|
+
pluginName: 'resources',
|
|
6
|
+
enabled: true,
|
|
7
|
+
bundle: bundle,
|
|
8
|
+
components:[{
|
|
9
|
+
component: resourcesButton,
|
|
10
|
+
region: 'right-sidebar-top',
|
|
11
|
+
sortOrder: 130,
|
|
12
|
+
}],
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default plugin;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { connect } from "../../utils/redux-bundler-react";
|
|
3
|
+
import { SidebarButton } from "../../application-controls/index";
|
|
4
|
+
import ResourcesModal from "./resources-modal";
|
|
5
|
+
|
|
6
|
+
class ResourcesButton extends React.Component {
|
|
7
|
+
constructor(props) {
|
|
8
|
+
super(props);
|
|
9
|
+
this.handleClick = this.handleClick.bind(this);
|
|
10
|
+
this.openModalResources = this.openModalResources.bind(this);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
openModalResources() {
|
|
14
|
+
const { doModalOpen } = this.props;
|
|
15
|
+
doModalOpen({
|
|
16
|
+
children: [ResourcesModal],
|
|
17
|
+
options: {},
|
|
18
|
+
openedBy: "ResourcesButton",
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
handleClick() {
|
|
23
|
+
const { doGetResourceData } = this.props;
|
|
24
|
+
// this.openModalResources(); just for testing
|
|
25
|
+
doGetResourceData();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
render() {
|
|
29
|
+
return (
|
|
30
|
+
<SidebarButton
|
|
31
|
+
iconClass="mdi mdi-library"
|
|
32
|
+
label="Resources"
|
|
33
|
+
title="Resources"
|
|
34
|
+
onClick={this.handleClick}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default connect("doModalOpen", "doGetResourceData", ResourcesButton);
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { connect } from "../../utils/redux-bundler-react";
|
|
3
|
+
|
|
4
|
+
class ResourcesModal extends React.Component {
|
|
5
|
+
constructor(props) {
|
|
6
|
+
super(props);
|
|
7
|
+
this.state = {};
|
|
8
|
+
this.close = this.close.bind(this);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
close() {
|
|
12
|
+
const { doModalClose } = this.props;
|
|
13
|
+
doModalClose();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
render() {
|
|
17
|
+
function filterResourceItems(resourceItems, groupId) {
|
|
18
|
+
let items = resourceItems.filter(
|
|
19
|
+
(item) =>
|
|
20
|
+
item.resource_group_id !== null && item.resource_group_id === groupId
|
|
21
|
+
);
|
|
22
|
+
items = items.sort((a, b) => a.resource_sort - b.resource_sort);
|
|
23
|
+
return items;
|
|
24
|
+
}
|
|
25
|
+
const { theme, doGetResourceData, resourceItems, resourceGroups } =
|
|
26
|
+
this.props;
|
|
27
|
+
let groups = [];
|
|
28
|
+
|
|
29
|
+
groups = resourceGroups.map((item) => {
|
|
30
|
+
// let url =
|
|
31
|
+
// `${process.env.REACT_APP_FUDS_RESOURCE_GROUP_IMAGE_URL}` + item.groupId;
|
|
32
|
+
let url =
|
|
33
|
+
`${import.meta.env.VITE_APP_FUDS_RESOURCE_GROUP_IMAGE_URL}` +
|
|
34
|
+
item.groupId;
|
|
35
|
+
// let documentURL = `${process.env.REACT_APP_FUDS_RESOURCE_DOCUMENT_URL}`;
|
|
36
|
+
let documentURL = `${
|
|
37
|
+
import.meta.env.VITE_APP_FUDS_RESOURCE_DOCUMENT_URL
|
|
38
|
+
}`;
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<div
|
|
42
|
+
key={"image" + item.groupId}
|
|
43
|
+
style={{ paddingLeft: "25px", fontSize: "20px", fontWeight: "bold" }}
|
|
44
|
+
>
|
|
45
|
+
<span key={"span" + item.groupId}>
|
|
46
|
+
<img
|
|
47
|
+
key={"imageID" + item.groupId}
|
|
48
|
+
src={url}
|
|
49
|
+
width="50px"
|
|
50
|
+
height="50px"
|
|
51
|
+
onError={({ currentTarget }) => {
|
|
52
|
+
currentTarget.onerror = null;
|
|
53
|
+
currentTarget.style.display = "none";
|
|
54
|
+
}}
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
{item.groupName}
|
|
58
|
+
</span>
|
|
59
|
+
<br></br>
|
|
60
|
+
<div
|
|
61
|
+
key={"itemDivID" + item.groupId}
|
|
62
|
+
style={{ paddingLeft: "25px", fontSize: "16px" }}
|
|
63
|
+
>
|
|
64
|
+
<table className="table" key={"tableID" + item.groupId}>
|
|
65
|
+
<thead>
|
|
66
|
+
<tr key={item.groupId + 7777777777}>
|
|
67
|
+
<th className="col-md-6" style={{ paddingRight: "40px" }}>
|
|
68
|
+
Description
|
|
69
|
+
</th>
|
|
70
|
+
<th className="col-md-6">URL</th>
|
|
71
|
+
</tr>
|
|
72
|
+
</thead>
|
|
73
|
+
<tbody>
|
|
74
|
+
{filterResourceItems(resourceItems, item.groupId).map(
|
|
75
|
+
(item) => (
|
|
76
|
+
<tr key={item.resource_id}>
|
|
77
|
+
<td className="col-md-6" style={{ paddingRight: "40px" }}>
|
|
78
|
+
{item.description}
|
|
79
|
+
</td>
|
|
80
|
+
<td className="col-md-6">
|
|
81
|
+
<a
|
|
82
|
+
href={item.url}
|
|
83
|
+
target="_blank"
|
|
84
|
+
rel="noreferrer nofollow noopener"
|
|
85
|
+
download="TEST_FILE"
|
|
86
|
+
>
|
|
87
|
+
{item.name}
|
|
88
|
+
</a>
|
|
89
|
+
</td>
|
|
90
|
+
{/* <td className="col-sm-4">
|
|
91
|
+
<a href={documentURL+item.resource_id} target="_blank" rel="noreferrer nofollow noopener" >{item.document_name}</a>
|
|
92
|
+
</td> */}
|
|
93
|
+
</tr>
|
|
94
|
+
)
|
|
95
|
+
)}
|
|
96
|
+
</tbody>
|
|
97
|
+
</table>
|
|
98
|
+
</div>
|
|
99
|
+
<br></br>
|
|
100
|
+
</div>
|
|
101
|
+
);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<div>
|
|
106
|
+
<div className={"cm-modal-header " + theme}>Resources</div>
|
|
107
|
+
<div>
|
|
108
|
+
<div>
|
|
109
|
+
<br></br>
|
|
110
|
+
</div>
|
|
111
|
+
<div>
|
|
112
|
+
<div
|
|
113
|
+
style={{
|
|
114
|
+
overflow: "auto scroll",
|
|
115
|
+
width: "875px",
|
|
116
|
+
height: "390px",
|
|
117
|
+
whiteSpace: "pre-wrap",
|
|
118
|
+
paddingLeft: "25px",
|
|
119
|
+
}}
|
|
120
|
+
>
|
|
121
|
+
{groups}
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
|
|
126
|
+
<div className="cm-modal-footer">
|
|
127
|
+
<br></br>
|
|
128
|
+
<br></br>
|
|
129
|
+
<br></br>
|
|
130
|
+
<button
|
|
131
|
+
style={{ textAlign: "left" }}
|
|
132
|
+
type="Close"
|
|
133
|
+
className={"cm-btn cm-btn-theme " + theme}
|
|
134
|
+
onClick={this.close}
|
|
135
|
+
>
|
|
136
|
+
Close
|
|
137
|
+
</button>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export default connect(
|
|
145
|
+
"selectTheme",
|
|
146
|
+
"selectResourceItems",
|
|
147
|
+
"selectResourceGroups",
|
|
148
|
+
"doModalClose",
|
|
149
|
+
"doGetResourceData",
|
|
150
|
+
ResourcesModal
|
|
151
|
+
);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import RotateNorthButton from './rotate-north-button';
|
|
2
|
+
|
|
3
|
+
const plugin = {
|
|
4
|
+
pluginName: 'NorthButton',
|
|
5
|
+
enabled: true,
|
|
6
|
+
components:[{
|
|
7
|
+
component: RotateNorthButton,
|
|
8
|
+
region: 'right-sidebar-top',
|
|
9
|
+
sortOrder: 20
|
|
10
|
+
}]
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default plugin;
|