@prushforth/map 1.0.0-preview.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.
Files changed (370) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +89 -0
  3. package/demo/index.html +78 -0
  4. package/dist/cjs/AttributionButton-DgbgLHy4.js +106 -0
  5. package/dist/cjs/MapTileLayer-D4vp8bR4.js +454 -0
  6. package/dist/cjs/app-globals-DY--Q2Nl.js +775 -0
  7. package/dist/cjs/calculatePosition-CDcdNl7C.js +92 -0
  8. package/dist/cjs/gcds-ext-map.cjs.js +47 -0
  9. package/dist/cjs/gcds-ext-map_2.cjs.entry.js +8081 -0
  10. package/dist/cjs/index-CW_WOSnc.js +32697 -0
  11. package/dist/cjs/index.cjs.js +2 -0
  12. package/dist/cjs/loader.cjs.js +14 -0
  13. package/dist/cjs/locale-_4nEyxeO.js +153 -0
  14. package/dist/cjs/map-a.cjs.entry.js +16 -0
  15. package/dist/cjs/map-caption.cjs.entry.js +55 -0
  16. package/dist/cjs/map-extent.cjs.entry.js +993 -0
  17. package/dist/cjs/map-feature.cjs.entry.js +636 -0
  18. package/dist/cjs/map-featurecaption.cjs.entry.js +14 -0
  19. package/dist/cjs/map-geometry.cjs.entry.js +36 -0
  20. package/dist/cjs/map-input.cjs.entry.js +348 -0
  21. package/dist/cjs/map-link.cjs.entry.js +6055 -0
  22. package/dist/cjs/map-meta.cjs.entry.js +40 -0
  23. package/dist/cjs/map-properties.cjs.entry.js +14 -0
  24. package/dist/cjs/map-select.cjs.entry.js +100 -0
  25. package/dist/cjs/map-span.cjs.entry.js +14 -0
  26. package/dist/cjs/map-style.cjs.entry.js +127 -0
  27. package/dist/cjs/map-tile.cjs.entry.js +274 -0
  28. package/dist/cjs/renderStyles-yOMXvf12.js +59 -0
  29. package/dist/collection/assets/canada.json +1 -0
  30. package/dist/collection/assets/images/w3community.ico +0 -0
  31. package/dist/collection/assets/mapml/en/apstile/arctic +18 -0
  32. package/dist/collection/assets/mapml/en/cbmtile/canvec +22 -0
  33. package/dist/collection/assets/mapml/en/cbmtile/cbmt +24 -0
  34. package/dist/collection/assets/mapml/en/cbmtile/cbmtgeom +20 -0
  35. package/dist/collection/assets/mapml/en/cbmtile/cbmtsimple +20 -0
  36. package/dist/collection/assets/mapml/en/cbmtile/current_conditions +33 -0
  37. package/dist/collection/assets/mapml/en/cbmtile/toporama +25 -0
  38. package/dist/collection/assets/mapml/en/custom/arcticsdi.mapml +18 -0
  39. package/dist/collection/assets/mapml/en/osmtile/cbmt +24 -0
  40. package/dist/collection/assets/mapml/en/osmtile/current_conditions +32 -0
  41. package/dist/collection/assets/mapml/en/osmtile/dark.mapml +19 -0
  42. package/dist/collection/assets/mapml/en/osmtile/light.mapml +19 -0
  43. package/dist/collection/assets/mapml/en/osmtile/osm +19 -0
  44. package/dist/collection/assets/mapml/en/osmtile/toporama +25 -0
  45. package/dist/collection/assets/mapml/fr/apstile/arctic +19 -0
  46. package/dist/collection/assets/mapml/fr/cbmtile/canvec +22 -0
  47. package/dist/collection/assets/mapml/fr/cbmtile/cbmt +24 -0
  48. package/dist/collection/assets/mapml/fr/cbmtile/cbmtgeom +20 -0
  49. package/dist/collection/assets/mapml/fr/cbmtile/cbmtsimple +20 -0
  50. package/dist/collection/assets/mapml/fr/cbmtile/current_conditions +25 -0
  51. package/dist/collection/assets/mapml/fr/cbmtile/toporama +25 -0
  52. package/dist/collection/assets/mapml/fr/osmtile/cbmt +24 -0
  53. package/dist/collection/assets/mapml/fr/osmtile/current_conditions +24 -0
  54. package/dist/collection/assets/mapml/fr/osmtile/dark.mapml +19 -0
  55. package/dist/collection/assets/mapml/fr/osmtile/light.mapml +19 -0
  56. package/dist/collection/assets/mapml/fr/osmtile/osm +19 -0
  57. package/dist/collection/assets/mapml/fr/osmtile/toporama +25 -0
  58. package/dist/collection/assets/pmtiles/darkTheme.js +19 -0
  59. package/dist/collection/assets/pmtiles/lightTheme.js +19 -0
  60. package/dist/collection/collection-manifest.json +28 -0
  61. package/dist/collection/components/gcds-ext-map/assets/pmtiles/darkTheme.js +19 -0
  62. package/dist/collection/components/gcds-ext-map/assets/pmtiles/lightTheme.js +19 -0
  63. package/dist/collection/components/gcds-ext-map/gcds-ext-map.css +2138 -0
  64. package/dist/collection/components/gcds-ext-map/gcds-ext-map.js +1517 -0
  65. package/dist/collection/components/gcds-ext-map/stories/gcds-ext-map.stories.js +367 -0
  66. package/dist/collection/components/map-a/map-a.js +89 -0
  67. package/dist/collection/components/map-caption/map-caption.js +52 -0
  68. package/dist/collection/components/map-extent/map-extent.js +809 -0
  69. package/dist/collection/components/map-feature/map-feature.js +724 -0
  70. package/dist/collection/components/map-featurecaption/map-featurecaption.js +6 -0
  71. package/dist/collection/components/map-geometry/map-geometry.js +57 -0
  72. package/dist/collection/components/map-input/map-input.js +355 -0
  73. package/dist/collection/components/map-layer/map-layer.js +1245 -0
  74. package/dist/collection/components/map-layer/stories/map-layer.stories.js +101 -0
  75. package/dist/collection/components/map-link/map-link.js +1149 -0
  76. package/dist/collection/components/map-meta/map-meta.js +82 -0
  77. package/dist/collection/components/map-properties/map-properties.js +7 -0
  78. package/dist/collection/components/map-select/map-select.js +145 -0
  79. package/dist/collection/components/map-span/map-span.js +7 -0
  80. package/dist/collection/components/map-style/map-style.js +144 -0
  81. package/dist/collection/components/map-tile/map-tile.js +370 -0
  82. package/dist/collection/components/utils/mapml/DOMTokenList.js +123 -0
  83. package/dist/collection/components/utils/mapml/DefaultMapOptions.js +11 -0
  84. package/dist/collection/components/utils/mapml/Util.js +1601 -0
  85. package/dist/collection/components/utils/mapml/control/AttributionButton.js +101 -0
  86. package/dist/collection/components/utils/mapml/control/FullscreenButton.js +181 -0
  87. package/dist/collection/components/utils/mapml/control/GeolocationButton.js +70 -0
  88. package/dist/collection/components/utils/mapml/control/LayerControl.js +212 -0
  89. package/dist/collection/components/utils/mapml/control/ReloadButton.js +75 -0
  90. package/dist/collection/components/utils/mapml/control/ScaleBar.js +108 -0
  91. package/dist/collection/components/utils/mapml/control/SearchButton.js +565 -0
  92. package/dist/collection/components/utils/mapml/elementSupport/extents/createLayerControlForExtent.js +259 -0
  93. package/dist/collection/components/utils/mapml/elementSupport/inputs/heightInput.js +18 -0
  94. package/dist/collection/components/utils/mapml/elementSupport/inputs/hiddenInput.js +19 -0
  95. package/dist/collection/components/utils/mapml/elementSupport/inputs/locationInput.js +127 -0
  96. package/dist/collection/components/utils/mapml/elementSupport/inputs/widthInput.js +18 -0
  97. package/dist/collection/components/utils/mapml/elementSupport/inputs/zoomInput.js +30 -0
  98. package/dist/collection/components/utils/mapml/elementSupport/layers/calculatePosition.js +88 -0
  99. package/dist/collection/components/utils/mapml/elementSupport/layers/createLayerControlForLayer.js +326 -0
  100. package/dist/collection/components/utils/mapml/elementSupport/layers/renderStyles.js +55 -0
  101. package/dist/collection/components/utils/mapml/elementSupport/viewers/matchMedia.js +251 -0
  102. package/dist/collection/components/utils/mapml/features/featureRenderer.js +342 -0
  103. package/dist/collection/components/utils/mapml/features/geometry.js +268 -0
  104. package/dist/collection/components/utils/mapml/features/path.js +485 -0
  105. package/dist/collection/components/utils/mapml/handlers/AnnounceMovement.js +154 -0
  106. package/dist/collection/components/utils/mapml/handlers/ContextMenu.js +1436 -0
  107. package/dist/collection/components/utils/mapml/handlers/FeatureIndex.js +116 -0
  108. package/dist/collection/components/utils/mapml/handlers/QueryHandler.js +476 -0
  109. package/dist/collection/components/utils/mapml/handlers/keyboard.js +60 -0
  110. package/dist/collection/components/utils/mapml/layers/Crosshair.js +108 -0
  111. package/dist/collection/components/utils/mapml/layers/DebugOverlay.js +357 -0
  112. package/dist/collection/components/utils/mapml/layers/FeatureIndexOverlay.js +239 -0
  113. package/dist/collection/components/utils/mapml/layers/ImageLayer.js +136 -0
  114. package/dist/collection/components/utils/mapml/layers/MapExtentLayer.js +114 -0
  115. package/dist/collection/components/utils/mapml/layers/MapFeatureLayer.js +623 -0
  116. package/dist/collection/components/utils/mapml/layers/MapLayer.js +640 -0
  117. package/dist/collection/components/utils/mapml/layers/MapTileLayer.js +450 -0
  118. package/dist/collection/components/utils/mapml/layers/TemplatedFeaturesOrTilesLayer.js +346 -0
  119. package/dist/collection/components/utils/mapml/layers/TemplatedImageLayer.js +276 -0
  120. package/dist/collection/components/utils/mapml/layers/TemplatedPMTilesLayer.js +135 -0
  121. package/dist/collection/components/utils/mapml/layers/TemplatedTileLayer.js +664 -0
  122. package/dist/collection/components/utils/utils.js +26 -0
  123. package/dist/collection/fonts/icons/LICENSE.txt +92 -0
  124. package/dist/collection/fonts/icons/README.md +543 -0
  125. package/dist/collection/fonts/icons/gcds-icons.css +110 -0
  126. package/dist/collection/fonts/icons/gcds-icons.eot +0 -0
  127. package/dist/collection/fonts/icons/gcds-icons.svg +82 -0
  128. package/dist/collection/fonts/icons/gcds-icons.ttf +0 -0
  129. package/dist/collection/fonts/icons/gcds-icons.woff +0 -0
  130. package/dist/collection/fonts/lato/LICENSE.txt +48 -0
  131. package/dist/collection/fonts/lato/README.md +195 -0
  132. package/dist/collection/fonts/lato/gcds-lato-italic.woff +0 -0
  133. package/dist/collection/fonts/lato/gcds-lato-italic.woff2 +0 -0
  134. package/dist/collection/fonts/lato/gcds-lato.css +30 -0
  135. package/dist/collection/fonts/lato/gcds-lato.woff +0 -0
  136. package/dist/collection/fonts/lato/gcds-lato.woff2 +0 -0
  137. package/dist/collection/fonts/noto-sans/LICENSE.txt +43 -0
  138. package/dist/collection/fonts/noto-sans/README.md +423 -0
  139. package/dist/collection/fonts/noto-sans/gcds-noto-sans-bold-italic.woff +0 -0
  140. package/dist/collection/fonts/noto-sans/gcds-noto-sans-bold-italic.woff2 +0 -0
  141. package/dist/collection/fonts/noto-sans/gcds-noto-sans-bold.woff +0 -0
  142. package/dist/collection/fonts/noto-sans/gcds-noto-sans-bold.woff2 +0 -0
  143. package/dist/collection/fonts/noto-sans/gcds-noto-sans-light-italic.woff +0 -0
  144. package/dist/collection/fonts/noto-sans/gcds-noto-sans-light-italic.woff2 +0 -0
  145. package/dist/collection/fonts/noto-sans/gcds-noto-sans-light.woff +0 -0
  146. package/dist/collection/fonts/noto-sans/gcds-noto-sans-light.woff2 +0 -0
  147. package/dist/collection/fonts/noto-sans/gcds-noto-sans-medium-italic.woff +0 -0
  148. package/dist/collection/fonts/noto-sans/gcds-noto-sans-medium-italic.woff2 +0 -0
  149. package/dist/collection/fonts/noto-sans/gcds-noto-sans-medium.woff +0 -0
  150. package/dist/collection/fonts/noto-sans/gcds-noto-sans-medium.woff2 +0 -0
  151. package/dist/collection/fonts/noto-sans/gcds-noto-sans-regular-italic.woff +0 -0
  152. package/dist/collection/fonts/noto-sans/gcds-noto-sans-regular-italic.woff2 +0 -0
  153. package/dist/collection/fonts/noto-sans/gcds-noto-sans-regular.woff +0 -0
  154. package/dist/collection/fonts/noto-sans/gcds-noto-sans-regular.woff2 +0 -0
  155. package/dist/collection/fonts/noto-sans/gcds-noto-sans-semibold-italic.woff +0 -0
  156. package/dist/collection/fonts/noto-sans/gcds-noto-sans-semibold-italic.woff2 +0 -0
  157. package/dist/collection/fonts/noto-sans/gcds-noto-sans-semibold.woff +0 -0
  158. package/dist/collection/fonts/noto-sans/gcds-noto-sans-semibold.woff2 +0 -0
  159. package/dist/collection/fonts/noto-sans/gcds-noto-sans.css +89 -0
  160. package/dist/collection/fonts/noto-sans-mono/LICENSE.txt +93 -0
  161. package/dist/collection/fonts/noto-sans-mono/README.md +135 -0
  162. package/dist/collection/fonts/noto-sans-mono/gcds-noto-sans-mono.css +17 -0
  163. package/dist/collection/fonts/noto-sans-mono/gcds-noto-sans-mono.woff +0 -0
  164. package/dist/collection/fonts/noto-sans-mono/gcds-noto-sans-mono.woff2 +0 -0
  165. package/dist/collection/generated/locale.js +148 -0
  166. package/dist/collection/global/mapml-globals.js +916 -0
  167. package/dist/collection/index.js +1 -0
  168. package/dist/collection/leaflet-src.esm.js +14419 -0
  169. package/dist/components/gcds-ext-map.d.ts +11 -0
  170. package/dist/components/gcds-ext-map.js +10 -0
  171. package/dist/components/index.d.ts +35 -0
  172. package/dist/components/index.js +1 -0
  173. package/dist/components/map-a.d.ts +11 -0
  174. package/dist/components/map-a.js +1 -0
  175. package/dist/components/map-caption.d.ts +11 -0
  176. package/dist/components/map-caption.js +1 -0
  177. package/dist/components/map-extent.d.ts +11 -0
  178. package/dist/components/map-extent.js +1 -0
  179. package/dist/components/map-feature.d.ts +11 -0
  180. package/dist/components/map-feature.js +1 -0
  181. package/dist/components/map-featurecaption.d.ts +11 -0
  182. package/dist/components/map-featurecaption.js +1 -0
  183. package/dist/components/map-geometry.d.ts +11 -0
  184. package/dist/components/map-geometry.js +1 -0
  185. package/dist/components/map-input.d.ts +11 -0
  186. package/dist/components/map-input.js +1 -0
  187. package/dist/components/map-layer.d.ts +11 -0
  188. package/dist/components/map-layer.js +1 -0
  189. package/dist/components/map-link.d.ts +11 -0
  190. package/dist/components/map-link.js +1 -0
  191. package/dist/components/map-meta.d.ts +11 -0
  192. package/dist/components/map-meta.js +1 -0
  193. package/dist/components/map-properties.d.ts +11 -0
  194. package/dist/components/map-properties.js +1 -0
  195. package/dist/components/map-select.d.ts +11 -0
  196. package/dist/components/map-select.js +1 -0
  197. package/dist/components/map-span.d.ts +11 -0
  198. package/dist/components/map-span.js +1 -0
  199. package/dist/components/map-style.d.ts +11 -0
  200. package/dist/components/map-style.js +1 -0
  201. package/dist/components/map-tile.d.ts +11 -0
  202. package/dist/components/map-tile.js +1 -0
  203. package/dist/components/p-B4YLD_Og.js +1 -0
  204. package/dist/components/p-BE41zrui.js +1 -0
  205. package/dist/components/p-Bpv_U_Lb.js +1 -0
  206. package/dist/components/p-CwRxGZga.js +5 -0
  207. package/dist/components/p-EYVT9Efh.js +1 -0
  208. package/dist/components/p-gwC_yeRa.js +1 -0
  209. package/dist/esm/AttributionButton-CfaoSLCu.js +103 -0
  210. package/dist/esm/MapTileLayer-DvC_iOIS.js +451 -0
  211. package/dist/esm/app-globals-De5ze2BD.js +773 -0
  212. package/dist/esm/calculatePosition-B4YLD_Og.js +90 -0
  213. package/dist/esm/gcds-ext-map.js +43 -0
  214. package/dist/esm/gcds-ext-map_2.entry.js +8078 -0
  215. package/dist/esm/index-BUsJ7i5g.js +32656 -0
  216. package/dist/esm/index.js +1 -0
  217. package/dist/esm/loader.js +12 -0
  218. package/dist/esm/locale-Bpv_U_Lb.js +150 -0
  219. package/dist/esm/map-a.entry.js +14 -0
  220. package/dist/esm/map-caption.entry.js +53 -0
  221. package/dist/esm/map-extent.entry.js +991 -0
  222. package/dist/esm/map-feature.entry.js +634 -0
  223. package/dist/esm/map-featurecaption.entry.js +12 -0
  224. package/dist/esm/map-geometry.entry.js +34 -0
  225. package/dist/esm/map-input.entry.js +346 -0
  226. package/dist/esm/map-link.entry.js +6035 -0
  227. package/dist/esm/map-meta.entry.js +38 -0
  228. package/dist/esm/map-properties.entry.js +12 -0
  229. package/dist/esm/map-select.entry.js +98 -0
  230. package/dist/esm/map-span.entry.js +12 -0
  231. package/dist/esm/map-style.entry.js +125 -0
  232. package/dist/esm/map-tile.entry.js +272 -0
  233. package/dist/esm/renderStyles-EYVT9Efh.js +57 -0
  234. package/dist/gcds-ext-map/assets/canada.json +1 -0
  235. package/dist/gcds-ext-map/assets/images/w3community.ico +0 -0
  236. package/dist/gcds-ext-map/assets/mapml/en/apstile/arctic +18 -0
  237. package/dist/gcds-ext-map/assets/mapml/en/cbmtile/canvec +22 -0
  238. package/dist/gcds-ext-map/assets/mapml/en/cbmtile/cbmt +24 -0
  239. package/dist/gcds-ext-map/assets/mapml/en/cbmtile/cbmtgeom +20 -0
  240. package/dist/gcds-ext-map/assets/mapml/en/cbmtile/cbmtsimple +20 -0
  241. package/dist/gcds-ext-map/assets/mapml/en/cbmtile/current_conditions +33 -0
  242. package/dist/gcds-ext-map/assets/mapml/en/cbmtile/toporama +25 -0
  243. package/dist/gcds-ext-map/assets/mapml/en/custom/arcticsdi.mapml +18 -0
  244. package/dist/gcds-ext-map/assets/mapml/en/osmtile/cbmt +24 -0
  245. package/dist/gcds-ext-map/assets/mapml/en/osmtile/current_conditions +32 -0
  246. package/dist/gcds-ext-map/assets/mapml/en/osmtile/dark.mapml +19 -0
  247. package/dist/gcds-ext-map/assets/mapml/en/osmtile/light.mapml +19 -0
  248. package/dist/gcds-ext-map/assets/mapml/en/osmtile/osm +19 -0
  249. package/dist/gcds-ext-map/assets/mapml/en/osmtile/toporama +25 -0
  250. package/dist/gcds-ext-map/assets/mapml/fr/apstile/arctic +19 -0
  251. package/dist/gcds-ext-map/assets/mapml/fr/cbmtile/canvec +22 -0
  252. package/dist/gcds-ext-map/assets/mapml/fr/cbmtile/cbmt +24 -0
  253. package/dist/gcds-ext-map/assets/mapml/fr/cbmtile/cbmtgeom +20 -0
  254. package/dist/gcds-ext-map/assets/mapml/fr/cbmtile/cbmtsimple +20 -0
  255. package/dist/gcds-ext-map/assets/mapml/fr/cbmtile/current_conditions +25 -0
  256. package/dist/gcds-ext-map/assets/mapml/fr/cbmtile/toporama +25 -0
  257. package/dist/gcds-ext-map/assets/mapml/fr/osmtile/cbmt +24 -0
  258. package/dist/gcds-ext-map/assets/mapml/fr/osmtile/current_conditions +24 -0
  259. package/dist/gcds-ext-map/assets/mapml/fr/osmtile/dark.mapml +19 -0
  260. package/dist/gcds-ext-map/assets/mapml/fr/osmtile/light.mapml +19 -0
  261. package/dist/gcds-ext-map/assets/mapml/fr/osmtile/osm +19 -0
  262. package/dist/gcds-ext-map/assets/mapml/fr/osmtile/toporama +25 -0
  263. package/dist/gcds-ext-map/assets/pmtiles/darkTheme.js +19 -0
  264. package/dist/gcds-ext-map/assets/pmtiles/lightTheme.js +19 -0
  265. package/dist/gcds-ext-map/fonts/icons/LICENSE.txt +92 -0
  266. package/dist/gcds-ext-map/fonts/icons/README.md +543 -0
  267. package/dist/gcds-ext-map/fonts/icons/gcds-icons.css +110 -0
  268. package/dist/gcds-ext-map/fonts/icons/gcds-icons.eot +0 -0
  269. package/dist/gcds-ext-map/fonts/icons/gcds-icons.svg +82 -0
  270. package/dist/gcds-ext-map/fonts/icons/gcds-icons.ttf +0 -0
  271. package/dist/gcds-ext-map/fonts/icons/gcds-icons.woff +0 -0
  272. package/dist/gcds-ext-map/fonts/lato/LICENSE.txt +48 -0
  273. package/dist/gcds-ext-map/fonts/lato/README.md +195 -0
  274. package/dist/gcds-ext-map/fonts/lato/gcds-lato-italic.woff +0 -0
  275. package/dist/gcds-ext-map/fonts/lato/gcds-lato-italic.woff2 +0 -0
  276. package/dist/gcds-ext-map/fonts/lato/gcds-lato.css +30 -0
  277. package/dist/gcds-ext-map/fonts/lato/gcds-lato.woff +0 -0
  278. package/dist/gcds-ext-map/fonts/lato/gcds-lato.woff2 +0 -0
  279. package/dist/gcds-ext-map/fonts/noto-sans/LICENSE.txt +43 -0
  280. package/dist/gcds-ext-map/fonts/noto-sans/README.md +423 -0
  281. package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-bold-italic.woff +0 -0
  282. package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-bold-italic.woff2 +0 -0
  283. package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-bold.woff +0 -0
  284. package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-bold.woff2 +0 -0
  285. package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-light-italic.woff +0 -0
  286. package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-light-italic.woff2 +0 -0
  287. package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-light.woff +0 -0
  288. package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-light.woff2 +0 -0
  289. package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-medium-italic.woff +0 -0
  290. package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-medium-italic.woff2 +0 -0
  291. package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-medium.woff +0 -0
  292. package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-medium.woff2 +0 -0
  293. package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-regular-italic.woff +0 -0
  294. package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-regular-italic.woff2 +0 -0
  295. package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-regular.woff +0 -0
  296. package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-regular.woff2 +0 -0
  297. package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-semibold-italic.woff +0 -0
  298. package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-semibold-italic.woff2 +0 -0
  299. package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-semibold.woff +0 -0
  300. package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-semibold.woff2 +0 -0
  301. package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans.css +89 -0
  302. package/dist/gcds-ext-map/fonts/noto-sans-mono/LICENSE.txt +93 -0
  303. package/dist/gcds-ext-map/fonts/noto-sans-mono/README.md +135 -0
  304. package/dist/gcds-ext-map/fonts/noto-sans-mono/gcds-noto-sans-mono.css +17 -0
  305. package/dist/gcds-ext-map/fonts/noto-sans-mono/gcds-noto-sans-mono.woff +0 -0
  306. package/dist/gcds-ext-map/fonts/noto-sans-mono/gcds-noto-sans-mono.woff2 +0 -0
  307. package/dist/gcds-ext-map/gcds-ext-map.esm.js +1 -0
  308. package/dist/gcds-ext-map/index.esm.js +0 -0
  309. package/dist/gcds-ext-map/leaflet-src.esm.js +14419 -0
  310. package/dist/gcds-ext-map/p-1b22f774.entry.js +1 -0
  311. package/dist/gcds-ext-map/p-29b4ba34.entry.js +1 -0
  312. package/dist/gcds-ext-map/p-2dd09d44.entry.js +1 -0
  313. package/dist/gcds-ext-map/p-3fef47e5.entry.js +1 -0
  314. package/dist/gcds-ext-map/p-4e324a1d.entry.js +1 -0
  315. package/dist/gcds-ext-map/p-4f4a6873.entry.js +1 -0
  316. package/dist/gcds-ext-map/p-9cc5ad37.entry.js +1 -0
  317. package/dist/gcds-ext-map/p-9edfea7d.entry.js +1 -0
  318. package/dist/gcds-ext-map/p-B4YLD_Og.js +1 -0
  319. package/dist/gcds-ext-map/p-B8Id5Ptd.js +1 -0
  320. package/dist/gcds-ext-map/p-BUsJ7i5g.js +6 -0
  321. package/dist/gcds-ext-map/p-Bpv_U_Lb.js +1 -0
  322. package/dist/gcds-ext-map/p-CtOuMgy9.js +1 -0
  323. package/dist/gcds-ext-map/p-Dd474fsL.js +1 -0
  324. package/dist/gcds-ext-map/p-EYVT9Efh.js +1 -0
  325. package/dist/gcds-ext-map/p-a67d721d.entry.js +1 -0
  326. package/dist/gcds-ext-map/p-b16e862b.entry.js +1 -0
  327. package/dist/gcds-ext-map/p-b9cbf1e0.entry.js +10 -0
  328. package/dist/gcds-ext-map/p-cab5246e.entry.js +1 -0
  329. package/dist/gcds-ext-map/p-d58d409b.entry.js +1 -0
  330. package/dist/gcds-ext-map/p-dfa21368.entry.js +1 -0
  331. package/dist/gcds-ext-map/p-f211048a.entry.js +1 -0
  332. package/dist/index.cjs.js +1 -0
  333. package/dist/index.js +1 -0
  334. package/dist/types/components/gcds-ext-map/gcds-ext-map.d.ts +125 -0
  335. package/dist/types/components/gcds-ext-map/stories/gcds-ext-map.stories.d.ts +230 -0
  336. package/dist/types/components/map-a/map-a.d.ts +7 -0
  337. package/dist/types/components/map-caption/map-caption.d.ts +7 -0
  338. package/dist/types/components/map-extent/map-extent.d.ts +53 -0
  339. package/dist/types/components/map-feature/map-feature.d.ts +50 -0
  340. package/dist/types/components/map-featurecaption/map-featurecaption.d.ts +3 -0
  341. package/dist/types/components/map-geometry/map-geometry.d.ts +7 -0
  342. package/dist/types/components/map-input/map-input.d.ts +24 -0
  343. package/dist/types/components/map-layer/map-layer.d.ts +85 -0
  344. package/dist/types/components/map-layer/stories/map-layer.stories.d.ts +96 -0
  345. package/dist/types/components/map-link/map-link.d.ts +66 -0
  346. package/dist/types/components/map-meta/map-meta.d.ts +11 -0
  347. package/dist/types/components/map-properties/map-properties.d.ts +3 -0
  348. package/dist/types/components/map-select/map-select.d.ts +13 -0
  349. package/dist/types/components/map-span/map-span.d.ts +5 -0
  350. package/dist/types/components/map-style/map-style.d.ts +17 -0
  351. package/dist/types/components/map-tile/map-tile.d.ts +32 -0
  352. package/dist/types/components/utils/mapml/DOMTokenList.d.ts +30 -0
  353. package/dist/types/components/utils/mapml/elementSupport/inputs/heightInput.d.ts +7 -0
  354. package/dist/types/components/utils/mapml/elementSupport/inputs/hiddenInput.d.ts +7 -0
  355. package/dist/types/components/utils/mapml/elementSupport/inputs/locationInput.d.ts +14 -0
  356. package/dist/types/components/utils/mapml/elementSupport/inputs/widthInput.d.ts +7 -0
  357. package/dist/types/components/utils/mapml/elementSupport/inputs/zoomInput.d.ts +11 -0
  358. package/dist/types/components/utils/mapml/layers/MapLayer.d.ts +69 -0
  359. package/dist/types/components/utils/utils.d.ts +2 -0
  360. package/dist/types/components.d.ts +521 -0
  361. package/dist/types/gcds-ext-map.d.ts +17 -0
  362. package/dist/types/generated/locale.d.ts +146 -0
  363. package/dist/types/index.d.ts +11 -0
  364. package/dist/types/stencil-public-runtime.d.ts +1861 -0
  365. package/loader/cdn.js +1 -0
  366. package/loader/index.cjs.js +1 -0
  367. package/loader/index.d.ts +24 -0
  368. package/loader/index.es2017.js +1 -0
  369. package/loader/index.js +2 -0
  370. package/package.json +87 -0
