react-spatial 1.5.2 → 1.5.3

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 (295) hide show
  1. package/.github/workflows/conventional-pr-title.yml +21 -0
  2. package/.github/workflows/main.yml +28 -0
  3. package/.husky/commit-msg +4 -0
  4. package/.husky/post-checkout +4 -0
  5. package/.husky/post-merge +4 -0
  6. package/.husky/post-rebase +4 -0
  7. package/.husky/pre-commit +4 -0
  8. package/.nvmrc +1 -0
  9. package/.whitesource +8 -0
  10. package/CHANGELOG.md +65 -0
  11. package/DEVELOP.md +113 -0
  12. package/__mocks__/mapbox-gl.js +11 -0
  13. package/__mocks__/resize-observer-polyfill.js +9 -0
  14. package/babel.config.js +3 -0
  15. package/commitlint.config.js +1 -0
  16. package/data/topic1.js +119 -0
  17. package/data/topic2.js +28 -0
  18. package/doc/README.md +21 -0
  19. package/doc/doc-config.json +4 -0
  20. package/package.json +4 -3
  21. package/pull_request_template.md +16 -0
  22. package/renovate.json +4 -0
  23. package/scripts/read-pkg-json.js +17 -0
  24. package/src/components/BaseLayerSwitcher/BaseLayerSwitcher.js +322 -0
  25. package/src/components/BaseLayerSwitcher/BaseLayerSwitcher.test.js +69 -0
  26. package/src/components/BaseLayerSwitcher/README.md +61 -0
  27. package/src/components/BaseLayerSwitcher/__snapshots__/BaseLayerSwitcher.test.js.snap +88 -0
  28. package/src/components/BaseLayerSwitcher/index.js +1 -0
  29. package/src/components/BasicMap/BasicMap.js +413 -0
  30. package/src/components/BasicMap/BasicMap.test.js +281 -0
  31. package/src/components/BasicMap/README.md +18 -0
  32. package/src/components/BasicMap/index.js +1 -0
  33. package/{components → src/components}/CanvasSaveButton/CanvasSaveButton.js +320 -93
  34. package/src/components/CanvasSaveButton/CanvasSaveButton.test.js +148 -0
  35. package/src/components/CanvasSaveButton/README.md +76 -0
  36. package/src/components/CanvasSaveButton/__snapshots__/CanvasSaveButton.test.js.snap +76 -0
  37. package/src/components/CanvasSaveButton/index.js +1 -0
  38. package/src/components/Copyright/Copyright.js +89 -0
  39. package/src/components/Copyright/Copyright.test.js +134 -0
  40. package/src/components/Copyright/README.md +36 -0
  41. package/src/components/Copyright/index.js +1 -0
  42. package/src/components/FeatureExportButton/FeatureExportButton.js +118 -0
  43. package/src/components/FeatureExportButton/FeatureExportButton.test.js +417 -0
  44. package/src/components/FeatureExportButton/README.md +76 -0
  45. package/src/components/FeatureExportButton/__snapshots__/FeatureExportButton.test.js.snap +67 -0
  46. package/src/components/FeatureExportButton/index.js +1 -0
  47. package/src/components/FitExtent/FitExtent.js +62 -0
  48. package/src/components/FitExtent/FitExtent.test.js +48 -0
  49. package/src/components/FitExtent/README.md +34 -0
  50. package/src/components/FitExtent/__snapshots__/FitExtent.test.js.snap +13 -0
  51. package/src/components/FitExtent/index.js +1 -0
  52. package/{components → src/components}/Geolocation/Geolocation.js +144 -61
  53. package/src/components/Geolocation/Geolocation.test.js +267 -0
  54. package/src/components/Geolocation/README.md +25 -0
  55. package/src/components/Geolocation/__snapshots__/Geolocation.test.js.snap +92 -0
  56. package/src/components/Geolocation/index.js +1 -0
  57. package/src/components/LayerTree/LayerTree.js +487 -0
  58. package/src/components/LayerTree/LayerTree.test.js +337 -0
  59. package/src/components/LayerTree/README.md +92 -0
  60. package/src/components/LayerTree/__snapshots__/LayerTree.test.js.snap +1746 -0
  61. package/src/components/LayerTree/index.js +1 -0
  62. package/src/components/MousePosition/MousePosition.js +175 -0
  63. package/src/components/MousePosition/MousePosition.test.js +132 -0
  64. package/src/components/MousePosition/README.md +50 -0
  65. package/src/components/MousePosition/__snapshots__/MousePosition.test.js.snap +76 -0
  66. package/src/components/MousePosition/index.js +1 -0
  67. package/src/components/NorthArrow/NorthArrow.js +75 -0
  68. package/src/components/NorthArrow/NorthArrow.test.js +104 -0
  69. package/src/components/NorthArrow/README.md +59 -0
  70. package/src/components/NorthArrow/__snapshots__/NorthArrow.test.js.snap +117 -0
  71. package/src/components/NorthArrow/index.js +1 -0
  72. package/src/components/Overlay/Overlay.js +176 -0
  73. package/src/components/Overlay/Overlay.test.js +149 -0
  74. package/src/components/Overlay/README.md +59 -0
  75. package/src/components/Overlay/__snapshots__/Overlay.test.js.snap +9 -0
  76. package/src/components/Overlay/index.js +1 -0
  77. package/src/components/Permalink/Permalink.js +326 -0
  78. package/src/components/Permalink/Permalink.test.js +285 -0
  79. package/src/components/Permalink/README.md +105 -0
  80. package/src/components/Permalink/index.js +1 -0
  81. package/{components → src/components}/Popup/Popup.js +165 -55
  82. package/src/components/Popup/Popup.test.js +307 -0
  83. package/src/components/Popup/README.md +93 -0
  84. package/src/components/Popup/__snapshots__/Popup.test.js.snap +180 -0
  85. package/src/components/Popup/index.js +1 -0
  86. package/src/components/README.md +41 -0
  87. package/{components → src/components}/ResizeHandler/ResizeHandler.js +50 -15
  88. package/src/components/ResizeHandler/ResizeHandler.test.js +344 -0
  89. package/src/components/ResizeHandler/index.js +1 -0
  90. package/src/components/RouteSchedule/README.md +118 -0
  91. package/src/components/RouteSchedule/RouteSchedule.js +370 -0
  92. package/src/components/RouteSchedule/RouteSchedule.test.js +113 -0
  93. package/src/components/RouteSchedule/__snapshots__/RouteSchedule.test.js.snap +248 -0
  94. package/src/components/RouteSchedule/index.js +1 -0
  95. package/src/components/ScaleLine/README.md +29 -0
  96. package/src/components/ScaleLine/ScaleLine.js +50 -0
  97. package/src/components/ScaleLine/ScaleLine.test.js +30 -0
  98. package/src/components/ScaleLine/__snapshots__/ScaleLine.test.js.snap +7 -0
  99. package/src/components/ScaleLine/index.js +1 -0
  100. package/src/components/StopsFinder/README.md +50 -0
  101. package/src/components/StopsFinder/StopsFinder.js +284 -0
  102. package/src/components/StopsFinder/StopsFinder.test.js +17 -0
  103. package/src/components/StopsFinder/StopsFinderOption.js +61 -0
  104. package/src/components/StopsFinder/__snapshots__/StopsFinder.test.js.snap +133 -0
  105. package/src/components/StopsFinder/index.js +1 -0
  106. package/src/components/Zoom/README.md +25 -0
  107. package/src/components/Zoom/Zoom.js +180 -0
  108. package/src/components/Zoom/Zoom.test.js +141 -0
  109. package/src/components/Zoom/__snapshots__/Zoom.test.js.snap +201 -0
  110. package/src/components/Zoom/index.js +1 -0
  111. package/{propTypes.js → src/propTypes.js} +16 -12
  112. package/{setupTests.js → src/setupTests.js} +1 -1
  113. package/src/styleguidist/ComponentsList.js +52 -0
  114. package/src/styleguidist/StyleGuide.js +277 -0
  115. package/src/styleguidist/styleguidist.css +38 -0
  116. package/src/utils/GlobalsForOle.js +99 -0
  117. package/src/utils/KML.js +594 -0
  118. package/src/utils/KML.test.js +337 -0
  119. package/src/utils/KMLFormat.js +100 -0
  120. package/src/utils/KMLFormat.test.js +50 -0
  121. package/{utils → src/utils}/Styles.js +20 -14
  122. package/src/utils/__snapshots__/KML.test.js.snap.KML-readFeatures()-and-writeFeatures()-should-read-and-write-lineDash-and-fillPattern-style-for-polygon.canvas-image.png +0 -0
  123. package/src/utils/__snapshots__/getPolygonPattern.test.js.snap.getPolygonPattern()-render-pattern-2-(cross)-color-and-(light-blue)-opacity.canvas-image.png +0 -0
  124. package/src/utils/__snapshots__/getPolygonPattern.test.js.snap.getPolygonPattern()-render-pattern-3-(diagonal-line-from-bottom-left-tot-top-right)-with-color-(light-blue)-and-opacity.canvas-image.png +0 -0
  125. package/src/utils/__snapshots__/getPolygonPattern.test.js.snap.getPolygonPattern()-render-pattern-4-(diagonal-line-from-top-left-to-bottom-right)-with-color-(light-blue)-and-opacity.canvas-image.png +0 -0
  126. package/{utils → src/utils}/getPolygonPattern.js +34 -6
  127. package/src/utils/getPolygonPattern.test.js +61 -0
  128. package/src/utils/timeUtils.js +52 -0
  129. package/src/utils/timeUtils.test.js +30 -0
  130. package/styleguide.config.js +251 -0
  131. package/components/BaseLayerSwitcher/BaseLayerSwitcher.js +0 -231
  132. package/components/BaseLayerSwitcher/BaseLayerSwitcher.js.map +0 -7
  133. package/components/BaseLayerSwitcher/index.js +0 -1
  134. package/components/BaseLayerSwitcher/index.js.map +0 -7
  135. package/components/BasicMap/BasicMap.js +0 -278
  136. package/components/BasicMap/BasicMap.js.map +0 -7
  137. package/components/BasicMap/index.js +0 -1
  138. package/components/BasicMap/index.js.map +0 -7
  139. package/components/CanvasSaveButton/CanvasSaveButton.js.map +0 -7
  140. package/components/CanvasSaveButton/index.js +0 -1
  141. package/components/CanvasSaveButton/index.js.map +0 -7
  142. package/components/Copyright/Copyright.js +0 -55
  143. package/components/Copyright/Copyright.js.map +0 -7
  144. package/components/Copyright/index.js +0 -1
  145. package/components/Copyright/index.js.map +0 -7
  146. package/components/FeatureExportButton/FeatureExportButton.js +0 -62
  147. package/components/FeatureExportButton/FeatureExportButton.js.map +0 -7
  148. package/components/FeatureExportButton/index.js +0 -1
  149. package/components/FeatureExportButton/index.js.map +0 -7
  150. package/components/FitExtent/FitExtent.js +0 -32
  151. package/components/FitExtent/FitExtent.js.map +0 -7
  152. package/components/FitExtent/index.js +0 -1
  153. package/components/FitExtent/index.js.map +0 -7
  154. package/components/Geolocation/Geolocation.js.map +0 -7
  155. package/components/Geolocation/index.js +0 -1
  156. package/components/Geolocation/index.js.map +0 -7
  157. package/components/LayerTree/LayerTree.js +0 -278
  158. package/components/LayerTree/LayerTree.js.map +0 -7
  159. package/components/LayerTree/index.js +0 -1
  160. package/components/LayerTree/index.js.map +0 -7
  161. package/components/MousePosition/MousePosition.js +0 -110
  162. package/components/MousePosition/MousePosition.js.map +0 -7
  163. package/components/MousePosition/index.js +0 -1
  164. package/components/MousePosition/index.js.map +0 -7
  165. package/components/NorthArrow/NorthArrow.js +0 -43
  166. package/components/NorthArrow/NorthArrow.js.map +0 -7
  167. package/components/NorthArrow/index.js +0 -1
  168. package/components/NorthArrow/index.js.map +0 -7
  169. package/components/Overlay/Overlay.js +0 -122
  170. package/components/Overlay/Overlay.js.map +0 -7
  171. package/components/Overlay/index.js +0 -1
  172. package/components/Overlay/index.js.map +0 -7
  173. package/components/Permalink/Permalink.js +0 -206
  174. package/components/Permalink/Permalink.js.map +0 -7
  175. package/components/Permalink/index.js +0 -1
  176. package/components/Permalink/index.js.map +0 -7
  177. package/components/Popup/Popup.js.map +0 -7
  178. package/components/Popup/index.js +0 -1
  179. package/components/Popup/index.js.map +0 -7
  180. package/components/ResizeHandler/ResizeHandler.js.map +0 -7
  181. package/components/ResizeHandler/index.js +0 -1
  182. package/components/ResizeHandler/index.js.map +0 -7
  183. package/components/RouteSchedule/RouteSchedule.js +0 -220
  184. package/components/RouteSchedule/RouteSchedule.js.map +0 -7
  185. package/components/RouteSchedule/index.js +0 -1
  186. package/components/RouteSchedule/index.js.map +0 -7
  187. package/components/ScaleLine/ScaleLine.js +0 -32
  188. package/components/ScaleLine/ScaleLine.js.map +0 -7
  189. package/components/ScaleLine/index.js +0 -1
  190. package/components/ScaleLine/index.js.map +0 -7
  191. package/components/StopsFinder/StopsFinder.js +0 -210
  192. package/components/StopsFinder/StopsFinder.js.map +0 -7
  193. package/components/StopsFinder/StopsFinderOption.js +0 -51
  194. package/components/StopsFinder/StopsFinderOption.js.map +0 -7
  195. package/components/StopsFinder/index.js +0 -1
  196. package/components/StopsFinder/index.js.map +0 -7
  197. package/components/Zoom/Zoom.js +0 -130
  198. package/components/Zoom/Zoom.js.map +0 -7
  199. package/components/Zoom/index.js +0 -1
  200. package/components/Zoom/index.js.map +0 -7
  201. package/propTypes.js.map +0 -7
  202. package/setupTests.js.map +0 -7
  203. package/utils/GlobalsForOle.js +0 -94
  204. package/utils/GlobalsForOle.js.map +0 -7
  205. package/utils/KML.js +0 -412
  206. package/utils/KML.js.map +0 -7
  207. package/utils/KMLFormat.js +0 -69
  208. package/utils/KMLFormat.js.map +0 -7
  209. package/utils/Styles.js.map +0 -7
  210. package/utils/getPolygonPattern.js.map +0 -7
  211. package/utils/timeUtils.js +0 -31
  212. package/utils/timeUtils.js.map +0 -7
  213. /package/{components → src/components}/BaseLayerSwitcher/BaseLayerSwitcher.md.scss +0 -0
  214. /package/{components → src/components}/BaseLayerSwitcher/BaseLayerSwitcher.scss +0 -0
  215. /package/{components → src/components}/BasicMap/BasicMap.md.scss +0 -0
  216. /package/{components → src/components}/CanvasSaveButton/CanvasSaveButton.md.scss +0 -0
  217. /package/{components → src/components}/Copyright/Copyright.md.scss +0 -0
  218. /package/{components → src/components}/FeatureExportButton/FeatureExportButton.md.scss +0 -0
  219. /package/{components → src/components}/FitExtent/FitExtent.md.scss +0 -0
  220. /package/{components → src/components}/Geolocation/Geolocation.md.scss +0 -0
  221. /package/{components → src/components}/Geolocation/Geolocation.scss +0 -0
  222. /package/{components → src/components}/LayerTree/LayerTree.md.scss +0 -0
  223. /package/{components → src/components}/LayerTree/LayerTree.scss +0 -0
  224. /package/{components → src/components}/MousePosition/MousePosition.md.scss +0 -0
  225. /package/{components → src/components}/NorthArrow/NorthArrow.scss +0 -0
  226. /package/{components → src/components}/Overlay/Overlay.md.scss +0 -0
  227. /package/{components → src/components}/Overlay/Overlay.scss +0 -0
  228. /package/{components → src/components}/Permalink/Permalink.md.scss +0 -0
  229. /package/{components → src/components}/Popup/Popup.md.scss +0 -0
  230. /package/{components → src/components}/Popup/Popup.scss +0 -0
  231. /package/{components → src/components}/RouteSchedule/RouteSchedule.md.scss +0 -0
  232. /package/{components → src/components}/RouteSchedule/RouteSchedule.scss +0 -0
  233. /package/{components → src/components}/ScaleLine/ScaleLine.scss +0 -0
  234. /package/{components → src/components}/Zoom/Zoom.md.scss +0 -0
  235. /package/{components → src/components}/Zoom/Zoom.scss +0 -0
  236. /package/{images → src/images}/RouteSchedule/firstStation.png +0 -0
  237. /package/{images → src/images}/RouteSchedule/lastStation.png +0 -0
  238. /package/{images → src/images}/RouteSchedule/line.png +0 -0
  239. /package/{images → src/images}/RouteSchedule/station.png +0 -0
  240. /package/{images → src/images}/baselayer/baselayer.basebright.png +0 -0
  241. /package/{images → src/images}/baselayer/baselayer.osm.png +0 -0
  242. /package/{images → src/images}/baselayer/baselayer.travic.png +0 -0
  243. /package/{images → src/images}/baselayer/open.topo.map.png +0 -0
  244. /package/{images → src/images}/baselayer/osm.baselayer.hot.png +0 -0
  245. /package/{images → src/images}/baselayer/osm.baselayer.png +0 -0
  246. /package/{images → src/images}/favicon.png +0 -0
  247. /package/{images → src/images}/geops_logo.png +0 -0
  248. /package/{images → src/images}/geops_logo.svg +0 -0
  249. /package/{images → src/images}/geops_qr.png +0 -0
  250. /package/{images → src/images}/mots/bus_poi-blue-01.svg +0 -0
  251. /package/{images → src/images}/mots/bus_poi-grey-01.svg +0 -0
  252. /package/{images → src/images}/mots/bus_round-blue-01.svg +0 -0
  253. /package/{images → src/images}/mots/bus_round-grey-01.svg +0 -0
  254. /package/{images → src/images}/mots/bus_square-blue-01.svg +0 -0
  255. /package/{images → src/images}/mots/bus_square-grey-01.svg +0 -0
  256. /package/{images → src/images}/mots/cable_car_poi-blue-01.svg +0 -0
  257. /package/{images → src/images}/mots/cable_car_poi-grey-01.svg +0 -0
  258. /package/{images → src/images}/mots/cable_car_round-blue-01.svg +0 -0
  259. /package/{images → src/images}/mots/cable_car_round-grey-01.svg +0 -0
  260. /package/{images → src/images}/mots/cable_car_square-blue-01.svg +0 -0
  261. /package/{images → src/images}/mots/cable_car_square-grey-01.svg +0 -0
  262. /package/{images → src/images}/mots/ferry_poi-blue-01.svg +0 -0
  263. /package/{images → src/images}/mots/ferry_poi-grey-01.svg +0 -0
  264. /package/{images → src/images}/mots/ferry_round-blue-01.svg +0 -0
  265. /package/{images → src/images}/mots/ferry_round-grey-01.svg +0 -0
  266. /package/{images → src/images}/mots/ferry_square-blue-01.svg +0 -0
  267. /package/{images → src/images}/mots/ferry_square-grey-01.svg +0 -0
  268. /package/{images → src/images}/mots/funicular_round-blue-01.svg +0 -0
  269. /package/{images → src/images}/mots/funicular_round-grey-01.svg +0 -0
  270. /package/{images → src/images}/mots/funicular_square-blue-01.svg +0 -0
  271. /package/{images → src/images}/mots/gondola_round-blue-01.svg +0 -0
  272. /package/{images → src/images}/mots/rail_poi-blue-01.svg +0 -0
  273. /package/{images → src/images}/mots/rail_poi-grey-01.svg +0 -0
  274. /package/{images → src/images}/mots/rail_round-blue-01.svg +0 -0
  275. /package/{images → src/images}/mots/rail_round-grey-01.svg +0 -0
  276. /package/{images → src/images}/mots/rail_square-blue-01.svg +0 -0
  277. /package/{images → src/images}/mots/rail_square-grey-01.svg +0 -0
  278. /package/{images → src/images}/mots/subway_round blue-01.svg +0 -0
  279. /package/{images → src/images}/mots/subway_round-blue-01.svg +0 -0
  280. /package/{images → src/images}/mots/tram_poi-blue-01.svg +0 -0
  281. /package/{images → src/images}/mots/tram_poi-grey-01.svg +0 -0
  282. /package/{images → src/images}/mots/tram_round-blue-01.svg +0 -0
  283. /package/{images → src/images}/mots/tram_round-grey-01.svg +0 -0
  284. /package/{images → src/images}/mots/tram_square-blue-01.svg +0 -0
  285. /package/{images → src/images}/mots/tram_square-grey-01.svg +0 -0
  286. /package/{images → src/images}/northArrow.svg +0 -0
  287. /package/{images → src/images}/northArrow.url.svg +0 -0
  288. /package/{images → src/images}/northArrowCircle.svg +0 -0
  289. /package/{images → src/images}/northArrowCircle.url.svg +0 -0
  290. /package/{themes → src/themes}/README.md +0 -0
  291. /package/{themes → src/themes}/default/components.scss +0 -0
  292. /package/{themes → src/themes}/default/examples.scss +0 -0
  293. /package/{themes → src/themes}/default/index.scss +0 -0
  294. /package/{themes → src/themes}/default/mixins.scss +0 -0
  295. /package/{themes → src/themes}/default/variables.scss +0 -0
