@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.
Files changed (367) hide show
  1. package/README.md +33 -0
  2. package/dist/corpsmap.css +1 -0
  3. package/dist/corpsmap.es.js +63856 -0
  4. package/dist/corpsmap.umd.js +384 -0
  5. package/dist/vite.svg +1 -0
  6. package/package.json +73 -32
  7. package/src/App.css +42 -0
  8. package/src/App.jsx +12 -0
  9. package/src/application-bundles/_create-container-bundle.js +102 -0
  10. package/src/application-bundles/api-bundle.js +76 -0
  11. package/src/application-bundles/basic-toolbar-bundle.js +57 -0
  12. package/src/application-bundles/config-bundle.js +38 -0
  13. package/src/application-bundles/create-ol-map-bundle.jsx +278 -0
  14. package/src/application-bundles/export-bundle.js +125 -0
  15. package/src/application-bundles/identify-bundle.js +119 -0
  16. package/src/application-bundles/index.js +53 -0
  17. package/src/application-bundles/map-basemap-bundle.js +73 -0
  18. package/src/application-bundles/map-core-bundle.js +25 -0
  19. package/src/application-bundles/map-drawing-bundle.js +120 -0
  20. package/src/application-bundles/map-interaction-bundle.js +50 -0
  21. package/src/application-bundles/map-layers-bundle.js +816 -0
  22. package/src/application-bundles/map-proj-bundle.js +144 -0
  23. package/src/application-bundles/map-view-bundle.jsx +334 -0
  24. package/src/application-bundles/modal-window-bundle.js +5 -0
  25. package/src/application-bundles/notification-bundle.js +56 -0
  26. package/src/application-bundles/plugin-bundle.js +180 -0
  27. package/src/application-bundles/primary-panel-bundle.js +85 -0
  28. package/src/application-bundles/search-bundle.js +122 -0
  29. package/src/application-bundles/south-region-bundle.js +96 -0
  30. package/src/application-bundles/theme-bundle.js +45 -0
  31. package/src/application-bundles/vertical-layout-bundle.js +88 -0
  32. package/src/application-bundles/viewport-bundle.js +43 -0
  33. package/src/application-bundles/window-location-bundle.js +90 -0
  34. package/src/application-bundles-old/auth-bundle.js +130 -0
  35. package/src/application-bundles-old/config-bundle.js +29 -0
  36. package/src/application-bundles-old/ui-bundle.js +406 -0
  37. package/src/application-containers/basic-toolbar.jsx +24 -0
  38. package/src/application-containers/corpsmap.jsx +91 -0
  39. package/src/application-containers/left-sidebar.jsx +43 -0
  40. package/src/application-containers/lower-right-toolbar.jsx +29 -0
  41. package/src/application-containers/map.jsx +57 -0
  42. package/src/application-containers/modal-window.jsx +34 -0
  43. package/src/application-containers/north-region.jsx +26 -0
  44. package/src/application-containers/notification-pane.jsx +37 -0
  45. package/src/application-containers/notification-quadrant.jsx +20 -0
  46. package/src/application-containers/notification.jsx +91 -0
  47. package/src/application-containers/primary-panel.jsx +94 -0
  48. package/src/application-containers/right-sidebar.jsx +44 -0
  49. package/src/application-containers/south-region-tab.jsx +60 -0
  50. package/src/application-containers/south-region.jsx +75 -0
  51. package/src/application-containers/upper-right-toolbar.jsx +28 -0
  52. package/src/application-controls/basic-toolbar-button.jsx +124 -0
  53. package/src/application-controls/basic-toolbar-menu-divider.jsx +11 -0
  54. package/src/application-controls/basic-toolbar-menu-item.jsx +91 -0
  55. package/src/application-controls/basic-toolbar-menu-up.jsx +13 -0
  56. package/src/application-controls/basic-toolbar-menu.jsx +13 -0
  57. package/src/application-controls/basic-toolbar-submenu.jsx +14 -0
  58. package/src/application-controls/index.jsx +35 -0
  59. package/src/application-controls/loading-indicator.jsx +19 -0
  60. package/src/application-controls/search-input.jsx +55 -0
  61. package/src/application-controls/search-results-list-item.jsx +50 -0
  62. package/src/application-controls/search-results-list.jsx +19 -0
  63. package/src/application-controls/sidebar-button.jsx +69 -0
  64. package/src/application-controls/sidebar-panel-opener.jsx +63 -0
  65. package/src/application-controls/tree-list-folder.jsx +46 -0
  66. package/src/application-controls/tree-list-item.jsx +83 -0
  67. package/src/application-controls/tree-list.jsx +35 -0
  68. package/src/application-controls/tree-view.jsx +42 -0
  69. package/src/application-exports/map-provider.jsx +122 -0
  70. package/src/assets/react.svg +1 -0
  71. package/src/config/default-config.js +593 -0
  72. package/src/core-plugins/add-data/add-data-button.jsx +34 -0
  73. package/src/core-plugins/add-data/add-geojson.jsx +47 -0
  74. package/src/core-plugins/add-data/add-kmlfile.jsx +46 -0
  75. package/src/core-plugins/add-data/add-shapefile.jsx +47 -0
  76. package/src/core-plugins/add-data/bundle.js +226 -0
  77. package/src/core-plugins/add-data/index.js +15 -0
  78. package/src/core-plugins/basemap-switcher/basemap-switcher-button.jsx +18 -0
  79. package/src/core-plugins/basemap-switcher/basemap-switcher-list-item.jsx +48 -0
  80. package/src/core-plugins/basemap-switcher/basemap-switcher-list.jsx +37 -0
  81. package/src/core-plugins/basemap-switcher/index.js +13 -0
  82. package/src/core-plugins/bookmarks/bookmark-button.jsx +18 -0
  83. package/src/core-plugins/bookmarks/bookmark-list-item.jsx +79 -0
  84. package/src/core-plugins/bookmarks/bookmark-list.jsx +31 -0
  85. package/src/core-plugins/bookmarks/bookmark-panel.jsx +191 -0
  86. package/src/core-plugins/bookmarks/bundle.js +92 -0
  87. package/src/core-plugins/bookmarks/index.js +15 -0
  88. package/src/core-plugins/catalog/bundle.js +109 -0
  89. package/src/core-plugins/catalog/catalog-button.jsx +33 -0
  90. package/src/core-plugins/catalog/catalog-error-item.jsx +14 -0
  91. package/src/core-plugins/catalog/catalog-list-item-loader.jsx +12 -0
  92. package/src/core-plugins/catalog/catalog-list-item.jsx +118 -0
  93. package/src/core-plugins/catalog/catalog-list.jsx +78 -0
  94. package/src/core-plugins/catalog/catalog-modal-window.jsx +100 -0
  95. package/src/core-plugins/catalog/index.js +15 -0
  96. package/src/core-plugins/change-log/bundle.js +180 -0
  97. package/src/core-plugins/change-log/change-log-button.jsx +40 -0
  98. package/src/core-plugins/change-log/change-log-modal.jsx +190 -0
  99. package/src/core-plugins/change-log/index.js +15 -0
  100. package/src/core-plugins/change-log/select-district.jsx +73 -0
  101. package/src/core-plugins/contact-form/bundle.js +239 -0
  102. package/src/core-plugins/contact-form/index.js +17 -0
  103. package/src/core-plugins/contact-form/question-button.jsx +36 -0
  104. package/src/core-plugins/contact-form/question-modal.jsx +215 -0
  105. package/src/core-plugins/coordinate-display/bundle.jsx +269 -0
  106. package/src/core-plugins/coordinate-display/coordinate-display-bar.jsx +66 -0
  107. package/src/core-plugins/coordinate-display/coordinate-display-proj-item.jsx +60 -0
  108. package/src/core-plugins/coordinate-display/coordinate-display-settings.jsx +173 -0
  109. package/src/core-plugins/coordinate-display/coordinate-interaction-bar.jsx +60 -0
  110. package/src/core-plugins/coordinate-display/coordinate-lat-lon-input.jsx +35 -0
  111. package/src/core-plugins/coordinate-display/coordinate-popup.jsx +27 -0
  112. package/src/core-plugins/coordinate-display/index.js +20 -0
  113. package/src/core-plugins/draw-tools/create-draw-bundle.js +242 -0
  114. package/src/core-plugins/draw-tools/draw-button.jsx +204 -0
  115. package/src/core-plugins/draw-tools/draw-label-bundle.js +116 -0
  116. package/src/core-plugins/draw-tools/draw-modify-bundle.js +156 -0
  117. package/src/core-plugins/draw-tools/draw-save-bundle.jsx +181 -0
  118. package/src/core-plugins/draw-tools/draw-styles.js +110 -0
  119. package/src/core-plugins/draw-tools/draw-tool-item.jsx +67 -0
  120. package/src/core-plugins/draw-tools/index.js +34 -0
  121. package/src/core-plugins/draw-tools-old/create-draw-bundle.js +222 -0
  122. package/src/core-plugins/draw-tools-old/draw-button.js +189 -0
  123. package/src/core-plugins/draw-tools-old/draw-label-bundle.js +116 -0
  124. package/src/core-plugins/draw-tools-old/draw-modify-bundle.js +156 -0
  125. package/src/core-plugins/draw-tools-old/draw-styles.js +110 -0
  126. package/src/core-plugins/draw-tools-old/draw-tool-item.js +67 -0
  127. package/src/core-plugins/draw-tools-old/index.js +32 -0
  128. package/src/core-plugins/editor/bundle.js +472 -0
  129. package/src/core-plugins/editor/date-editor.js +63 -0
  130. package/src/core-plugins/editor/date-formatter.js +17 -0
  131. package/src/core-plugins/editor/editor-base.js +29 -0
  132. package/src/core-plugins/editor/editor-button.js +224 -0
  133. package/src/core-plugins/editor/editor-table.js +151 -0
  134. package/src/core-plugins/editor/index.js +15 -0
  135. package/src/core-plugins/editor/number-editor.js +57 -0
  136. package/src/core-plugins/editor/string-editor.js +42 -0
  137. package/src/core-plugins/geocoder/bundle.jsx +186 -0
  138. package/src/core-plugins/geocoder/index.js +15 -0
  139. package/src/core-plugins/geocoder/overlay.jsx +30 -0
  140. package/src/core-plugins/geocoder/search-bar.js copy.save +123 -0
  141. package/src/core-plugins/geocoder/search-bar.jsx +121 -0
  142. package/src/core-plugins/identify/bundle.jsx +709 -0
  143. package/src/core-plugins/identify/identify-buffer-section.jsx +52 -0
  144. package/src/core-plugins/identify/identify-buffer-settings.jsx +48 -0
  145. package/src/core-plugins/identify/identify-button.jsx +100 -0
  146. package/src/core-plugins/identify/identify-details-table.jsx +121 -0
  147. package/src/core-plugins/identify/identify-details.js +69 -0
  148. package/src/core-plugins/identify/identify-popup.jsx +136 -0
  149. package/src/core-plugins/identify/identify-sidebar-list-item.jsx +106 -0
  150. package/src/core-plugins/identify/identify-sidebar-list.jsx +63 -0
  151. package/src/core-plugins/identify/identify-sidebar.jsx +103 -0
  152. package/src/core-plugins/identify/identify-table-cell.jsx +49 -0
  153. package/src/core-plugins/identify/identify-table.jsx +319 -0
  154. package/src/core-plugins/identify/index.js +27 -0
  155. package/src/core-plugins/identify/listeners/arcgis.js +158 -0
  156. package/src/core-plugins/identify/listeners/geojson.jsx +164 -0
  157. package/src/core-plugins/identify/listeners/raster.js +89 -0
  158. package/src/core-plugins/identify/listeners/vector.jsx +106 -0
  159. package/src/core-plugins/identify-arcgis-rest/bundle.js +169 -0
  160. package/src/core-plugins/identify-arcgis-rest/index.js +10 -0
  161. package/src/core-plugins/identify-cm/bundle.js +82 -0
  162. package/src/core-plugins/identify-cm/index.js +10 -0
  163. package/src/core-plugins/identify-geojson/bundle.js +164 -0
  164. package/src/core-plugins/identify-geojson/index.js +10 -0
  165. package/src/core-plugins/identify-raster/bundle.js +89 -0
  166. package/src/core-plugins/identify-raster/index.js +10 -0
  167. package/src/core-plugins/identify-vector/bundle.jsx +135 -0
  168. package/src/core-plugins/identify-vector/index.js +10 -0
  169. package/src/core-plugins/identify-wms/bundle.js +138 -0
  170. package/src/core-plugins/identify-wms/index.js +10 -0
  171. package/src/core-plugins/legend/bundle.js +1044 -0
  172. package/src/core-plugins/legend/index.js +17 -0
  173. package/src/core-plugins/legend/legend-button.jsx +18 -0
  174. package/src/core-plugins/legend/legend-header.jsx +43 -0
  175. package/src/core-plugins/legend/legend-item-multiple.jsx +32 -0
  176. package/src/core-plugins/legend/legend-item.jsx +20 -0
  177. package/src/core-plugins/legend/legend-panel.jsx +73 -0
  178. package/src/core-plugins/login/index.js +13 -0
  179. package/src/core-plugins/login/login-button.jsx +49 -0
  180. package/src/core-plugins/map-loading-indicator/bundle.js +31 -0
  181. package/src/core-plugins/map-loading-indicator/index.js +17 -0
  182. package/src/core-plugins/map-loading-indicator/loading-indicator.jsx +30 -0
  183. package/src/core-plugins/measure-tools/bundle.js +286 -0
  184. package/src/core-plugins/measure-tools/index.js +15 -0
  185. package/src/core-plugins/measure-tools/measure-options.jsx +89 -0
  186. package/src/core-plugins/measure-tools/measure-tools-button.jsx +129 -0
  187. package/src/core-plugins/measure-tools/measure-utils.js +76 -0
  188. package/src/core-plugins/permalink/bundle.js +57 -0
  189. package/src/core-plugins/permalink/index.js +15 -0
  190. package/src/core-plugins/permalink/permalink-button.jsx +38 -0
  191. package/src/core-plugins/permalink/permalink-modal.jsx +67 -0
  192. package/src/core-plugins/print-map/bundle.jsx +316 -0
  193. package/src/core-plugins/print-map/button.jsx +17 -0
  194. package/src/core-plugins/print-map/index.js +17 -0
  195. package/src/core-plugins/resources/bundle.js +96 -0
  196. package/src/core-plugins/resources/index.js +15 -0
  197. package/src/core-plugins/resources/resources-button.jsx +40 -0
  198. package/src/core-plugins/resources/resources-modal.jsx +151 -0
  199. package/src/core-plugins/rotate-north/index.js +13 -0
  200. package/src/core-plugins/rotate-north/rotate-north-button.jsx +38 -0
  201. package/src/core-plugins/theme-switcher/bundle.js +16 -0
  202. package/src/core-plugins/theme-switcher/index.js +15 -0
  203. package/src/core-plugins/theme-switcher/theme-list-item.jsx +25 -0
  204. package/src/core-plugins/theme-switcher/theme-list.jsx +28 -0
  205. package/src/core-plugins/theme-switcher/theme-switcher-button.jsx +18 -0
  206. package/src/core-plugins/theme-switcher/themes.js +121 -0
  207. package/src/core-plugins/three-d/index.js +13 -0
  208. package/src/core-plugins/three-d/three-d-button.jsx +44 -0
  209. package/src/core-plugins/tree-view/boundary-drop-target.jsx +42 -0
  210. package/src/core-plugins/tree-view/bundle.js +513 -0
  211. package/src/core-plugins/tree-view/dataset-info-modal.jsx +141 -0
  212. package/src/core-plugins/tree-view/dataset-legend.jsx +122 -0
  213. package/src/core-plugins/tree-view/defaults-container.jsx +27 -0
  214. package/src/core-plugins/tree-view/download-bundle.js +156 -0
  215. package/src/core-plugins/tree-view/favorites-container.jsx +27 -0
  216. package/src/core-plugins/tree-view/index.js +25 -0
  217. package/src/core-plugins/tree-view/layer-subpanel/defaults-toggle.jsx +28 -0
  218. package/src/core-plugins/tree-view/layer-subpanel/download-layer.jsx +54 -0
  219. package/src/core-plugins/tree-view/layer-subpanel/favorites-toggle.jsx +28 -0
  220. package/src/core-plugins/tree-view/layer-subpanel/label-toggle.jsx +39 -0
  221. package/src/core-plugins/tree-view/layer-subpanel/layer-subpanel.jsx +179 -0
  222. package/src/core-plugins/tree-view/layer-subpanel/natick-rgb-options.jsx +66 -0
  223. package/src/core-plugins/tree-view/layer-subpanel/natick-rgb.jsx +112 -0
  224. package/src/core-plugins/tree-view/layer-subpanel/opacity-slider.jsx +51 -0
  225. package/src/core-plugins/tree-view/layer-subpanel/remove-layer.jsx +75 -0
  226. package/src/core-plugins/tree-view/tree-list-container.jsx +22 -0
  227. package/src/core-plugins/tree-view/tree-list-item-dataset.jsx +174 -0
  228. package/src/core-plugins/tree-view/tree-list-item-folder.jsx +161 -0
  229. package/src/core-plugins/tree-view/tree-list-item.jsx +35 -0
  230. package/src/core-plugins/tree-view/tree-list.jsx +37 -0
  231. package/src/core-plugins/tree-view/tree-view-button.jsx +18 -0
  232. package/src/core-plugins/tree-view/tree-view-panel.jsx +139 -0
  233. package/src/core-plugins/tree-view/tree-view-toolbar/add-all.jsx +28 -0
  234. package/src/core-plugins/tree-view/tree-view-toolbar/defaults.jsx +40 -0
  235. package/src/core-plugins/tree-view/tree-view-toolbar/favorites.jsx +40 -0
  236. package/src/core-plugins/tree-view/tree-view-toolbar/remove-all.jsx +28 -0
  237. package/src/core-plugins/tree-view/tree-view-toolbar/toggle-expand.jsx +47 -0
  238. package/src/core-plugins/tree-view/tree-view-toolbar/toggle-filter.jsx +39 -0
  239. package/src/core-plugins/vector-search/bundle.js +96 -0
  240. package/src/core-plugins/vector-search/index.js +10 -0
  241. package/src/core-plugins/zoom-home/bundle.js +77 -0
  242. package/src/core-plugins/zoom-home/index.js +19 -0
  243. package/src/core-plugins/zoom-home/zoom-home-button.jsx +57 -0
  244. package/src/core-plugins/zoom-in-out/index.js +23 -0
  245. package/src/core-plugins/zoom-in-out/zoom-in-button.jsx +28 -0
  246. package/src/core-plugins/zoom-in-out/zoom-out-button.jsx +28 -0
  247. package/src/core-plugins/zoom-level/bundle.js +35 -0
  248. package/src/core-plugins/zoom-level/index.js +17 -0
  249. package/src/core-plugins/zoom-level/zoom-indicator.jsx +34 -0
  250. package/src/core-plugins/zoom-to-box/bundle.js +80 -0
  251. package/src/core-plugins/zoom-to-box/index.jsx +15 -0
  252. package/src/core-plugins/zoom-to-box/zoom-to-box-button.jsx +53 -0
  253. package/src/css/_deprecated_bootstrap/css/bootstrap-paper.css +7606 -0
  254. package/src/css/_deprecated_bootstrap/css/bootstrap-paper.min.css +8083 -0
  255. package/src/css/_deprecated_bootstrap/css/bootstrap-simplex.min.css +7328 -0
  256. package/src/css/_deprecated_bootstrap/css/bootstrap-theme.css +587 -0
  257. package/src/css/_deprecated_bootstrap/css/bootstrap-theme.css.map +1 -0
  258. package/src/css/_deprecated_bootstrap/css/bootstrap-theme.min.css +6 -0
  259. package/src/css/_deprecated_bootstrap/css/bootstrap-theme.min.css.map +1 -0
  260. package/src/css/_deprecated_bootstrap/css/bootstrap.css +7137 -0
  261. package/src/css/_deprecated_bootstrap/css/bootstrap.css.map +142 -0
  262. package/src/css/_deprecated_bootstrap/css/bootstrap.min.css +7132 -0
  263. package/src/css/_deprecated_bootstrap/css/bootstrap.min.css.map +143 -0
  264. package/src/css/_deprecated_bootstrap/fonts/glyphicons-halflings-regular.eot +0 -0
  265. package/src/css/_deprecated_bootstrap/fonts/glyphicons-halflings-regular.svg +288 -0
  266. package/src/css/_deprecated_bootstrap/fonts/glyphicons-halflings-regular.ttf +0 -0
  267. package/src/css/_deprecated_bootstrap/fonts/glyphicons-halflings-regular.woff +0 -0
  268. package/src/css/_deprecated_bootstrap/fonts/glyphicons-halflings-regular.woff2 +0 -0
  269. package/src/css/_deprecated_bootstrap/js/bootstrap.js +2377 -0
  270. package/src/css/_deprecated_bootstrap/js/bootstrap.min.js +7 -0
  271. package/src/css/_deprecated_bootstrap/js/npm.js +13 -0
  272. package/src/css/_deprecated_maki/css/maki.css +304 -0
  273. package/src/css/_deprecated_maki/fonts/maki.eot +0 -0
  274. package/src/css/_deprecated_maki/fonts/maki.svg +98 -0
  275. package/src/css/_deprecated_maki/fonts/maki.ttf +0 -0
  276. package/src/css/_deprecated_maki/fonts/maki.woff +0 -0
  277. package/src/css/bg-colors.css +121 -0
  278. package/src/css/cm-icons/css/cm-icons.css +90 -0
  279. package/src/css/cm-icons/fonts/cm.eot +0 -0
  280. package/src/css/cm-icons/fonts/cm.svg +27 -0
  281. package/src/css/cm-icons/fonts/cm.ttf +0 -0
  282. package/src/css/cm-icons/fonts/cm.woff +0 -0
  283. package/src/css/corpsmap-namespaced.css +9505 -0
  284. package/src/css/corpsmap.css +10178 -0
  285. package/src/css/loading-indicator.css +109 -0
  286. package/src/css/mapskin/OFL.txt +94 -0
  287. package/src/css/mapskin/css/mapskin.css +815 -0
  288. package/src/css/mapskin/css/mapskin.min.css +8 -0
  289. package/src/css/mapskin/fonts/mapskin.eot +0 -0
  290. package/src/css/mapskin/fonts/mapskin.svg +282 -0
  291. package/src/css/mapskin/fonts/mapskin.ttf +0 -0
  292. package/src/css/mapskin/fonts/mapskin.woff +0 -0
  293. package/src/css/mdi/.github/ISSUE_TEMPLATE.md +3 -0
  294. package/src/css/mdi/README.md +24 -0
  295. package/src/css/mdi/bower.json +22 -0
  296. package/src/css/mdi/css/materialdesignicons.css +18654 -0
  297. package/src/css/mdi/css/materialdesignicons.css.map +16 -0
  298. package/src/css/mdi/css/materialdesignicons.min.css +3 -0
  299. package/src/css/mdi/css/materialdesignicons.min.css.map +16 -0
  300. package/src/css/mdi/fonts/materialdesignicons-webfont.eot +0 -0
  301. package/src/css/mdi/fonts/materialdesignicons-webfont.ttf +0 -0
  302. package/src/css/mdi/fonts/materialdesignicons-webfont.woff +0 -0
  303. package/src/css/mdi/fonts/materialdesignicons-webfont.woff2 +0 -0
  304. package/src/css/mdi/license.md +97 -0
  305. package/src/css/mdi/package.json +37 -0
  306. package/src/css/mdi/preview.html +717 -0
  307. package/src/css/mdi/scss/_animated.scss +27 -0
  308. package/src/css/mdi/scss/_core.scss +10 -0
  309. package/src/css/mdi/scss/_extras.scss +65 -0
  310. package/src/css/mdi/scss/_functions.scss +20 -0
  311. package/src/css/mdi/scss/_icons.scss +10 -0
  312. package/src/css/mdi/scss/_path.scss +10 -0
  313. package/src/css/mdi/scss/_variables.scss +4606 -0
  314. package/src/css/mdi/scss/materialdesignicons.scss +8 -0
  315. package/src/css/navigation.css +174 -0
  316. package/src/css/parse-css.js +26 -0
  317. package/src/css/reset.css +48 -0
  318. package/src/index.css +68 -0
  319. package/src/index.jsx +113 -0
  320. package/src/main.jsx +3 -0
  321. package/src/openlayers-utils/format-utilities.js +178 -0
  322. package/src/openlayers-utils/interaction-creator.js +31 -0
  323. package/src/openlayers-utils/layer-utilities.js +309 -0
  324. package/src/openlayers-utils/map-utils.js +25 -0
  325. package/src/openlayers-utils/resource-utilities.js +38 -0
  326. package/src/openlayers-utils/vector-style.js +131 -0
  327. package/src/utils/cache.js +6 -0
  328. package/src/utils/check-webgl.js +6 -0
  329. package/src/utils/error-boundary.js +26 -0
  330. package/src/utils/load-plugins.js +32 -0
  331. package/src/utils/load-plugins.test.js +36 -0
  332. package/src/utils/plugin-region.jsx +26 -0
  333. package/src/utils/redux-bundler-react.jsx +69 -0
  334. package/src/utils/scale-to-zoom-level.js +37 -0
  335. package/src/utils/vector-styles.js +7 -0
  336. package/.babelrc +0 -7
  337. package/config/basemaps.js +0 -22
  338. package/css/corpsmap.css +0 -7982
  339. package/index.js +0 -5
  340. package/lib/dev.js +0 -41517
  341. package/lib/prod.js +0 -41483
  342. package/rollup.config.js +0 -30
  343. package/src/bundles/_template-bundle-creator.js +0 -49
  344. package/src/bundles/create-basemap-bundle-old.js +0 -107
  345. package/src/bundles/create-basemap-bundle.js +0 -133
  346. package/src/bundles/create-ol-map-bundle.js +0 -166
  347. package/src/bundles/create-ol-view-bundle.js +0 -79
  348. package/src/bundles/map-basemap-bundle.js +0 -42
  349. package/src/bundles/map-bundle.js +0 -90
  350. package/src/bundles/map-interaction-bundle.js +0 -57
  351. package/src/bundles/map-measure-bundle.js +0 -61
  352. package/src/bundles/map-view-bundle.js +0 -34
  353. package/src/components/BasemapSwitcherLight/BasemapMenu.js +0 -26
  354. package/src/components/BasemapSwitcherLight/BasemapMenuItem.js +0 -31
  355. package/src/components/BasemapSwitcherLight/index.js +0 -25
  356. package/src/components/Control-Regions/BtnContainer.js +0 -20
  357. package/src/components/Control-Regions/Right.js +0 -30
  358. package/src/components/Control-Regions/Top.js +0 -19
  359. package/src/components/Control-Regions/index.js +0 -4
  360. package/src/components/LayerTree/index.js +0 -10
  361. package/src/components/Map.js +0 -56
  362. package/src/components/MeasureTool/Content.js +0 -38
  363. package/src/components/MeasureTool/index.js +0 -125
  364. package/src/components/MeasureTool/measure-utils.js +0 -57
  365. package/src/components/Zoom/index.js +0 -28
  366. package/src/components/index.js +0 -3
  367. package/src/index.js +0 -11