@@ -0,0 +1,916 @@
1
+ import { Map, CRS, bounds, latLngBounds, point, setOptions } from 'leaflet';
2
+ import { QueryHandler } from '../components/utils/mapml/handlers/QueryHandler.js';
3
+ import { ContextMenu } from '../components/utils/mapml/handlers/ContextMenu.js';
4
+ import { Util } from '../components/utils/mapml/Util.js';
5
+ import { AnnounceMovement } from '../components/utils/mapml/handlers/AnnounceMovement.js';
6
+ import { FeatureIndex } from '../components/utils/mapml/handlers/FeatureIndex.js';
7
+ import { Options } from '../components/utils/mapml/DefaultMapOptions.js';
8
+ import '../components/utils/mapml/handlers/keyboard.js';
9
+ import Proj from 'proj4leaflet/src/proj4leaflet.js';
10
+
11
+ export default function() {
12
+ (function (window, document, undefined) {
13
+ let M = {};
14
+ window.M = M;
15
+ M.mime = 'text/mapml';
16
+
17
+ let mapOptions = document.head.querySelector('map-options');
18
+ // key fact is that M.options now refers to the Options object, it's not copied
19
+ M.options = Options;
20
+ // make a DEEP copy of the default locale strings under a new name localeEn
21
+ // to support gcds-ext-map
22
+ M.options.localeEn = JSON.parse(JSON.stringify(Options.locale));
23
+ // if there's a locale field in mapOptions.innerHTML, it will overwrite the
24
+ //field of the same name in M.options
25
+ if (mapOptions)
26
+ M.options = Object.assign(M.options, JSON.parse(mapOptions.innerHTML));
27
+
28
+ // see https://leafletjs.com/reference-1.5.0.html#crs-l-crs-base
29
+ // "new classes can't inherit from (CRS), and methods can't be added
30
+ // to (CRS.anything) with the include function
31
+ // so we'll use the options property as a way to integrate needed
32
+ // properties and methods...
33
+ M.WGS84 = new Proj.CRS(
34
+ 'EPSG:4326',
35
+ '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ',
36
+ {
37
+ origin: [-180, +90],
38
+ bounds: bounds([
39
+ [-180, -90],
40
+ [180, 90]
41
+ ]),
42
+ resolutions: [
43
+ 0.703125, 0.3515625, 0.17578125, 0.087890625, 0.0439453125,
44
+ 0.02197265625, 0.010986328125, 0.0054931640625, 0.00274658203125,
45
+ 0.001373291015625, 0.0006866455078125, 0.0003433227539062,
46
+ 0.0001716613769531, 0.0000858306884766, 0.0000429153442383,
47
+ 0.0000214576721191, 0.0000107288360596, 0.0000053644180298,
48
+ 0.0000026822090149, 0.0000013411045074, 0.0000006705522537,
49
+ 0.0000003352761269
50
+ ],
51
+ crs: {
52
+ tcrs: {
53
+ horizontal: {
54
+ name: 'x',
55
+ min: 0,
56
+ max: (zoom) =>
57
+ Math.round(
58
+ M.WGS84.options.bounds.getSize().x /
59
+ M.WGS84.options.resolutions[zoom]
60
+ )
61
+ },
62
+ vertical: {
63
+ name: 'y',
64
+ min: 0,
65
+ max: (zoom) =>
66
+ Math.round(
67
+ M.WGS84.options.bounds.getSize().y /
68
+ M.WGS84.options.resolutions[zoom]
69
+ )
70
+ },
71
+ bounds: (zoom) =>
72
+ bounds(
73
+ [
74
+ M.WGS84.options.crs.tcrs.horizontal.min,
75
+ M.WGS84.options.crs.tcrs.vertical.min
76
+ ],
77
+ [
78
+ M.WGS84.options.crs.tcrs.horizontal.max(zoom),
79
+ M.WGS84.options.crs.tcrs.vertical.max(zoom)
80
+ ]
81
+ )
82
+ },
83
+ pcrs: {
84
+ horizontal: {
85
+ name: 'longitude',
86
+ get min() {
87
+ return M.WGS84.options.crs.gcrs.horizontal.min;
88
+ },
89
+ get max() {
90
+ return M.WGS84.options.crs.gcrs.horizontal.max;
91
+ }
92
+ },
93
+ vertical: {
94
+ name: 'latitude',
95
+ get min() {
96
+ return M.WGS84.options.crs.gcrs.vertical.min;
97
+ },
98
+ get max() {
99
+ return M.WGS84.options.crs.gcrs.vertical.max;
100
+ }
101
+ },
102
+ get bounds() {
103
+ return M.WGS84.options.bounds;
104
+ }
105
+ },
106
+ gcrs: {
107
+ horizontal: {
108
+ name: 'longitude',
109
+ // set min/max axis values from EPSG registry area of use, retrieved 2019-07-25
110
+ min: -180.0,
111
+ max: 180.0
112
+ },
113
+ vertical: {
114
+ name: 'latitude',
115
+ // set min/max axis values from EPSG registry area of use, retrieved 2019-07-25
116
+ min: -90.0,
117
+ max: 90.0
118
+ },
119
+ get bounds() {
120
+ return latLngBounds(
121
+ [
122
+ M.WGS84.options.crs.gcrs.vertical.min,
123
+ M.WGS84.options.crs.gcrs.horizontal.min
124
+ ],
125
+ [
126
+ M.WGS84.options.crs.gcrs.vertical.max,
127
+ M.WGS84.options.crs.gcrs.horizontal.max
128
+ ]
129
+ );
130
+ }
131
+ },
132
+ map: {
133
+ horizontal: {
134
+ name: 'i',
135
+ min: 0,
136
+ max: (map) => map.getSize().x
137
+ },
138
+ vertical: {
139
+ name: 'j',
140
+ min: 0,
141
+ max: (map) => map.getSize().y
142
+ },
143
+ bounds: (map) => bounds(point([0, 0]), map.getSize())
144
+ },
145
+ tile: {
146
+ horizontal: {
147
+ name: 'i',
148
+ min: 0,
149
+ max: 256
150
+ },
151
+ vertical: {
152
+ name: 'j',
153
+ min: 0,
154
+ max: 256
155
+ },
156
+ get bounds() {
157
+ return bounds(
158
+ [
159
+ M.WGS84.options.crs.tile.horizontal.min,
160
+ M.WGS84.options.crs.tile.vertical.min
161
+ ],
162
+ [
163
+ M.WGS84.options.crs.tile.horizontal.max,
164
+ M.WGS84.options.crs.tile.vertical.max
165
+ ]
166
+ );
167
+ }
168
+ },
169
+ tilematrix: {
170
+ horizontal: {
171
+ name: 'column',
172
+ min: 0,
173
+ max: (zoom) =>
174
+ Math.round(
175
+ M.WGS84.options.crs.tcrs.horizontal.max(zoom) /
176
+ M.WGS84.options.crs.tile.bounds.getSize().x
177
+ )
178
+ },
179
+ vertical: {
180
+ name: 'row',
181
+ min: 0,
182
+ max: (zoom) =>
183
+ Math.round(
184
+ M.WGS84.options.crs.tcrs.vertical.max(zoom) /
185
+ M.WGS84.options.crs.tile.bounds.getSize().y
186
+ )
187
+ },
188
+ bounds: (zoom) =>
189
+ bounds(
190
+ [
191
+ M.WGS84.options.crs.tilematrix.horizontal.min,
192
+ M.WGS84.options.crs.tilematrix.vertical.min
193
+ ],
194
+ [
195
+ M.WGS84.options.crs.tilematrix.horizontal.max(zoom),
196
+ M.WGS84.options.crs.tilematrix.vertical.max(zoom)
197
+ ]
198
+ )
199
+ }
200
+ }
201
+ }
202
+ );
203
+ M.CBMTILE = new Proj.CRS(
204
+ 'EPSG:3978',
205
+ '+proj=lcc +lat_1=49 +lat_2=77 +lat_0=49 +lon_0=-95 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs',
206
+ {
207
+ origin: [-34655800, 39310000],
208
+ bounds: bounds([
209
+ [-34655800, -39000000],
210
+ [10000000, 39310000]
211
+ ]),
212
+ resolutions: [
213
+ 38364.660062653464, 22489.62831258996, 13229.193125052918,
214
+ 7937.5158750317505, 4630.2175937685215, 2645.8386250105837,
215
+ 1587.5031750063501, 926.0435187537042, 529.1677250021168,
216
+ 317.50063500127004, 185.20870375074085, 111.12522225044451,
217
+ 66.1459656252646, 38.36466006265346, 22.48962831258996,
218
+ 13.229193125052918, 7.9375158750317505, 4.6302175937685215,
219
+ 2.6458386250105836, 1.5875031750063502, 0.92604351875370428,
220
+ 0.52916772500211673, 0.31750063500127002, 0.18520870375074083,
221
+ 0.11112522225044451, 0.066145965625264591
222
+ ],
223
+ crs: {
224
+ tcrs: {
225
+ horizontal: {
226
+ name: 'x',
227
+ min: 0,
228
+ max: (zoom) =>
229
+ Math.round(
230
+ M.CBMTILE.options.bounds.getSize().x /
231
+ M.CBMTILE.options.resolutions[zoom]
232
+ )
233
+ },
234
+ vertical: {
235
+ name: 'y',
236
+ min: 0,
237
+ max: (zoom) =>
238
+ Math.round(
239
+ M.CBMTILE.options.bounds.getSize().y /
240
+ M.CBMTILE.options.resolutions[zoom]
241
+ )
242
+ },
243
+ bounds: (zoom) =>
244
+ bounds(
245
+ [
246
+ M.CBMTILE.options.crs.tcrs.horizontal.min,
247
+ M.CBMTILE.options.crs.tcrs.vertical.min
248
+ ],
249
+ [
250
+ M.CBMTILE.options.crs.tcrs.horizontal.max(zoom),
251
+ M.CBMTILE.options.crs.tcrs.vertical.max(zoom)
252
+ ]
253
+ )
254
+ },
255
+ pcrs: {
256
+ horizontal: {
257
+ name: 'easting',
258
+ get min() {
259
+ return M.CBMTILE.options.bounds.min.x;
260
+ },
261
+ get max() {
262
+ return M.CBMTILE.options.bounds.max.x;
263
+ }
264
+ },
265
+ vertical: {
266
+ name: 'northing',
267
+ get min() {
268
+ return M.CBMTILE.options.bounds.min.y;
269
+ },
270
+ get max() {
271
+ return M.CBMTILE.options.bounds.max.y;
272
+ }
273
+ },
274
+ get bounds() {
275
+ return M.CBMTILE.options.bounds;
276
+ }
277
+ },
278
+ gcrs: {
279
+ horizontal: {
280
+ name: 'longitude',
281
+ // set min/max axis values from EPSG registry area of use, retrieved 2019-07-25
282
+ min: -141.01,
283
+ max: -47.74
284
+ },
285
+ vertical: {
286
+ name: 'latitude',
287
+ // set min/max axis values from EPSG registry area of use, retrieved 2019-07-25
288
+ min: 40.04,
289
+ max: 86.46
290
+ },
291
+ get bounds() {
292
+ return latLngBounds(
293
+ [
294
+ M.CBMTILE.options.crs.gcrs.vertical.min,
295
+ M.CBMTILE.options.crs.gcrs.horizontal.min
296
+ ],
297
+ [
298
+ M.CBMTILE.options.crs.gcrs.vertical.max,
299
+ M.CBMTILE.options.crs.gcrs.horizontal.max
300
+ ]
301
+ );
302
+ }
303
+ },
304
+ map: {
305
+ horizontal: {
306
+ name: 'i',
307
+ min: 0,
308
+ max: (map) => map.getSize().x
309
+ },
310
+ vertical: {
311
+ name: 'j',
312
+ min: 0,
313
+ max: (map) => map.getSize().y
314
+ },
315
+ bounds: (map) => bounds(point([0, 0]), map.getSize())
316
+ },
317
+ tile: {
318
+ horizontal: {
319
+ name: 'i',
320
+ min: 0,
321
+ max: 256
322
+ },
323
+ vertical: {
324
+ name: 'j',
325
+ min: 0,
326
+ max: 256
327
+ },
328
+ get bounds() {
329
+ return bounds(
330
+ [
331
+ M.CBMTILE.options.crs.tile.horizontal.min,
332
+ M.CBMTILE.options.crs.tile.vertical.min
333
+ ],
334
+ [
335
+ M.CBMTILE.options.crs.tile.horizontal.max,
336
+ M.CBMTILE.options.crs.tile.vertical.max
337
+ ]
338
+ );
339
+ }
340
+ },
341
+ tilematrix: {
342
+ horizontal: {
343
+ name: 'column',
344
+ min: 0,
345
+ max: (zoom) =>
346
+ Math.round(
347
+ M.CBMTILE.options.crs.tcrs.horizontal.max(zoom) /
348
+ M.CBMTILE.options.crs.tile.bounds.getSize().x
349
+ )
350
+ },
351
+ vertical: {
352
+ name: 'row',
353
+ min: 0,
354
+ max: (zoom) =>
355
+ Math.round(
356
+ M.CBMTILE.options.crs.tcrs.vertical.max(zoom) /
357
+ M.CBMTILE.options.crs.tile.bounds.getSize().y
358
+ )
359
+ },
360
+ bounds: (zoom) =>
361
+ bounds(
362
+ [0, 0],
363
+ [
364
+ M.CBMTILE.options.crs.tilematrix.horizontal.max(zoom),
365
+ M.CBMTILE.options.crs.tilematrix.vertical.max(zoom)
366
+ ]
367
+ )
368
+ }
369
+ }
370
+ }
371
+ );
372
+ M.APSTILE = new Proj.CRS(
373
+ 'EPSG:5936',
374
+ '+proj=stere +lat_0=90 +lat_ts=50 +lon_0=-150 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m +no_defs',
375
+ {
376
+ origin: [-2.8567784109255e7, 3.2567784109255e7],
377
+ bounds: bounds([
378
+ [-28567784.109254867, -28567784.109254755],
379
+ [32567784.109255023, 32567784.10925506]
380
+ ]),
381
+ resolutions: [
382
+ 238810.813354, 119405.406677, 59702.7033384999, 29851.3516692501,
383
+ 14925.675834625, 7462.83791731252, 3731.41895865639, 1865.70947932806,
384
+ 932.854739664032, 466.427369832148, 233.213684916074, 116.606842458037,
385
+ 58.3034212288862, 29.1517106145754, 14.5758553072877, 7.28792765351156,
386
+ 3.64396382688807, 1.82198191331174, 0.910990956788164, 0.45549547826179
387
+ ],
388
+ crs: {
389
+ tcrs: {
390
+ horizontal: {
391
+ name: 'x',
392
+ min: 0,
393
+ max: (zoom) =>
394
+ Math.round(
395
+ M.APSTILE.options.bounds.getSize().x /
396
+ M.APSTILE.options.resolutions[zoom]
397
+ )
398
+ },
399
+ vertical: {
400
+ name: 'y',
401
+ min: 0,
402
+ max: (zoom) =>
403
+ Math.round(
404
+ M.APSTILE.options.bounds.getSize().y /
405
+ M.APSTILE.options.resolutions[zoom]
406
+ )
407
+ },
408
+ bounds: (zoom) =>
409
+ bounds(
410
+ [
411
+ M.APSTILE.options.crs.tcrs.horizontal.min,
412
+ M.APSTILE.options.crs.tcrs.vertical.min
413
+ ],
414
+ [
415
+ M.APSTILE.options.crs.tcrs.horizontal.max(zoom),
416
+ M.APSTILE.options.crs.tcrs.vertical.max(zoom)
417
+ ]
418
+ )
419
+ },
420
+ pcrs: {
421
+ horizontal: {
422
+ name: 'easting',
423
+ get min() {
424
+ return M.APSTILE.options.bounds.min.x;
425
+ },
426
+ get max() {
427
+ return M.APSTILE.options.bounds.max.x;
428
+ }
429
+ },
430
+ vertical: {
431
+ name: 'northing',
432
+ get min() {
433
+ return M.APSTILE.options.bounds.min.y;
434
+ },
435
+ get max() {
436
+ return M.APSTILE.options.bounds.max.y;
437
+ }
438
+ },
439
+ get bounds() {
440
+ return M.APSTILE.options.bounds;
441
+ }
442
+ },
443
+ gcrs: {
444
+ horizontal: {
445
+ name: 'longitude',
446
+ // set min/max axis values from EPSG registry area of use, retrieved 2019-07-25
447
+ min: -180.0,
448
+ max: 180.0
449
+ },
450
+ vertical: {
451
+ name: 'latitude',
452
+ // set min/max axis values from EPSG registry area of use, retrieved 2019-07-25
453
+ min: 60.0,
454
+ max: 90.0
455
+ },
456
+ get bounds() {
457
+ return latLngBounds(
458
+ [
459
+ M.APSTILE.options.crs.gcrs.vertical.min,
460
+ M.APSTILE.options.crs.gcrs.horizontal.min
461
+ ],
462
+ [
463
+ M.APSTILE.options.crs.gcrs.vertical.max,
464
+ M.APSTILE.options.crs.gcrs.horizontal.max
465
+ ]
466
+ );
467
+ }
468
+ },
469
+ map: {
470
+ horizontal: {
471
+ name: 'i',
472
+ min: 0,
473
+ max: (map) => map.getSize().x
474
+ },
475
+ vertical: {
476
+ name: 'j',
477
+ min: 0,
478
+ max: (map) => map.getSize().y
479
+ },
480
+ bounds: (map) => bounds(point([0, 0]), map.getSize())
481
+ },
482
+ tile: {
483
+ horizontal: {
484
+ name: 'i',
485
+ min: 0,
486
+ max: 256
487
+ },
488
+ vertical: {
489
+ name: 'j',
490
+ min: 0,
491
+ max: 256
492
+ },
493
+ get bounds() {
494
+ return bounds(
495
+ [
496
+ M.APSTILE.options.crs.tile.horizontal.min,
497
+ M.APSTILE.options.crs.tile.vertical.min
498
+ ],
499
+ [
500
+ M.APSTILE.options.crs.tile.horizontal.max,
501
+ M.APSTILE.options.crs.tile.vertical.max
502
+ ]
503
+ );
504
+ }
505
+ },
506
+ tilematrix: {
507
+ horizontal: {
508
+ name: 'column',
509
+ min: 0,
510
+ max: (zoom) =>
511
+ Math.round(
512
+ M.APSTILE.options.crs.tcrs.horizontal.max(zoom) /
513
+ M.APSTILE.options.crs.tile.bounds.getSize().x
514
+ )
515
+ },
516
+ vertical: {
517
+ name: 'row',
518
+ min: 0,
519
+ max: (zoom) =>
520
+ Math.round(
521
+ M.APSTILE.options.crs.tcrs.vertical.max(zoom) /
522
+ M.APSTILE.options.crs.tile.bounds.getSize().y
523
+ )
524
+ },
525
+ bounds: (zoom) =>
526
+ bounds(
527
+ [0, 0],
528
+ [
529
+ M.APSTILE.options.crs.tilematrix.horizontal.max(zoom),
530
+ M.APSTILE.options.crs.tilematrix.vertical.max(zoom)
531
+ ]
532
+ )
533
+ }
534
+ }
535
+ }
536
+ );
537
+ M.OSMTILE = CRS.EPSG3857;
538
+ setOptions(M.OSMTILE, {
539
+ origin: [-20037508.342787, 20037508.342787],
540
+ bounds: bounds([
541
+ [-20037508.342787, -20037508.342787],
542
+ [20037508.342787, 20037508.342787]
543
+ ]),
544
+ resolutions: [
545
+ 156543.0339, 78271.51695, 39135.758475, 19567.8792375, 9783.93961875,
546
+ 4891.969809375, 2445.9849046875, 1222.9924523438, 611.49622617188,
547
+ 305.74811308594, 152.87405654297, 76.437028271484, 38.218514135742,
548
+ 19.109257067871, 9.5546285339355, 4.7773142669678, 2.3886571334839,
549
+ 1.1943285667419, 0.59716428337097, 0.29858214168549, 0.14929107084274,
550
+ 0.074645535421371, 0.03732276771068573, 0.018661383855342865,
551
+ 0.009330691927671432495
552
+ ],
553
+ crs: {
554
+ tcrs: {
555
+ horizontal: {
556
+ name: 'x',
557
+ min: 0,
558
+ max: (zoom) =>
559
+ Math.round(
560
+ M.OSMTILE.options.bounds.getSize().x /
561
+ M.OSMTILE.options.resolutions[zoom]
562
+ )
563
+ },
564
+ vertical: {
565
+ name: 'y',
566
+ min: 0,
567
+ max: (zoom) =>
568
+ Math.round(
569
+ M.OSMTILE.options.bounds.getSize().y /
570
+ M.OSMTILE.options.resolutions[zoom]
571
+ )
572
+ },
573
+ bounds: (zoom) =>
574
+ bounds(
575
+ [
576
+ M.OSMTILE.options.crs.tcrs.horizontal.min,
577
+ M.OSMTILE.options.crs.tcrs.vertical.min
578
+ ],
579
+ [
580
+ M.OSMTILE.options.crs.tcrs.horizontal.max(zoom),
581
+ M.OSMTILE.options.crs.tcrs.vertical.max(zoom)
582
+ ]
583
+ )
584
+ },
585
+ pcrs: {
586
+ horizontal: {
587
+ name: 'easting',
588
+ get min() {
589
+ return M.OSMTILE.options.bounds.min.x;
590
+ },
591
+ get max() {
592
+ return M.OSMTILE.options.bounds.max.x;
593
+ }
594
+ },
595
+ vertical: {
596
+ name: 'northing',
597
+ get min() {
598
+ return M.OSMTILE.options.bounds.min.y;
599
+ },
600
+ get max() {
601
+ return M.OSMTILE.options.bounds.max.y;
602
+ }
603
+ },
604
+ get bounds() {
605
+ return M.OSMTILE.options.bounds;
606
+ }
607
+ },
608
+ gcrs: {
609
+ horizontal: {
610
+ name: 'longitude',
611
+ get min() {
612
+ return M.OSMTILE.unproject(M.OSMTILE.options.bounds.min).lng;
613
+ },
614
+ get max() {
615
+ return M.OSMTILE.unproject(M.OSMTILE.options.bounds.max).lng;
616
+ }
617
+ },
618
+ vertical: {
619
+ name: 'latitude',
620
+ get min() {
621
+ return M.OSMTILE.unproject(M.OSMTILE.options.bounds.min).lat;
622
+ },
623
+ get max() {
624
+ return M.OSMTILE.unproject(M.OSMTILE.options.bounds.max).lat;
625
+ }
626
+ },
627
+ get bounds() {
628
+ return latLngBounds(
629
+ [
630
+ M.OSMTILE.options.crs.gcrs.vertical.min,
631
+ M.OSMTILE.options.crs.gcrs.horizontal.min
632
+ ],
633
+ [
634
+ M.OSMTILE.options.crs.gcrs.vertical.max,
635
+ M.OSMTILE.options.crs.gcrs.horizontal.max
636
+ ]
637
+ );
638
+ }
639
+ },
640
+ map: {
641
+ horizontal: {
642
+ name: 'i',
643
+ min: 0,
644
+ max: (map) => map.getSize().x
645
+ },
646
+ vertical: {
647
+ name: 'j',
648
+ min: 0,
649
+ max: (map) => map.getSize().y
650
+ },
651
+ bounds: (map) => bounds(point([0, 0]), map.getSize())
652
+ },
653
+ tile: {
654
+ horizontal: {
655
+ name: 'i',
656
+ min: 0,
657
+ max: 256
658
+ },
659
+ vertical: {
660
+ name: 'j',
661
+ min: 0,
662
+ max: 256
663
+ },
664
+ get bounds() {
665
+ return bounds(
666
+ [
667
+ M.OSMTILE.options.crs.tile.horizontal.min,
668
+ M.OSMTILE.options.crs.tile.vertical.min
669
+ ],
670
+ [
671
+ M.OSMTILE.options.crs.tile.horizontal.max,
672
+ M.OSMTILE.options.crs.tile.vertical.max
673
+ ]
674
+ );
675
+ }
676
+ },
677
+ tilematrix: {
678
+ horizontal: {
679
+ name: 'column',
680
+ min: 0,
681
+ max: (zoom) =>
682
+ Math.round(
683
+ M.OSMTILE.options.crs.tcrs.horizontal.max(zoom) /
684
+ M.OSMTILE.options.crs.tile.bounds.getSize().x
685
+ )
686
+ },
687
+ vertical: {
688
+ name: 'row',
689
+ min: 0,
690
+ max: (zoom) =>
691
+ Math.round(
692
+ M.OSMTILE.options.crs.tcrs.vertical.max(zoom) /
693
+ M.OSMTILE.options.crs.tile.bounds.getSize().y
694
+ )
695
+ },
696
+ bounds: (zoom) =>
697
+ bounds(
698
+ [0, 0],
699
+ [
700
+ M.OSMTILE.options.crs.tilematrix.horizontal.max(zoom),
701
+ M.OSMTILE.options.crs.tilematrix.vertical.max(zoom)
702
+ ]
703
+ )
704
+ }
705
+ }
706
+ });
707
+
708
+ M.geojson2mapml = Util.geojson2mapml;
709
+ M.mapml2geojson = Util.mapml2geojson;
710
+
711
+ // see https://leafletjs.com/examples/extending/extending-3-controls.html#handlers
712
+ Map.addInitHook('addHandler', 'query', QueryHandler);
713
+ Map.addInitHook('addHandler', 'contextMenu', ContextMenu);
714
+ Map.addInitHook('addHandler', 'announceMovement', AnnounceMovement);
715
+ Map.addInitHook('addHandler', 'featureIndex', FeatureIndex);
716
+
717
+ // constants
718
+ M.TILE_SIZE = 256;
719
+ M.FALLBACK_PROJECTION = 'OSMTILE';
720
+ M.FALLBACK_CS = 'TILEMATRIX';
721
+ M.BLANK_TT_TREF = 'mapmltemplatedtileplaceholder';
722
+
723
+ // this is for tests, all other modules import and use Util directly
724
+ M.Util = Util;
725
+
726
+ // Global API for defining custom projections
727
+ M.defineCustomProjection = function(jsonTemplate) {
728
+ let t = JSON.parse(jsonTemplate);
729
+ if (
730
+ t === undefined ||
731
+ !t.proj4string ||
732
+ !t.projection ||
733
+ !t.resolutions ||
734
+ !t.origin ||
735
+ !t.bounds
736
+ )
737
+ throw new Error('Incomplete TCRS Definition');
738
+ if (t.projection.indexOf(':') >= 0)
739
+ throw new Error('":" is not permitted in projection name');
740
+ if (M[t.projection.toUpperCase()]) return t.projection.toUpperCase();
741
+ let tileSize = [256, 512, 1024, 2048, 4096].includes(t.tilesize)
742
+ ? t.tilesize
743
+ : M.TILE_SIZE;
744
+
745
+ M[t.projection] = new Proj.CRS(t.projection, t.proj4string, {
746
+ origin: t.origin,
747
+ resolutions: t.resolutions,
748
+ bounds: bounds(t.bounds),
749
+ crs: {
750
+ tcrs: {
751
+ horizontal: {
752
+ name: 'x',
753
+ min: 0,
754
+ max: (zoom) =>
755
+ Math.round(
756
+ M[t.projection].options.bounds.getSize().x /
757
+ M[t.projection].options.resolutions[zoom]
758
+ )
759
+ },
760
+ vertical: {
761
+ name: 'y',
762
+ min: 0,
763
+ max: (zoom) =>
764
+ Math.round(
765
+ M[t.projection].options.bounds.getSize().y /
766
+ M[t.projection].options.resolutions[zoom]
767
+ )
768
+ },
769
+ bounds: (zoom) =>
770
+ bounds(
771
+ [
772
+ M[t.projection].options.crs.tcrs.horizontal.min,
773
+ M[t.projection].options.crs.tcrs.vertical.min
774
+ ],
775
+ [
776
+ M[t.projection].options.crs.tcrs.horizontal.max(zoom),
777
+ M[t.projection].options.crs.tcrs.vertical.max(zoom)
778
+ ]
779
+ )
780
+ },
781
+ pcrs: {
782
+ horizontal: {
783
+ name: 'easting',
784
+ get min() {
785
+ return M[t.projection].options.bounds.min.x;
786
+ },
787
+ get max() {
788
+ return M[t.projection].options.bounds.max.x;
789
+ }
790
+ },
791
+ vertical: {
792
+ name: 'northing',
793
+ get min() {
794
+ return M[t.projection].options.bounds.min.y;
795
+ },
796
+ get max() {
797
+ return M[t.projection].options.bounds.max.y;
798
+ }
799
+ },
800
+ get bounds() {
801
+ return M[t.projection].options.bounds;
802
+ }
803
+ },
804
+ gcrs: {
805
+ horizontal: {
806
+ name: 'longitude',
807
+ // set min/max axis values from EPSG registry area of use, retrieved 2019-07-25
808
+ get min() {
809
+ return M[t.projection].unproject(M.OSMTILE.options.bounds.min)
810
+ .lng;
811
+ },
812
+ get max() {
813
+ return M[t.projection].unproject(M.OSMTILE.options.bounds.max)
814
+ .lng;
815
+ }
816
+ },
817
+ vertical: {
818
+ name: 'latitude',
819
+ // set min/max axis values from EPSG registry area of use, retrieved 2019-07-25
820
+ get min() {
821
+ return M[t.projection].unproject(M.OSMTILE.options.bounds.min)
822
+ .lat;
823
+ },
824
+ get max() {
825
+ return M[t.projection].unproject(M.OSMTILE.options.bounds.max)
826
+ .lat;
827
+ }
828
+ },
829
+ get bounds() {
830
+ return latLngBounds(
831
+ [
832
+ M[t.projection].options.crs.gcrs.vertical.min,
833
+ M[t.projection].options.crs.gcrs.horizontal.min
834
+ ],
835
+ [
836
+ M[t.projection].options.crs.gcrs.vertical.max,
837
+ M[t.projection].options.crs.gcrs.horizontal.max
838
+ ]
839
+ );
840
+ }
841
+ },
842
+ map: {
843
+ horizontal: {
844
+ name: 'i',
845
+ min: 0,
846
+ max: (map) => map.getSize().x
847
+ },
848
+ vertical: {
849
+ name: 'j',
850
+ min: 0,
851
+ max: (map) => map.getSize().y
852
+ },
853
+ bounds: (map) => bounds([0, 0], map.getSize())
854
+ },
855
+ tile: {
856
+ horizontal: {
857
+ name: 'i',
858
+ min: 0,
859
+ max: tileSize
860
+ },
861
+ vertical: {
862
+ name: 'j',
863
+ min: 0,
864
+ max: tileSize
865
+ },
866
+ get bounds() {
867
+ return bounds(
868
+ [
869
+ M[t.projection].options.crs.tile.horizontal.min,
870
+ M[t.projection].options.crs.tile.vertical.min
871
+ ],
872
+ [
873
+ M[t.projection].options.crs.tile.horizontal.max,
874
+ M[t.projection].options.crs.tile.vertical.max
875
+ ]
876
+ );
877
+ }
878
+ },
879
+ tilematrix: {
880
+ horizontal: {
881
+ name: 'column',
882
+ min: 0,
883
+ max: (zoom) =>
884
+ Math.round(
885
+ M[t.projection].options.crs.tcrs.horizontal.max(zoom) /
886
+ M[t.projection].options.crs.tile.bounds.getSize().x
887
+ )
888
+ },
889
+ vertical: {
890
+ name: 'row',
891
+ min: 0,
892
+ max: (zoom) =>
893
+ Math.round(
894
+ M[t.projection].options.crs.tcrs.vertical.max(zoom) /
895
+ M[t.projection].options.crs.tile.bounds.getSize().y
896
+ )
897
+ },
898
+ bounds: (zoom) =>
899
+ bounds(
900
+ [
901
+ M[t.projection].options.crs.tilematrix.horizontal.min,
902
+ M[t.projection].options.crs.tilematrix.vertical.min
903
+ ],
904
+ [
905
+ M[t.projection].options.crs.tilematrix.horizontal.max(zoom),
906
+ M[t.projection].options.crs.tilematrix.vertical.max(zoom)
907
+ ]
908
+ )
909
+ }
910
+ }
911
+ }); //creates crs using L.Proj
912
+ M[t.projection.toUpperCase()] = M[t.projection]; //adds the projection uppercase to global M
913
+ return t.projection;
914
+ }
915
+ })(window, document);
916
+ }