@@ -0,0 +1,21 @@
1
+ name: Check PR title
2
+ on:
3
+ pull_request:
4
+ types:
5
+ - opened
6
+ - reopened
7
+ - edited
8
+ - synchronize
9
+
10
+ jobs:
11
+ lint:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: aslafy-z/conventional-pr-title-action@v2.2.0
15
+ with:
16
+ success-state: Title follows the specification.
17
+ failure-state: Title does not follow the specification.
18
+ context-name: conventional-pr-title
19
+ preset: conventional-changelog-angular@latest
20
+ env:
21
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,28 @@
1
+ name: main
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - master
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - name: Checkout
15
+ uses: actions/checkout@v3
16
+
17
+ - name: Setup node
18
+ uses: actions/setup-node@v3
19
+ with:
20
+ node-version-file: '.nvmrc'
21
+
22
+ - name: Run linting and tests
23
+ run: |
24
+ yarn install --frozen-lockfile
25
+ yarn lint
26
+ yarn test
27
+ env:
28
+ CI: true
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env sh
2
+ . "$(dirname -- "$0")/_/husky.sh"
3
+
4
+ yarn commitlint --edit $1
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ yarn install --frozen-lockfile
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ yarn install --frozen-lockfile
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ yarn install --frozen-lockfile
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ sort && CI=true npx lint-staged
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 16
package/.whitesource ADDED
@@ -0,0 +1,8 @@
1
+ ##########################################################
2
+ #### WhiteSource Integration configuration file ####
3
+ ##########################################################
4
+
5
+ # Configuration #
6
+ #---------------#
7
+ ws.repo.scan=true
8
+ vulnerable.check.run.conclusion.level=failure
package/CHANGELOG.md ADDED
@@ -0,0 +1,65 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
+
5
+ ### [1.5.2](https://github.com/geops/react-spatial/compare/v1.5.1...v1.5.2) (2023-06-28)
6
+
7
+ ### [1.5.1](https://github.com/geops/react-spatial/compare/v1.5.0...v1.5.1) (2023-06-28)
8
+
9
+ ## [1.5.0](https://github.com/geops/react-spatial/compare/v1.4.1...v1.5.0) (2023-04-28)
10
+
11
+
12
+ ### Features
13
+
14
+ * update react 18 and clean dependencies ([9064937](https://github.com/geops/react-spatial/commit/9064937aa975f072a84b0ad82e791e79ed129c8f))
15
+
16
+ ### [1.4.1](https://github.com/geops/react-spatial/compare/v1.4.0...v1.4.1) (2023-04-28)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * use a more intuitive zooming behavior ([2d43f31](https://github.com/geops/react-spatial/commit/2d43f3189096b2195e0b550e8fb2d9d994746a8a))
22
+
23
+ ## [1.4.0](https://github.com/geops/react-spatial/compare/v1.3.2...v1.4.0) (2023-01-09)
24
+
25
+
26
+ ### Features
27
+
28
+ * **CanvasSaveButton:** add extraData.qrCode option to insert QR code in canvas export ([#700](https://github.com/geops/react-spatial/issues/700)) ([16be889](https://github.com/geops/react-spatial/commit/16be889d97682c2a2d21c2fa17d55cae205e09da))
29
+
30
+ ### [1.3.2](https://github.com/geops/react-spatial/compare/v1.3.1...v1.3.2) (2022-12-15)
31
+
32
+
33
+ ### Bug Fixes
34
+
35
+ * fix use of baselayers permalink and baselayerswitcher ([#699](https://github.com/geops/react-spatial/issues/699)) ([23af45f](https://github.com/geops/react-spatial/commit/23af45f5681cc50cfc4c60502b71c161a478fe71))
36
+
37
+ ### [1.3.1](https://github.com/geops/react-spatial/compare/v1.3.1-beta.0...v1.3.1) (2022-12-15)
38
+
39
+
40
+ ### Bug Fixes
41
+
42
+ * fix detection of base layer in permalink ([9099ba7](https://github.com/geops/react-spatial/commit/9099ba704d15c670e87f8cb9245f06f159078f3e))
43
+
44
+ ## [1.3.0](https://github.com/geops/react-spatial/compare/v1.3.0-beta.1...v1.3.0) (2022-11-14)
45
+
46
+
47
+ ### Bug Fixes
48
+
49
+ * **LayerTree:** add input and toggle props for layer tree renderItemContent ([#697](https://github.com/geops/react-spatial/issues/697)) ([8df5237](https://github.com/geops/react-spatial/commit/8df5237482373dc9c9de1ab9cfecefaf3472dcba))
50
+
51
+ ### [1.2.2](https://github.com/geops/react-spatial/compare/v1.2.1...v1.2.2) (2022-07-22)
52
+
53
+ ### [1.2.1](https://github.com/geops/react-spatial/compare/v1.2.0...v1.2.1) (2022-07-22)
54
+
55
+
56
+ ### Bug Fixes
57
+
58
+ * make component better work with nextjs image sand routing ([#694](https://github.com/geops/react-spatial/issues/694)) ([85871fe](https://github.com/geops/react-spatial/commit/85871fe2201ecad0de76442bc9d77815bfe6db27))
59
+
60
+ ## [1.2.0](https://github.com/geops/react-spatial/compare/v1.0.35...v1.2.0) (2022-06-20)
61
+
62
+
63
+ ### Features
64
+
65
+ * use standard-version and commitlint for automatic versioning and changelog ([#690](https://github.com/geops/react-spatial/issues/690)) ([2c83f00](https://github.com/geops/react-spatial/commit/2c83f00c05f5b76b3f7e38978fb022d7cebfbcfc))
package/DEVELOP.md ADDED
@@ -0,0 +1,113 @@
1
+ # Develop
2
+
3
+ ## Create new component
4
+
5
+ Follow the [guidelines](https://github.com/geops/react-spatial/tree/master/src/components).
6
+
7
+ ## Create new theme
8
+
9
+ Follow the [guidelines](https://github.com/geops/react-spatial/tree/master/src/themes).
10
+
11
+ ## Documentation
12
+
13
+ We are using [react-styleguidist](https://react-styleguidist.js.org/).
14
+ Documentation and examples are available [here](https://react-spatial.geops.de/).
15
+
16
+ Build the doc:
17
+
18
+ ```bash
19
+ yarn doc
20
+ ```
21
+
22
+ Run the doc on [`locahost:6060`](http://locahost:6060/):
23
+
24
+ ```bash
25
+ yarn start
26
+ ```
27
+
28
+ ## Tests
29
+
30
+ We are using [jest]([https://react-styleguidist.js.org/](https://jestjs.io/docs/en/getting-started.html)) and [enzyme]([https://github.com/airbnb/enzyme](https://airbnb.io/enzyme/)).
31
+
32
+ Run the tests in watch mode:
33
+
34
+ ```bash
35
+ yarn test --watch
36
+ ```
37
+
38
+ ## Coverage
39
+
40
+ Run coverage:
41
+
42
+ ```bash
43
+ yarn coverage
44
+ ```
45
+
46
+ Then open the file `coverage/lcov-report/index.html` in your browser.
47
+
48
+ ## Publish on [npmjs.com](https://www.npmjs.com/package/react-spatial)
49
+
50
+ Run publish:
51
+
52
+ ```bash
53
+ publish:public
54
+ ```
55
+ You need to enter the new version number in the command line.
56
+ Then the new version must be published on [npmjs.com](https://www.npmjs.com/package/react-spatial).
57
+
58
+ ## Publish a development version on [npmjs.com](https://www.npmjs.com/package/react-spatial)
59
+
60
+ This version WILL NOT be displayed to other in [npmjs.com](https://www.npmjs.com/package/react-spatial).
61
+
62
+ Run publish:
63
+
64
+ ```bash
65
+ publish:beta
66
+ ```
67
+
68
+ You need to enter the new version number in the command line.
69
+ Append `-beta.0` to the current version or increase the beta number.
70
+ Then the new version must be published on [npmjs.com](https://www.npmjs.com/package/react-spatial) with the tag beta.
71
+
72
+ ## How to use SVG
73
+
74
+ Before adding an SVG file in this folder please clean it using [svgo](https://www.npmjs.com/package/svgo) or [svgomg](https://jakearchibald.github.io/svgomg/).
75
+
76
+ After optimization, verify you can use it Openlayers using this [code sandbox](https://codesandbox.io/s/5w5o4mqwlk).
77
+
78
+ By default the svg loader will load the svg file as a react component if you want to load svg file as a base64 data URI use the extension .url.svg :
79
+
80
+ ```javascript
81
+ // Import as a React component:
82
+ import NorthArrow from 'northArrow.svg';
83
+ // Use: <NorthArrow />
84
+
85
+ // Import as a base64 data URI (or with an url the file is too big):
86
+ import northArrow from 'northArrow.url.svg';
87
+ // northArrow = "data:image/svg+xml;base64,PHN2ZyB4...."
88
+ ```
89
+
90
+ You could also use others loaders (ex: svg-inline-loader , svg-url-loader ...) .
91
+ To use these loaders just adapt the extension of the svg file and add the loader config in styleguide.config.js, then you will be able to use it like this :
92
+
93
+ ```javascript
94
+ // Import as an inline svg:
95
+ import northArrow from 'northArrow.svginline.svg';
96
+ // northArrow = "<svg xmlns='http://www.w3.org/2000/svg' height='192' ...> ... </svg>"
97
+
98
+ // Import as an encoded inline svg data URI (or with an url the file is too big):
99
+ import northArrow from 'northArrow.svgurl.svg';
100
+ // northArrow = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='192' ...%3E ... %3C/svg%3E"
101
+ ```
102
+
103
+ ## How to use SVG with a dynamic size
104
+
105
+ In case you want your SVG fits perfectly his parent div you need to remove `width` and `height` attributes of `<svg>` and replace it by a `viewBox` property, like this:
106
+
107
+ Replace
108
+
109
+ `<svg width="192" height="192">`
110
+
111
+ by
112
+
113
+ `<svg viewBox="0 0 192 192">`
@@ -0,0 +1,11 @@
1
+ /* eslint-disable class-methods-use-this */
2
+ class Map {
3
+ isStyleLoaded() {}
4
+
5
+ getCanvas() {}
6
+
7
+ once() {}
8
+ }
9
+ module.exports = {
10
+ Map,
11
+ };
@@ -0,0 +1,9 @@
1
+ /* eslint-disable */
2
+ export default class ResizeObserver {
3
+ constructor(onResize) {
4
+ ResizeObserver.onResize = onResize;
5
+ }
6
+ observe() {}
7
+ unobserve() {}
8
+ disconnect() {}
9
+ }
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ presets: ['@babel/preset-env', '@babel/preset-react'],
3
+ };
@@ -0,0 +1 @@
1
+ module.exports = { extends: ['@commitlint/config-conventional'] };
package/data/topic1.js ADDED
@@ -0,0 +1,119 @@
1
+ import Style from 'ol/style/Style';
2
+ import Circle from 'ol/style/Circle';
3
+ import Stroke from 'ol/style/Stroke';
4
+ import Fill from 'ol/style/Fill';
5
+
6
+ const topic1 = {
7
+ id: 'topic1',
8
+ name: 'Topic 1',
9
+ visible: true,
10
+ children: [
11
+ {
12
+ name: 'OSM Baselayer',
13
+ visible: true,
14
+ isBaseLayer: true,
15
+ data: {
16
+ type: 'xyz',
17
+ url: 'https://c.tile.openstreetmap.org/{z}/{x}/{y}.png',
18
+ },
19
+ },
20
+ {
21
+ name: 'Other layers',
22
+ visible: true,
23
+ type: 'parent',
24
+ children: [
25
+ {
26
+ name: 'Countries Borders',
27
+ visible: false,
28
+ data: {
29
+ type: 'vectorLayer',
30
+ url:
31
+ 'https://openlayers.org/en/latest/examples/data/geojson/' +
32
+ 'countries.geojson',
33
+ },
34
+ },
35
+ {
36
+ name: 'USA Population Density',
37
+ visible: true,
38
+ data: {
39
+ type: 'wmts',
40
+ url:
41
+ 'https://services.arcgisonline.com/arcgis/rest/services/' +
42
+ 'Demographics/USA_Population_Density/MapServer/WMTS/?layer=0' +
43
+ '&style=default&tilematrixset=EPSG%3A3857&Service=WMTS&' +
44
+ 'Request=GetTile&Version=1.0.0&Format=image%2Fpng&',
45
+ projection: 'EPSG:3857',
46
+ },
47
+ },
48
+ ],
49
+ },
50
+ {
51
+ name: 'Vector sample layers',
52
+ visible: true,
53
+ radioGroup: 'radio',
54
+ children: [
55
+ {
56
+ name: 'Points Samples',
57
+ radioGroup: 'vectorLayers',
58
+ visible: false,
59
+ data: {
60
+ style: new Style({
61
+ image: new Circle({
62
+ radius: 5,
63
+ fill: new Fill({
64
+ color: '#ff0000',
65
+ }),
66
+ }),
67
+ }),
68
+ type: 'vectorLayer',
69
+ url:
70
+ 'https://raw.githubusercontent.com/openlayers/openlayers/' +
71
+ '3c64018b3754cf605ea19cbbe4c8813304da2539/examples/data/geojson/' +
72
+ 'point-samples.geojson',
73
+ },
74
+ },
75
+ {
76
+ name: 'Lines Samples',
77
+ radioGroup: 'vectorLayers',
78
+ visible: true,
79
+ data: {
80
+ style: new Style({
81
+ stroke: new Stroke({
82
+ color: '#ffcc33',
83
+ width: 2,
84
+ }),
85
+ }),
86
+ type: 'vectorLayer',
87
+ url:
88
+ 'https://raw.githubusercontent.com/openlayers/openlayers/' +
89
+ '3c64018b3754cf605ea19cbbe4c8813304da2539/examples/data/geojson/' +
90
+ 'line-samples.geojson',
91
+ },
92
+ },
93
+ {
94
+ name: 'Polygons Samples',
95
+ radioGroup: 'vectorLayers',
96
+ visible: false,
97
+ data: {
98
+ style: new Style({
99
+ stroke: new Stroke({
100
+ color: '#7dff8f',
101
+ width: 3,
102
+ }),
103
+ fill: new Fill({
104
+ color: 'rgba(125, 255, 143, 0.2)',
105
+ }),
106
+ }),
107
+ type: 'vectorLayer',
108
+ url:
109
+ 'https://raw.githubusercontent.com/openlayers/openlayers/' +
110
+ '3c64018b3754cf605ea19cbbe4c8813304da2539/examples/data/geojson/' +
111
+ 'polygon-samples.geojson',
112
+ },
113
+ },
114
+ ],
115
+ },
116
+ ],
117
+ };
118
+
119
+ export default topic1;
package/data/topic2.js ADDED
@@ -0,0 +1,28 @@
1
+ const topic2 = {
2
+ id: 'topic2',
3
+ name: 'Topic 2',
4
+ visible: false,
5
+ children: [
6
+ {
7
+ name: 'OSM Baselayer',
8
+ visible: true,
9
+ isBaseLayer: true,
10
+ data: {
11
+ type: 'xyz',
12
+ url: 'https://c.tile.openstreetmap.org/{z}/{x}/{y}.png',
13
+ },
14
+ },
15
+ {
16
+ name: 'Countries Borders',
17
+ visible: true,
18
+ data: {
19
+ type: 'vectorLayer',
20
+ url:
21
+ 'https://openlayers.org/en/latest/examples/data/geojson/' +
22
+ 'countries.geojson',
23
+ },
24
+ },
25
+ ],
26
+ };
27
+
28
+ export default topic2;
package/doc/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # Documentation in react-spatial
2
+
3
+ Two documentation tools are combined:
4
+ - react-styleguidist (https://github.com/styleguidist/react-styleguidist)
5
+ - documentation.js (https://github.com/documentationjs/documentation)
6
+
7
+ the folder published by netlify is doc/build (netlify.toml).
8
+
9
+ ## Commands
10
+
11
+ Styleguidist documentation is visible (with hot reload) with the cmd:
12
+ 'yarn start'
13
+
14
+ ## Configuration
15
+
16
+ Variables shared among both documentation are written in /doc/doc-config.json
17
+
18
+ - Styleguidist: 'styleguide.config.js
19
+ one component need to be overwritten:
20
+ - 'StyleGuideRenderer': to customize the style of the page, with our own
21
+ header, ribbon footer, etc.
@@ -0,0 +1,4 @@
1
+ {
2
+ "appName": "react-spatial",
3
+ "githubRepo": "https://github.com/geops/react-spatial"
4
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-spatial",
3
3
  "description": "Components to build React map apps.",
4
- "version": "1.5.2",
4
+ "version": "1.5.3",
5
5
  "license": "MIT",
6
6
  "dependencies": {
7
7
  "@geops/geops-ui": "0.1.13",
@@ -99,9 +99,10 @@
99
99
  "lint": "eslint 'src/**/*.js' && stylelint 'src/**/*.css' 'src/**/*.scss'",
100
100
  "postbuild": "cp package.json build/ && cd src && find . -name '*.scss' | cpio -pdm ../build",
101
101
  "prebuild": "rm -rf build/",
102
- "publish:beta": "yarn release -- --prerelease beta --skip.changelog && git push origin HEAD && yarn run build && git push --tags && yarn publish build/ --tag beta",
102
+ "prepare": "is-ci || husky install",
103
+ "publish:beta": "yarn release -- --prerelease beta --skip.changelog && git push origin HEAD && yarn run build && git push --tags && HUSKY=0 yarn publish build/ --tag beta",
103
104
  "publish:beta:dryrun": "yarn release -- --prerelease beta --dry-run --skip.changelog",
104
- "publish:public": "yarn release && git push origin HEAD && yarn build && git push --tags && yarn publish build/",
105
+ "publish:public": "yarn release && git push origin HEAD && yarn build && git push --tags && HUSKY=0 yarn publish build/",
105
106
  "publish:public:dryrun": "yarn release --dry-run",
106
107
  "release": "standard-version",
107
108
  "start": "styleguidist server",
@@ -0,0 +1,16 @@
1
+ # How to
2
+
3
+ <!-- Please provide a test link and quick description how to see the change -->
4
+
5
+ # Others
6
+
7
+ <!-- Thanks for the PR! Feel free to add or remove items if there are not necessary. -->
8
+
9
+ - [ ] It's not a hack or at least an unauthorized hack :).
10
+ - [ ] The images added are optimized.
11
+ - [ ] Everything in ticket description has been fixed.
12
+ - [ ] The author of the MR has made its own review before assigning the reviewer.
13
+ - [ ] The title means something for a human being and follows the [conventional commits](https://www.conventionalcommits.org/) specification.
14
+ - [ ] The title contains [WIP] if it's necessary.
15
+ - [ ] Labels applied. if it's a release? a hotfix?
16
+ - [ ] Tests added.
package/renovate.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": ["config:js-lib", "schedule:monthly"],
3
+ "assignees": ["@friedjoff"]
4
+ }
@@ -0,0 +1,17 @@
1
+ const pjson = require('../package.json');
2
+
3
+ const { peerDependencies } = pjson;
4
+
5
+ const packageKeys = Object.keys(peerDependencies);
6
+
7
+ const arg = process.argv[2];
8
+
9
+ if (arg === 'add') {
10
+ console.log(`yarn install --force`);
11
+ } else if (arg === 'remove') {
12
+ console.log(
13
+ `rm -rf ${packageKeys.map((p) => `node_modules/${p}`).join(' ')}`,
14
+ );
15
+ } else {
16
+ console.log('echo "wrong argument."');
17
+ }