@@ -0,0 +1,278 @@
1
+ import { createSelector } from "redux-bundler";
2
+ import olMap from "ol/Map.js";
3
+ import View from "ol/View";
4
+ import { get, transform, fromLonLat, transformExtent } from "ol/proj";
5
+ import ScaleBar from "ol/control/ScaleLine";
6
+ import debounce from "lodash/debounce";
7
+
8
+ import "ol/ol.css";
9
+
10
+ export default (opts) => {
11
+ const defaults = {
12
+ name: "map",
13
+ center: [-98.579, 39.828],
14
+ zoom: 5,
15
+ rotation: 0,
16
+ minZoom: 0,
17
+ maxZoom: 22,
18
+ addons: {},
19
+ limitMapExtent: false,
20
+ };
21
+
22
+ const config = Object.assign({}, defaults, opts);
23
+
24
+ return Object.assign(
25
+ {},
26
+ {
27
+ name: config.name,
28
+
29
+ getReducer: () => {
30
+ const initialData = {
31
+ map: null,
32
+ opts: null,
33
+ geoProjection: get("EPSG:4326"),
34
+ webProjection: get("EPSG:3857"),
35
+ center: config.center,
36
+ zoom: config.zoom,
37
+ rotation: config.rotation,
38
+ minZoom: config.minZoom,
39
+ maxZoom: config.maxZoom,
40
+ limitMapExtent: config.limitMapExtent,
41
+ shouldInitialize: false,
42
+ shouldResetViewState: false,
43
+ shouldUpdateViewState: false,
44
+ };
45
+
46
+ return (state = initialData, { type, payload }) => {
47
+ console.log(type, payload);
48
+ if (config.additionalActions.indexOf(type) !== -1) {
49
+ return Object.assign({}, state, payload);
50
+ }
51
+
52
+ switch (type) {
53
+ case "MAP_INITIALIZED":
54
+ case "MAP_RESET_MAP_VIEW":
55
+ case "MAP_UPDATED_VIEW_STATE_STARTED":
56
+ case "MAP_UPDATED_VIEW_STATE_FINISHED":
57
+ case "MAP_LOADING":
58
+ case "MAP_LOADED":
59
+ return Object.assign({}, state, payload);
60
+ default:
61
+ return state;
62
+ }
63
+ };
64
+ },
65
+
66
+ doMapInitialize:
67
+ (el, opts) =>
68
+ ({ dispatch, store }) => {
69
+ const existingMap = store.selectMap();
70
+ if (existingMap) return; // map already exists, don't create a new one
71
+ const geoProjection = store.selectMapGeoProjection();
72
+ const webProjection = store.selectMapWebProjection();
73
+ // CWBI-13636 Limit Map Extent
74
+ const limitMapExtent = opts.hasOwnProperty("limitMapExtent")
75
+ ? opts.limitMapExtent
76
+ : null;
77
+ const extent = limitMapExtent
78
+ ? transformExtent(
79
+ [-180, -85, 180, 85],
80
+ geoProjection,
81
+ webProjection
82
+ )
83
+ : null;
84
+ const center = opts.hasOwnProperty("center")
85
+ ? opts.center
86
+ : store.selectMapCenter();
87
+ const zoom = opts.hasOwnProperty("zoom")
88
+ ? opts.zoom
89
+ : store.selectMapZoom();
90
+ const rotation = opts.hasOwnProperty("rotation")
91
+ ? opts.rotation
92
+ : store.selectMapRotation();
93
+ const minZoom = opts.hasOwnProperty("minZoom")
94
+ ? opts.minZoom
95
+ : store.selectMapMinZoom();
96
+ const maxZoom = opts.hasOwnProperty("maxZoom")
97
+ ? opts.maxZoom
98
+ : store.selectMapMaxZoom();
99
+
100
+ console.log("setting up at", opts.center, center);
101
+
102
+ const viewParams = {
103
+ center: transform(center, geoProjection, webProjection),
104
+ zoom: zoom,
105
+ rotation: rotation,
106
+ minZoom: minZoom,
107
+ maxZoom: maxZoom,
108
+ };
109
+
110
+ // CWBI-13636 Limit Map Extent
111
+ if (extent) {
112
+ viewParams.extent = extent;
113
+ }
114
+
115
+ const view = new View(viewParams);
116
+ const map = new olMap({
117
+ controls: [new ScaleBar({ units: "us" })],
118
+ target: el,
119
+ view: view,
120
+ });
121
+
122
+ map.on("moveend", debounce(store.doMapUpdateViewState, 200));
123
+ map.on("precompose", debounce(store.doMapPreCompose, 50));
124
+ map.on("rendercomplete", debounce(store.doMapRenderComplete, 200));
125
+
126
+ dispatch({
127
+ type: "MAP_INITIALIZED",
128
+ payload: { map: map, opts: opts },
129
+ });
130
+ },
131
+ doMapPreCompose:
132
+ () =>
133
+ ({ dispatch }) => {
134
+ dispatch({
135
+ type: "MAP_LOADING",
136
+ });
137
+ },
138
+ doMapRenderComplete:
139
+ () =>
140
+ ({ dispatch }) => {
141
+ dispatch({
142
+ type: "MAP_LOADED",
143
+ });
144
+ },
145
+
146
+ doMapUpdateSize:
147
+ () =>
148
+ ({ dispatch, store }) => {
149
+ const map = store.selectMap();
150
+ if (map) map.updateSize();
151
+ },
152
+
153
+ doMapUpdateViewState:
154
+ () =>
155
+ ({ dispatch, store }) => {
156
+ dispatch({
157
+ type: "MAP_UPDATED_VIEW_STATE_STARTED",
158
+ payload: { shouldUpdateViewState: false },
159
+ });
160
+ const epsg4326 = store.selectMapGeoProjection();
161
+ const epsg3857 = store.selectMapWebProjection();
162
+ const map = store.selectMap();
163
+ const view = map.getView();
164
+ const center = transform(view.getCenter(), epsg3857, epsg4326);
165
+ const rotation = view.getRotation() * (180 / Math.PI);
166
+ const zoom = view.getZoom();
167
+ const minZoom = view.getMinZoom();
168
+ const maxZoom = view.getMaxZoom();
169
+ dispatch({
170
+ type: "MAP_UPDATED_VIEW_STATE_FINISHED",
171
+ payload: {
172
+ center: center,
173
+ rotation: rotation,
174
+ zoom: zoom,
175
+ minZoom: minZoom,
176
+ maxZoom: maxZoom,
177
+ },
178
+ });
179
+ },
180
+
181
+ doMapResetViewState:
182
+ () =>
183
+ ({ dispatch, store }) => {
184
+ dispatch({
185
+ type: "MAP_RESET_MAP_VIEW",
186
+ payload: { shouldResetViewState: false },
187
+ });
188
+ const { center, zoom, rotation } = config;
189
+ const map = store.selectMap();
190
+ const view = map.getView();
191
+ const geoProjection = store.selectMapGeoProjection();
192
+ const webProjection = store.selectMapWebProjection();
193
+ view.animate(
194
+ {
195
+ center: transform(center, geoProjection, webProjection),
196
+ zoom: zoom,
197
+ rotation: rotation,
198
+ },
199
+ 200
200
+ );
201
+ },
202
+
203
+ doMapZoomTo:
204
+ (lonLat, z) =>
205
+ ({ store }) => {
206
+ const map = store.selectMap();
207
+ const view = map.getView();
208
+ view.animate({
209
+ zoom: z || 10,
210
+ center: fromLonLat(lonLat),
211
+ });
212
+ },
213
+
214
+ // doLimitMapExtent: (value) => ({ dispatch, store }) => {
215
+ // dispatch({
216
+ // type: "MAP_SET_LIMIT_EXTENT",
217
+ // payload: { limitExtent: value, shouldResetViewState: true },
218
+ // });
219
+ // },
220
+
221
+ selectMap: (state) => {
222
+ return state.map.map;
223
+ },
224
+
225
+ selectMapOpts: (state) => {
226
+ return state.map.opts;
227
+ },
228
+
229
+ selectMapGeoProjection: (state) => {
230
+ return state.map.geoProjection;
231
+ },
232
+
233
+ selectMapWebProjection: (state) => {
234
+ return state.map.webProjection;
235
+ },
236
+
237
+ selectMapCenter: (state) => {
238
+ return state.map.center;
239
+ },
240
+
241
+ selectMapZoom: createSelector("selectAppTime", "selectMap", (_, map) => {
242
+ if (!map) return 0;
243
+ const view = map.getView();
244
+ return view.getZoom();
245
+ }),
246
+
247
+ selectMapRotation: (state) => {
248
+ return state.map.rotation;
249
+ },
250
+
251
+ selectMapMinZoom: (state) => {
252
+ return state.map.minZoom;
253
+ },
254
+
255
+ selectMapMaxZoom: (state) => {
256
+ return state.map.maxZoom;
257
+ },
258
+
259
+ reactMapShouldResetViewState: (state) => {
260
+ if (state.map.shouldResetViewState)
261
+ return { actionCreator: "doMapResetViewState" };
262
+ },
263
+ reactMapShouldUpdateViewState: (state) => {
264
+ if (state.map.shouldUpdateViewState)
265
+ return { actionCreator: "doMapUpdateViewState" };
266
+ },
267
+
268
+ persistActions: config.persistMapState
269
+ ? ["MAP_UPDATED_VIEW_STATE_FINISHED", "MAP_RESET_MAP_VIEW"]
270
+ : [],
271
+
272
+ init: (store) => {
273
+ window.addEventListener("resize", store.doMapUpdateSize);
274
+ },
275
+ },
276
+ config.addons
277
+ );
278
+ };
@@ -0,0 +1,125 @@
1
+ export default {
2
+ name: "export",
3
+
4
+ getReducer: () => {
5
+ const initialData = {
6
+ loadingCsv: false,
7
+ loadingGeoJSON: false,
8
+ };
9
+
10
+ return (state = initialData, { type, payload }) => {
11
+ switch (type) {
12
+ case "EXPORT_TO_CSV_INITIATED":
13
+ case "EXPORT_TO_CSV_FINISHED":
14
+ case "EXPORT_TO_GEOJSON_INITIATED":
15
+ case "EXPORT_TO_GEOJSON_FINISHED":
16
+ return Object.assign({}, state, payload);
17
+ default:
18
+ return state;
19
+ }
20
+ };
21
+ },
22
+ doExportToCSV: (data) => ({ dispatch, store }) => {
23
+ //Modify FeatureCollection to an array, to generate csv.
24
+ const features = data.features;
25
+ let csvArray = [];
26
+ const columnHeaders = Object.keys(features[0].properties);
27
+ csvArray.push(columnHeaders);
28
+
29
+ features.forEach((item, i) => {
30
+ const values = Object.keys(item.properties).map((value) => {
31
+ return item.properties[value];
32
+ });
33
+ csvArray.push(values);
34
+ });
35
+
36
+ store.doGenerateCsv(csvArray);
37
+ },
38
+ doGenerateCsv: (csvArray) => ({ dispatch, store }) => {
39
+ dispatch({
40
+ type: "EXPORT_TO_CSV_INITIATED",
41
+ payload: {
42
+ loadingCsv: true,
43
+ },
44
+ });
45
+ const processRow = (row) => {
46
+ let finalVal = "";
47
+ for (let j = 0; j < row.length; j++) {
48
+ let innerValue = row[j] === null ? "" : row[j].toString();
49
+ if (row[j] instanceof Date) {
50
+ innerValue = row[j].toLocaleString();
51
+ }
52
+ let result = innerValue.replace(/"/g, '""');
53
+ if (result.search(/("|,|\n)/g) >= 0) result = '"' + result + '"';
54
+ if (j > 0) finalVal += ",";
55
+ finalVal += result;
56
+ }
57
+ return finalVal + "\n";
58
+ };
59
+
60
+ let csvFile = "";
61
+ for (let i = 0; i < csvArray.length; i++) {
62
+ csvFile += processRow(csvArray[i]);
63
+ }
64
+
65
+ let blob = new Blob([csvFile], { type: "text/csv;charset=utf-8;" });
66
+ if (navigator.msSaveBlob) {
67
+ // IE 10+
68
+ navigator.msSaveBlob(blob, "export.csv");
69
+ } else {
70
+ let link = document.createElement("a");
71
+ if (link.download !== undefined) {
72
+ // feature detection
73
+ // Browsers that support HTML5 download attribute
74
+ let url = URL.createObjectURL(blob);
75
+ link.setAttribute("href", url);
76
+ link.setAttribute("download", "export.csv");
77
+ link.style.visibility = "hidden";
78
+ document.body.appendChild(link);
79
+ link.click();
80
+ document.body.removeChild(link);
81
+ }
82
+ }
83
+
84
+ dispatch({
85
+ type: "EXPORT_TO_CSV_FINISHED",
86
+ payload: {
87
+ loadingCsv: false,
88
+ },
89
+ });
90
+ },
91
+ doGenerateGeoJSON: (geojson) => ({ dispatch, store }) => {
92
+ dispatch({
93
+ type: "EXPORT_TO_GEOJSON_INITIATED",
94
+ payload: {
95
+ loadingGeoJSON: true,
96
+ },
97
+ });
98
+
99
+ let blob = new Blob([JSON.stringify(geojson)], { type: "text/csv;charset=utf-8;" });
100
+ if (navigator.msSaveBlob) {
101
+ // IE 10+
102
+ navigator.msSaveBlob(blob, "export.geojson");
103
+ } else {
104
+ let link = document.createElement("a");
105
+ if (link.download !== undefined) {
106
+ // feature detection
107
+ // Browsers that support HTML5 download attribute
108
+ let url = URL.createObjectURL(blob);
109
+ link.setAttribute("href", url);
110
+ link.setAttribute("download", "export.geojson");
111
+ link.style.visibility = "hidden";
112
+ document.body.appendChild(link);
113
+ link.click();
114
+ document.body.removeChild(link);
115
+ }
116
+ }
117
+
118
+ dispatch({
119
+ type: "EXPORT_TO_GEOJSON_FINISHED",
120
+ payload: {
121
+ loadingGeoJSON: false,
122
+ },
123
+ });
124
+ },
125
+ };
@@ -0,0 +1,119 @@
1
+ import parallel from "async/parallel";
2
+ import flatten from "lodash/flatten";
3
+ import buffer from "@turf/buffer";
4
+ import { point, polygon } from "@turf/helpers";
5
+
6
+ export default {
7
+ name: "identify",
8
+
9
+ getReducer() {
10
+ const initialData = {
11
+ shouldFire: false,
12
+ coordinates: null,
13
+ listeners: [],
14
+ results: [],
15
+ };
16
+
17
+ return (state = initialData, { type, payload }) => {
18
+ switch (type) {
19
+ case "IDENTIFY_COLLECTION_ADDED":
20
+ case "IDENTIFY_SHOULD_FIRE":
21
+ case "IDENTIFY_COORDINATES_SET":
22
+ case "IDENTIFY_STARTED":
23
+ case "IDENTIFY_ERROR":
24
+ case "IDENTIFY_SUCCESS":
25
+ return Object.assign({}, state, payload);
26
+ default:
27
+ return state;
28
+ }
29
+ };
30
+ },
31
+
32
+ doIdentifyAddCollection: (options) => ({ dispatch, store }) => {
33
+ const listeners = store.selectIdentifyListeners();
34
+ if (options.onIdentify) listeners.push(options.onIdentify);
35
+ dispatch({
36
+ type: "IDENTIFY_COLLECTION_ADDED",
37
+ payload: { listeners: listeners },
38
+ });
39
+ },
40
+
41
+ doIdentifyShouldFire: () => ({ dispatch }) => {
42
+ dispatch({ type: "IDENTIFY_SHOULD_FIRE", payload: { shouldFire: true } });
43
+ },
44
+
45
+ doIdentifySetCoords: (geom) => ({ dispatch, store }) => {
46
+ geom.transform("EPSG:3857", "EPSG:4326");
47
+ const coordinates = geom.getCoordinates();
48
+ dispatch({
49
+ type: "IDENTIFY_COORDINATES_SET",
50
+ payload: { coordinates: coordinates, results: [], shouldFire: true },
51
+ });
52
+ },
53
+ doSetIdentifyFeature: () => ({ store }) => {
54
+ const coords = store.selectIdentifyCoordinates();
55
+ const resolution = store.selectResolution();
56
+ const bufferValue = store.selectIdentifyBufferValue();
57
+ let identifyFeature = null;
58
+
59
+ if (bufferValue > 0) {
60
+ identifyFeature = store.selectIdentifyBufferFeature();
61
+ } else {
62
+ if (typeof coords[0] === "number") {
63
+ const pt = point(coords);
64
+ const radius = (resolution * 5) / 1000;
65
+ identifyFeature = buffer(pt, radius, {
66
+ units: "kilometers",
67
+ });
68
+ } else {
69
+ identifyFeature = polygon(coords);
70
+ }
71
+ }
72
+
73
+ return identifyFeature;
74
+ },
75
+
76
+ doIdentifyFire: () => ({ dispatch, store }) => {
77
+ dispatch({ type: "IDENTIFY_STARTED", payload: { shouldFire: false } });
78
+ //store.doBasicToolbarDeactivate();
79
+ store.doSetCursor("wait");
80
+ const listeners = store.selectIdentifyListeners();
81
+
82
+ parallel(listeners, (err, r) => {
83
+ if (err) {
84
+ store.doSetCursor("default");
85
+ return dispatch({
86
+ type: "IDENTIFY_ERROR",
87
+ payload: {
88
+ err: err,
89
+ notification: {
90
+ level: "danger",
91
+ title: "Identify Error",
92
+ message: `${JSON.stringify(err)}`,
93
+ },
94
+ },
95
+ });
96
+ } else {
97
+ const results = flatten(r);
98
+ dispatch({ type: "IDENTIFY_SUCCESS", payload: { results: results } });
99
+ store.doSetCursor("default");
100
+ }
101
+ });
102
+ },
103
+
104
+ selectIdentifyCoordinates: (state) => {
105
+ return state.identify.coordinates;
106
+ },
107
+
108
+ selectIdentifyListeners: (state) => {
109
+ return state.identify.listeners;
110
+ },
111
+
112
+ selectIdentifyResults: (state) => {
113
+ return state.identify.results;
114
+ },
115
+
116
+ reactIdentifyShouldFire: (state) => {
117
+ if (state.identify.shouldFire) return { actionCreator: "doIdentifyFire" };
118
+ },
119
+ };
@@ -0,0 +1,53 @@
1
+ import { composeBundles, createCacheBundle } from "redux-bundler";
2
+ import cache from "../utils/cache";
3
+
4
+ // import out application bundles
5
+ import apiBundle from "./api-bundle";
6
+ import basicToolbarBundle from "./basic-toolbar-bundle";
7
+ import configBundle from "./config-bundle";
8
+ import exportBundle from "./export-bundle";
9
+ import identifyBundle from "./identify-bundle";
10
+ import mapBasemapBundle from "./map-basemap-bundle";
11
+ import mapCoreBundle from "./map-core-bundle";
12
+ import mapInteractionBundle from "./map-interaction-bundle";
13
+ import mapLayersBundle from "./map-layers-bundle";
14
+ import mapProjBundle from "./map-proj-bundle";
15
+ import mapViewBundle from "./map-view-bundle.jsx";
16
+ import modalWindowBundle from "./modal-window-bundle";
17
+ import notificationBundle from "./notification-bundle";
18
+ import pluginBundle from "./plugin-bundle";
19
+ import primaryPanelBundle from "./primary-panel-bundle";
20
+ import searchBundle from "./search-bundle";
21
+ import southRegionBundle from "./south-region-bundle";
22
+ import themeBundle from "./theme-bundle";
23
+ import verticalLayoutBundle from "./vertical-layout-bundle";
24
+ import viewportBundle from "./viewport-bundle";
25
+ import windowLocationBundle from "./window-location-bundle";
26
+
27
+ // compose the bundles into a redux store and export our new store
28
+ export default composeBundles(
29
+ apiBundle,
30
+ basicToolbarBundle,
31
+ createCacheBundle({
32
+ cacheFn: cache.set,
33
+ }),
34
+ configBundle,
35
+ exportBundle,
36
+ identifyBundle,
37
+ mapBasemapBundle,
38
+ mapCoreBundle,
39
+ mapInteractionBundle,
40
+ mapLayersBundle,
41
+ mapProjBundle,
42
+ mapViewBundle,
43
+ modalWindowBundle,
44
+ notificationBundle,
45
+ pluginBundle,
46
+ primaryPanelBundle,
47
+ searchBundle,
48
+ southRegionBundle,
49
+ themeBundle,
50
+ verticalLayoutBundle,
51
+ viewportBundle,
52
+ windowLocationBundle
53
+ );
@@ -0,0 +1,73 @@
1
+ import { getLayer, getSource } from "../openlayers-utils/layer-utilities";
2
+
3
+ export default {
4
+ name: "basemaps",
5
+
6
+ getReducer() {
7
+ const initialData = {
8
+ shouldCheckDefault: false,
9
+ activeBasemap: 0,
10
+ idx: 0,
11
+ };
12
+
13
+ return (state = initialData, { type, payload }) => {
14
+ switch (type) {
15
+ case "BASEMAP_CHANGED":
16
+ case "BASEMAP_CHECKING_DEFAULT":
17
+ return Object.assign({}, state, payload);
18
+ case "MAP_INITIALIZED":
19
+ return Object.assign({}, state, {
20
+ shouldCheckDefault: true,
21
+ });
22
+ default:
23
+ return state;
24
+ }
25
+ };
26
+ },
27
+
28
+ doBasemapsCheckDefault:
29
+ () =>
30
+ ({ dispatch, store }) => {
31
+ dispatch({
32
+ type: "BASEMAP_CHECKING_DEFAULT",
33
+ payload: { shouldCheckDefault: false },
34
+ });
35
+ const config = store.selectDefaultConfig();
36
+ if (config.map.hasOwnProperty("basemap"))
37
+ store.doChangeBasemap(config.map.basemap);
38
+ },
39
+
40
+ doChangeBasemap:
41
+ (basemapIndex) =>
42
+ ({ dispatch, store }) => {
43
+ let activeBasemap = store.selectActiveBasemap();
44
+ const basemapList = store.selectBasemapList();
45
+ const map = store.selectMap();
46
+ const basemapConfig = basemapList[basemapIndex];
47
+ if (!basemapConfig.serviceType) basemapConfig.serviceType = "XYZ";
48
+ const src = getSource(basemapConfig);
49
+ if (!activeBasemap) {
50
+ activeBasemap = getLayer({ serviceType: "XYZ", visible: true });
51
+ }
52
+ map.removeLayer(activeBasemap);
53
+ activeBasemap.setSource(src);
54
+ map.getLayers().insertAt(0, activeBasemap);
55
+ dispatch({
56
+ type: "BASEMAP_CHANGED",
57
+ payload: { activeBasemap: activeBasemap, idx: basemapIndex },
58
+ });
59
+ },
60
+
61
+ selectActiveBasemap: (state) => {
62
+ return state.basemaps.activeBasemap;
63
+ },
64
+
65
+ selectActiveBasemapIdx: (state) => {
66
+ return state.basemaps.idx;
67
+ },
68
+
69
+ reactBasemapsShouldCheckDefault: (state) => {
70
+ if (state.basemaps.shouldCheckDefault)
71
+ return { actionCreator: "doBasemapsCheckDefault" };
72
+ },
73
+ };
@@ -0,0 +1,25 @@
1
+ import createOlMapBundle from './create-ol-map-bundle';
2
+ import { createSelector } from 'redux-bundler';
3
+
4
+ export default createOlMapBundle({
5
+ additionalActions: [
6
+ 'MAP_CURSOR_CHANGED'
7
+ ],
8
+ addons:{
9
+ doSetCursor: (cursor) => ({ dispatch }) => {
10
+ let c = cursor;
11
+ if(!c) c = 'grab';
12
+ dispatch({type: 'MAP_CURSOR_CHANGED', payload: {cursor: c} });
13
+ },
14
+ selectCursorClass: (state) => {
15
+ return state.map.cursor;
16
+ },
17
+ selectView: createSelector(
18
+ 'selectMap',
19
+ (map) => {
20
+ if(!map) return null;
21
+ return map.getView();
22
+ }
23
+ )
24
+ }
25
+ })