@map-colonies/react-components 3.8.1 → 3.10.2

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 (231) hide show
  1. package/.env +1 -0
  2. package/.storybook/main.js +2 -5
  3. package/CHANGELOG.md +54 -0
  4. package/dist/assets/img/dragIcon.png +0 -0
  5. package/dist/assets/img/dragIconLight.png +0 -0
  6. package/dist/assets/img/glyphicons_067_cleaning.png +0 -0
  7. package/dist/assets/img/glyphicons_094_vector_path_square.png +0 -0
  8. package/dist/assets/img/glyphicons_095_vector_path_circle.png +0 -0
  9. package/dist/assets/img/glyphicons_096_vector_path_polygon.png +0 -0
  10. package/dist/assets/img/glyphicons_097_vector_path_line.png +0 -0
  11. package/dist/assets/img/glyphicons_242_google_maps.png +0 -0
  12. package/dist/assets/img/map-marker.gif +0 -0
  13. package/dist/autocomplete/autocomplete.css +25 -0
  14. package/dist/autocomplete/autocomplete.d.ts +33 -0
  15. package/dist/autocomplete/autocomplete.js +480 -0
  16. package/dist/autocomplete/index.d.ts +1 -0
  17. package/dist/autocomplete/index.js +5 -0
  18. package/dist/box/box.d.ts +3 -0
  19. package/dist/box/box.js +35 -0
  20. package/dist/box/index.d.ts +1 -0
  21. package/dist/box/index.js +5 -0
  22. package/dist/cesium-map/data-sources/custom.data-source.d.ts +5 -0
  23. package/dist/cesium-map/data-sources/custom.data-source.js +23 -0
  24. package/dist/cesium-map/data-sources/drawings.data-source.d.ts +34 -0
  25. package/dist/cesium-map/data-sources/drawings.data-source.js +187 -0
  26. package/dist/cesium-map/data-sources/index.d.ts +2 -0
  27. package/dist/cesium-map/data-sources/index.js +14 -0
  28. package/dist/cesium-map/entities/entity.d.ts +5 -0
  29. package/dist/cesium-map/entities/entity.description.d.ts +6 -0
  30. package/dist/cesium-map/entities/entity.description.js +27 -0
  31. package/dist/cesium-map/entities/entity.js +23 -0
  32. package/dist/cesium-map/entities/graphics/polygon.graphics.d.ts +5 -0
  33. package/dist/cesium-map/entities/graphics/polygon.graphics.js +23 -0
  34. package/dist/cesium-map/entities/graphics/polyline.graphics.d.ts +5 -0
  35. package/dist/cesium-map/entities/graphics/polyline.graphics.js +23 -0
  36. package/dist/cesium-map/entities/graphics/rectangle.graphics.d.ts +5 -0
  37. package/dist/cesium-map/entities/graphics/rectangle.graphics.js +23 -0
  38. package/dist/cesium-map/entities/index.d.ts +4 -0
  39. package/dist/cesium-map/entities/index.js +16 -0
  40. package/dist/cesium-map/index.d.ts +7 -0
  41. package/dist/cesium-map/index.js +19 -0
  42. package/dist/cesium-map/layers/3d.tileset.d.ts +7 -0
  43. package/dist/cesium-map/layers/3d.tileset.js +39 -0
  44. package/dist/cesium-map/layers/3d.tileset.update.d.ts +1 -0
  45. package/dist/cesium-map/layers/3d.tileset.update.js +5 -0
  46. package/dist/cesium-map/layers/geojson.layer.d.ts +5 -0
  47. package/dist/cesium-map/layers/geojson.layer.js +23 -0
  48. package/dist/cesium-map/layers/imagery.layer.d.ts +6 -0
  49. package/dist/cesium-map/layers/imagery.layer.js +64 -0
  50. package/dist/cesium-map/layers/index.d.ts +7 -0
  51. package/dist/cesium-map/layers/index.js +19 -0
  52. package/dist/cesium-map/layers/osm.layer.d.ts +9 -0
  53. package/dist/cesium-map/layers/osm.layer.js +36 -0
  54. package/dist/cesium-map/layers/wms.layer.d.ts +9 -0
  55. package/dist/cesium-map/layers/wms.layer.js +36 -0
  56. package/dist/cesium-map/layers/wmts.layer.d.ts +9 -0
  57. package/dist/cesium-map/layers/wmts.layer.js +36 -0
  58. package/dist/cesium-map/layers/xyz.layer.d.ts +9 -0
  59. package/dist/cesium-map/layers/xyz.layer.js +36 -0
  60. package/dist/cesium-map/layers-manager.d.ts +47 -0
  61. package/dist/cesium-map/layers-manager.js +228 -0
  62. package/dist/cesium-map/map.css +54 -0
  63. package/dist/cesium-map/map.d.ts +46 -0
  64. package/dist/cesium-map/map.js +273 -0
  65. package/dist/cesium-map/map.types.d.ts +8 -0
  66. package/dist/cesium-map/map.types.js +12 -0
  67. package/dist/cesium-map/proxied.types.d.ts +19 -0
  68. package/dist/cesium-map/proxied.types.js +89 -0
  69. package/dist/cesium-map/settings/base-maps.css +37 -0
  70. package/dist/cesium-map/settings/base-maps.d.ts +7 -0
  71. package/dist/cesium-map/settings/base-maps.js +78 -0
  72. package/dist/cesium-map/settings/scene-modes.css +19 -0
  73. package/dist/cesium-map/settings/scene-modes.d.ts +7 -0
  74. package/dist/cesium-map/settings/scene-modes.js +65 -0
  75. package/dist/cesium-map/settings/settings.css +49 -0
  76. package/dist/cesium-map/settings/settings.d.ts +23 -0
  77. package/dist/cesium-map/settings/settings.js +79 -0
  78. package/dist/cesium-map/terrain-providers/custom/dummy-quantized-mesh-tile.d.ts +3 -0
  79. package/dist/cesium-map/terrain-providers/custom/dummy-quantized-mesh-tile.js +245 -0
  80. package/dist/cesium-map/terrain-providers/custom/quantized-mesh-decoder.d.ts +9 -0
  81. package/dist/cesium-map/terrain-providers/custom/quantized-mesh-decoder.js +202 -0
  82. package/dist/cesium-map/terrain-providers/custom/quantized-mesh-terrain-provider.d.ts +50 -0
  83. package/dist/cesium-map/terrain-providers/custom/quantized-mesh-terrain-provider.js +136 -0
  84. package/dist/cesium-map/tools/cesium/primitives-conversions.cesium.d.ts +2 -0
  85. package/dist/cesium-map/tools/cesium/primitives-conversions.cesium.js +38 -0
  86. package/dist/cesium-map/tools/coordinates-tracker.tool.css +11 -0
  87. package/dist/cesium-map/tools/coordinates-tracker.tool.d.ts +7 -0
  88. package/dist/cesium-map/tools/coordinates-tracker.tool.js +78 -0
  89. package/dist/cesium-map/tools/draw/drawHelper.css +101 -0
  90. package/dist/cesium-map/tools/draw/drawHelper.d.ts +28 -0
  91. package/dist/cesium-map/tools/draw/drawHelper.js +1694 -0
  92. package/dist/cesium-map/tools/geojson/geojson-to-primitive.d.ts +4 -0
  93. package/dist/cesium-map/tools/geojson/geojson-to-primitive.js +41 -0
  94. package/dist/cesium-map/tools/geojson/index.d.ts +2 -0
  95. package/dist/cesium-map/tools/geojson/index.js +14 -0
  96. package/dist/cesium-map/tools/geojson/point.geojson.d.ts +3 -0
  97. package/dist/cesium-map/tools/geojson/point.geojson.js +21 -0
  98. package/dist/cesium-map/tools/geojson/polygon.geojson.d.ts +3 -0
  99. package/dist/cesium-map/tools/geojson/polygon.geojson.js +24 -0
  100. package/dist/cesium-map/tools/geojson/rectangle.geojson.d.ts +3 -0
  101. package/dist/cesium-map/tools/geojson/rectangle.geojson.js +44 -0
  102. package/dist/cesium-map/tools/inspector.tool.d.ts +4 -0
  103. package/dist/cesium-map/tools/inspector.tool.js +33 -0
  104. package/dist/cesium-map/tools/scale-tracker.tool.css +16 -0
  105. package/dist/cesium-map/tools/scale-tracker.tool.d.ts +8 -0
  106. package/dist/cesium-map/tools/scale-tracker.tool.js +158 -0
  107. package/dist/cesium-map/tools/terranian-height.tool.d.ts +4 -0
  108. package/dist/cesium-map/tools/terranian-height.tool.js +113 -0
  109. package/dist/cssbaseline/cssbaseline.d.ts +5 -0
  110. package/dist/cssbaseline/cssbaseline.js +41 -0
  111. package/dist/cssbaseline/index.d.ts +1 -0
  112. package/dist/cssbaseline/index.js +6 -0
  113. package/dist/date-picker/date-picker.css +9 -0
  114. package/dist/date-picker/date-picker.d.ts +14 -0
  115. package/dist/date-picker/date-picker.js +78 -0
  116. package/dist/date-picker/index.d.ts +1 -0
  117. package/dist/date-picker/index.js +13 -0
  118. package/dist/date-range-picker/date-range-picker.css +9 -0
  119. package/dist/date-range-picker/date-range-picker.d.ts +26 -0
  120. package/dist/date-range-picker/date-range-picker.form-control.css +3 -0
  121. package/dist/date-range-picker/date-range-picker.form-control.d.ts +28 -0
  122. package/dist/date-range-picker/date-range-picker.form-control.js +95 -0
  123. package/dist/date-range-picker/date-range-picker.js +104 -0
  124. package/dist/date-range-picker/index.d.ts +2 -0
  125. package/dist/date-range-picker/index.js +14 -0
  126. package/dist/file-picker/file-picker.css +62 -0
  127. package/dist/file-picker/file-picker.d.ts +276 -0
  128. package/dist/file-picker/file-picker.js +151 -0
  129. package/dist/file-picker/fs-map.json +1557 -0
  130. package/dist/file-picker/index.d.ts +2 -0
  131. package/dist/file-picker/index.js +14 -0
  132. package/dist/file-picker/localization.d.ts +11 -0
  133. package/dist/file-picker/localization.js +124 -0
  134. package/dist/index.d.ts +13 -0
  135. package/dist/index.js +23 -16
  136. package/dist/map-filter-container/container-map.css +5 -0
  137. package/dist/map-filter-container/container-map.d.ts +11 -0
  138. package/dist/map-filter-container/container-map.js +31 -0
  139. package/dist/map-filter-container/index.d.ts +1 -0
  140. package/dist/map-filter-container/index.js +13 -0
  141. package/dist/map-filter-container/map-filter-container.d.ts +9 -0
  142. package/dist/map-filter-container/map-filter-container.js +78 -0
  143. package/dist/map-filter-container/polygon-selection-ui.d.ts +12 -0
  144. package/dist/map-filter-container/polygon-selection-ui.js +62 -0
  145. package/dist/models/defaults.d.ts +28 -0
  146. package/dist/models/defaults.js +32 -0
  147. package/dist/models/enums.d.ts +14 -0
  148. package/dist/models/enums.js +20 -0
  149. package/dist/models/index.d.ts +1 -0
  150. package/dist/models/index.js +13 -0
  151. package/dist/ol-map/feature.d.ts +6 -0
  152. package/dist/ol-map/feature.js +20 -0
  153. package/dist/ol-map/index.d.ts +6 -0
  154. package/dist/ol-map/index.js +18 -0
  155. package/dist/ol-map/interactions/draw.d.ts +8 -0
  156. package/dist/ol-map/interactions/draw.js +44 -0
  157. package/dist/ol-map/interactions/index.d.ts +1 -0
  158. package/dist/ol-map/interactions/index.js +13 -0
  159. package/dist/ol-map/layers/index.d.ts +3 -0
  160. package/dist/ol-map/layers/index.js +15 -0
  161. package/dist/ol-map/layers/tile-layer.d.ts +9 -0
  162. package/dist/ol-map/layers/tile-layer.js +48 -0
  163. package/dist/ol-map/layers/vector-layer.d.ts +4 -0
  164. package/dist/ol-map/layers/vector-layer.js +48 -0
  165. package/dist/ol-map/layers/vector-tile-layer.d.ts +10 -0
  166. package/dist/ol-map/layers/vector-tile-layer.js +66 -0
  167. package/dist/ol-map/map.css +17 -0
  168. package/dist/ol-map/map.d.ts +14 -0
  169. package/dist/ol-map/map.js +117 -0
  170. package/dist/ol-map/source/index.d.ts +6 -0
  171. package/dist/ol-map/source/index.js +18 -0
  172. package/dist/ol-map/source/mvt.d.ts +11 -0
  173. package/dist/ol-map/source/mvt.js +37 -0
  174. package/dist/ol-map/source/osm.d.ts +2 -0
  175. package/dist/ol-map/source/osm.js +14 -0
  176. package/dist/ol-map/source/vector-source.d.ts +4 -0
  177. package/dist/ol-map/source/vector-source.js +45 -0
  178. package/dist/ol-map/source/wms.d.ts +17 -0
  179. package/dist/ol-map/source/wms.js +30 -0
  180. package/dist/ol-map/source/wmts.d.ts +21 -0
  181. package/dist/ol-map/source/wmts.js +59 -0
  182. package/dist/ol-map/source/xyz.d.ts +12 -0
  183. package/dist/ol-map/source/xyz.js +27 -0
  184. package/dist/ol-map/style.d.ts +4 -0
  185. package/dist/ol-map/style.js +22 -0
  186. package/dist/popover/index.d.ts +1 -0
  187. package/dist/popover/index.js +5 -0
  188. package/dist/popover/popover.d.ts +3 -0
  189. package/dist/popover/popover.js +35 -0
  190. package/dist/smart-table/__mock-data__/smartTableMocks.d.ts +7 -0
  191. package/dist/smart-table/__mock-data__/smartTableMocks.js +17 -0
  192. package/dist/smart-table/index.d.ts +2 -0
  193. package/dist/smart-table/index.js +14 -0
  194. package/dist/smart-table/smart-table-head.d.ts +11 -0
  195. package/dist/smart-table/smart-table-head.js +22 -0
  196. package/dist/smart-table/smart-table-row.d.ts +12 -0
  197. package/dist/smart-table/smart-table-row.js +46 -0
  198. package/dist/smart-table/smart-table-types.d.ts +9 -0
  199. package/dist/smart-table/smart-table-types.js +2 -0
  200. package/dist/smart-table/smart-table.d.ts +17 -0
  201. package/dist/smart-table/smart-table.js +51 -0
  202. package/dist/theme/index.d.ts +1 -0
  203. package/dist/theme/index.js +13 -0
  204. package/dist/theme/theme.d.ts +8 -0
  205. package/dist/theme/theme.js +124 -0
  206. package/dist/utils/map.d.ts +3 -0
  207. package/dist/utils/map.js +21 -0
  208. package/dist/utils/projections.d.ts +6 -0
  209. package/dist/utils/projections.js +10 -0
  210. package/dist/utils/story.d.ts +12 -0
  211. package/dist/utils/story.js +2 -0
  212. package/package.json +103 -100
  213. package/public/assets/img/map-marker.gif +0 -0
  214. package/src/lib/cesium-map/map.tsx +22 -12
  215. package/src/lib/cesium-map/terrain-providers/terrain-provider-heights-tool.stories.tsx +155 -0
  216. package/src/lib/cesium-map/terrain-providers/terrain-provider.stories.tsx +5 -3
  217. package/src/lib/cesium-map/tools/coordinates-tracker.tool.tsx +1 -1
  218. package/src/lib/cesium-map/tools/inspector.tool.tsx +15 -0
  219. package/src/lib/cesium-map/tools/terranian-height.tool.tsx +167 -0
  220. package/src/lib/date-range-picker/{stories/DateRangePicker.stories.tsx → date-range-picker.stories.tsx} +5 -5
  221. package/src/lib/file-picker/file-picker.css +62 -0
  222. package/src/lib/file-picker/file-picker.stories.tsx +447 -0
  223. package/src/lib/file-picker/file-picker.tsx +180 -0
  224. package/src/lib/file-picker/fs-map.json +1557 -0
  225. package/src/lib/file-picker/index.ts +2 -0
  226. package/src/lib/file-picker/localization.ts +164 -0
  227. package/src/lib/index.ts +1 -0
  228. package/src/lib/models/enums.ts +1 -0
  229. package/src/lib/smart-table/smart-table-row.spec.tsx +1 -1
  230. package/tsbuildconfig.json +2 -2
  231. package/tsconfig.json +2 -1
package/package.json CHANGED
@@ -1,100 +1,103 @@
1
- {
2
- "name": "@map-colonies/react-components",
3
- "version": "3.8.1",
4
- "module": "dist/index.js",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "bugs": {
8
- "url": "https://github.com/MapColonies/shared-components/issues"
9
- },
10
- "repository": {
11
- "type": "git",
12
- "url": "https://github.com/MapColonies/shared-components.git"
13
- },
14
- "publishConfig": {
15
- "access": "public"
16
- },
17
- "license": "MIT",
18
- "dependencies": {
19
- "@date-io/date-fns": "^1.3.13",
20
- "@here/quantized-mesh-decoder": "^1.2.8",
21
- "@map-colonies/react-core": "^3.3.1",
22
- "@material-ui/core": "^4.11.0",
23
- "@material-ui/icons": "^4.9.1",
24
- "@material-ui/pickers": "^3.2.10",
25
- "@testing-library/jest-dom": "^4.2.4",
26
- "@testing-library/react": "^9.3.2",
27
- "@testing-library/user-event": "^7.1.2",
28
- "@turf/bbox": "^6.0.1",
29
- "@turf/bbox-polygon": "^6.0.1",
30
- "@turf/boolean-point-in-polygon": "^6.5.0",
31
- "@turf/helpers": "^6.1.4",
32
- "@turf/rewind": "^5.1.5",
33
- "@types/geojson": "^7946.0.7",
34
- "@types/jest": "^24.0.0",
35
- "@types/node": "^12.0.0",
36
- "@types/ol": "^6.3.1",
37
- "@types/react": "^16.9.0",
38
- "@types/react-dom": "^16.9.0",
39
- "@types/textarea-caret": "^3.0.1",
40
- "cesium": "1.84.0",
41
- "copy-webpack-plugin": "^6.3.1",
42
- "copyfiles": "2.3.0",
43
- "cross-env": "7.0.2",
44
- "date-fns": "^2.14.0",
45
- "get-input-selection": "^1.1.4",
46
- "lodash": "^4.17.20",
47
- "ol": "^6.4.3",
48
- "react": "^16.13.1",
49
- "react-dom": "^16.13.1",
50
- "react-scripts": "3.4.1",
51
- "resium": "^1.13.1",
52
- "rimraf": "3.0.2",
53
- "textarea-caret": "^3.1.0",
54
- "typescript": "~3.7.2"
55
- },
56
- "scripts": {
57
- "start": "react-scripts start",
58
- "build": "npx rimraf dist && tsc --project tsbuildconfig.json && yarn run copyassets:components",
59
- "test": "react-scripts test",
60
- "test:nowatch": "react-scripts test --coverage --watchAll=false --reporters='default' --reporters='jest-html-reporters'",
61
- "eject": "react-scripts eject",
62
- "postbuild": "copyfiles -u 2 -e \"**/*.ts\" -e \"**/*.tsx\" \"src/lib/**/*\" dist",
63
- "copyassets:all": "yarn run copyassets:cesium",
64
- "copyassets:cesium": "copyfiles -u 5 \"../../node_modules/cesium/Build/Cesium/**/*\" \"storybook-static\"",
65
- "copyassets:components": "copyfiles -u 1 \"./public/assets/**/*\" \"dist\"",
66
- "storybook": "yarn run copyassets:all && start-storybook -p 9010 -s public,\"storybook-static\"",
67
- "storybook-https": "yarn run copyassets:all && start-storybook --ssl-cert ~/example.crt --ssl-key ~/example.key --https -p 9010 -s public,\"storybook-static\"",
68
- "build-storybook": "build-storybook -s public",
69
- "eslint-check": "npx eslint . --ext .ts,.tsx"
70
- },
71
- "browserslist": {
72
- "production": [
73
- ">0.2%",
74
- "not dead",
75
- "not op_mini all"
76
- ],
77
- "development": [
78
- "last 1 chrome version",
79
- "last 1 firefox version",
80
- "last 1 safari version"
81
- ]
82
- },
83
- "devDependencies": {
84
- "@types/enzyme": "^3.10.5",
85
- "@types/enzyme-adapter-react-16": "^1.0.6",
86
- "@types/lodash": "^4.14.165",
87
- "@types/react-test-renderer": "^16.9.2",
88
- "enzyme": "^3.11.0",
89
- "enzyme-adapter-react-16": "^1.15.2",
90
- "jest-enzyme": "^7.1.2",
91
- "react-test-renderer": "^16.13.1"
92
- },
93
- "gitHead": "3e15e1e543de64636187a5482827f6f2ba1de4bb",
94
- "jest": {
95
- "coverageReporters": [
96
- "text",
97
- "html"
98
- ]
99
- }
100
- }
1
+ {
2
+ "name": "@map-colonies/react-components",
3
+ "version": "3.10.2",
4
+ "module": "dist/index.js",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "bugs": {
8
+ "url": "https://github.com/MapColonies/shared-components/issues"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/MapColonies/shared-components.git"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "license": "MIT",
18
+ "dependencies": {
19
+ "@date-io/date-fns": "^1.3.13",
20
+ "@here/quantized-mesh-decoder": "^1.2.8",
21
+ "@map-colonies/react-core": "^3.3.2",
22
+ "@material-ui/core": "^4.11.0",
23
+ "@material-ui/icons": "^4.9.1",
24
+ "@material-ui/pickers": "^3.2.10",
25
+ "@testing-library/jest-dom": "^4.2.4",
26
+ "@testing-library/react": "^9.3.2",
27
+ "@testing-library/user-event": "^7.1.2",
28
+ "@turf/bbox": "^6.0.1",
29
+ "@turf/bbox-polygon": "^6.0.1",
30
+ "@turf/boolean-point-in-polygon": "^6.5.0",
31
+ "@turf/helpers": "^6.1.4",
32
+ "@turf/rewind": "^5.1.5",
33
+ "@types/geojson": "^7946.0.7",
34
+ "@types/jest": "^24.0.0",
35
+ "@types/node": "^12.0.0",
36
+ "@types/ol": "^6.3.1",
37
+ "@types/react": "^16.9.0",
38
+ "@types/react-dom": "^16.9.0",
39
+ "@types/textarea-caret": "^3.0.1",
40
+ "babel-loader": "8.0.4",
41
+ "cesium": "1.84.0",
42
+ "chonky": "^2.3.2",
43
+ "chonky-icon-fontawesome": "^2.3.2",
44
+ "copy-webpack-plugin": "^6.3.1",
45
+ "copyfiles": "2.3.0",
46
+ "cross-env": "7.0.2",
47
+ "date-fns": "^2.14.0",
48
+ "get-input-selection": "^1.1.4",
49
+ "lodash": "^4.17.20",
50
+ "ol": "^6.4.3",
51
+ "react": "^16.13.1",
52
+ "react-dom": "^16.13.1",
53
+ "react-scripts": "^4.0.1",
54
+ "resium": "^1.13.1",
55
+ "rimraf": "3.0.2",
56
+ "textarea-caret": "^3.1.0",
57
+ "typescript": "4.2.2"
58
+ },
59
+ "scripts": {
60
+ "start": "react-scripts start",
61
+ "build": "npx rimraf dist && tsc --project tsbuildconfig.json && yarn run copyassets:components",
62
+ "test": "react-scripts test",
63
+ "test:nowatch": "react-scripts test --coverage --watchAll=false --reporters='default' --reporters='jest-html-reporters'",
64
+ "eject": "react-scripts eject",
65
+ "postbuild": "copyfiles -u 2 -e \"**/*.ts\" -e \"**/*.tsx\" \"src/lib/**/*\" dist",
66
+ "copyassets:all": "yarn run copyassets:cesium",
67
+ "copyassets:cesium": "copyfiles -u 5 \"../../node_modules/cesium/Build/Cesium/**/*\" \"storybook-static\"",
68
+ "copyassets:components": "copyfiles -u 1 \"./public/assets/**/*\" \"dist\"",
69
+ "storybook": "yarn run copyassets:all && start-storybook -p 9010 -s public,\"storybook-static\"",
70
+ "storybook-https": "yarn run copyassets:all && start-storybook --ssl-cert ~/example.crt --ssl-key ~/example.key --https -p 9010 -s public,\"storybook-static\"",
71
+ "build-storybook": "build-storybook -s public",
72
+ "eslint-check": "npx eslint . --ext .ts,.tsx"
73
+ },
74
+ "browserslist": {
75
+ "production": [
76
+ ">0.2%",
77
+ "not dead",
78
+ "not op_mini all"
79
+ ],
80
+ "development": [
81
+ "last 1 chrome version",
82
+ "last 1 firefox version",
83
+ "last 1 safari version"
84
+ ]
85
+ },
86
+ "devDependencies": {
87
+ "@types/enzyme": "^3.10.5",
88
+ "@types/enzyme-adapter-react-16": "^1.0.6",
89
+ "@types/lodash": "^4.14.165",
90
+ "@types/react-test-renderer": "^16.9.2",
91
+ "enzyme": "^3.11.0",
92
+ "enzyme-adapter-react-16": "^1.15.2",
93
+ "jest-enzyme": "^7.1.2",
94
+ "react-test-renderer": "^16.13.1"
95
+ },
96
+ "gitHead": "0b46e28cd15388a779c576920493e2f748cdc2ef",
97
+ "jest": {
98
+ "coverageReporters": [
99
+ "text",
100
+ "html"
101
+ ]
102
+ }
103
+ }
Binary file
@@ -22,11 +22,12 @@ import {
22
22
  import { isNumber, isArray } from 'lodash';
23
23
  import { getAltitude, toDegrees } from '../utils/map';
24
24
  import { Box } from '../box';
25
+ import { Proj } from '../utils/projections';
25
26
  import { CoordinatesTrackerTool } from './tools/coordinates-tracker.tool';
26
27
  import { ScaleTrackerTool } from './tools/scale-tracker.tool';
27
28
  import { CesiumSettings, IBaseMap, IBaseMaps } from './settings/settings';
28
29
  import LayerManager from './layers-manager';
29
- import { CesiumSceneMode, CesiumSceneModeEnum, Proj } from '.';
30
+ import { CesiumSceneMode, CesiumSceneModeEnum } from './map.types';
30
31
 
31
32
  import './map.css';
32
33
 
@@ -224,6 +225,16 @@ export const CesiumMap: React.FC<CesiumMapProps> = (props) => {
224
225
  height: 0,
225
226
  };
226
227
  }
228
+
229
+ const getCameraPositionCartographic = (): ICameraPosition => {
230
+ const camPos = mapViewRef.camera.positionCartographic;
231
+ return {
232
+ longitude: toDegrees(camPos.longitude),
233
+ latitude: toDegrees(camPos.latitude),
234
+ height: camPos.height,
235
+ };
236
+ };
237
+
227
238
  // https://stackoverflow.com/questions/33348761/get-center-in-cesium-map
228
239
  if (mapViewRef.scene.mode === SceneMode.SCENE3D) {
229
240
  const windowPosition = new Cartesian2(
@@ -240,18 +251,17 @@ export const CesiumMap: React.FC<CesiumMapProps> = (props) => {
240
251
  const pickPositionCartographic = mapViewRef.scene.globe.ellipsoid.cartesianToCartographic(
241
252
  pickPosition as Cartesian3
242
253
  );
243
- return {
244
- longitude: toDegrees(pickPositionCartographic.longitude),
245
- latitude: toDegrees(pickPositionCartographic.latitude),
246
- height: mapViewRef.scene.camera.positionCartographic.height,
247
- };
254
+
255
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
256
+ return pickPositionCartographic !== undefined
257
+ ? {
258
+ longitude: toDegrees(pickPositionCartographic.longitude),
259
+ latitude: toDegrees(pickPositionCartographic.latitude),
260
+ height: mapViewRef.scene.camera.positionCartographic.height,
261
+ }
262
+ : getCameraPositionCartographic();
248
263
  } else {
249
- const camPos = mapViewRef.camera.positionCartographic;
250
- return {
251
- longitude: toDegrees(camPos.longitude),
252
- latitude: toDegrees(camPos.latitude),
253
- height: camPos.height,
254
- };
264
+ return getCameraPositionCartographic();
255
265
  }
256
266
  };
257
267
 
@@ -0,0 +1,155 @@
1
+ import React, { useState } from 'react';
2
+ import {
3
+ ArcGISTiledElevationTerrainProvider,
4
+ EllipsoidTerrainProvider,
5
+ TerrainProvider,
6
+ CesiumTerrainProvider,
7
+ Resource,
8
+ } from 'cesium';
9
+ import { Story, Meta } from '@storybook/react/types-6-0';
10
+ import { CesiumMap, useCesiumMap } from '../map';
11
+ import { CesiumSceneMode } from '../map.types';
12
+ import { Cesium3DTileset } from '../layers';
13
+ import { InspectorTool } from '../tools/inspector.tool';
14
+ import { TerrainianHeightTool } from '../tools/terranian-height.tool';
15
+ import { LayerType } from '../layers-manager';
16
+
17
+ export default {
18
+ title: 'Cesium Map/QuantizedMesh',
19
+ component: CesiumMap,
20
+ parameters: {
21
+ layout: 'fullscreen',
22
+ },
23
+ } as Meta;
24
+
25
+ const mapDivStyle = {
26
+ height: '90%',
27
+ width: '100%',
28
+ position: 'absolute' as const,
29
+ };
30
+
31
+ const BASE_MAPS = {
32
+ maps: [
33
+ {
34
+ id: '1st',
35
+ title: '1st Map Title',
36
+ isCurrent: true,
37
+ thumbnail:
38
+ 'https://nsw.digitaltwin.terria.io/build/efa2f6c408eb790753a9b5fb2f3dc678.png',
39
+ baseRasteLayers: [
40
+ {
41
+ id: 'GOOGLE_TERRAIN',
42
+ type: 'XYZ_LAYER' as LayerType,
43
+ opacity: 1,
44
+ zIndex: 0,
45
+ options: {
46
+ url: 'https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}',
47
+ layers: '',
48
+ credit: 'GOOGLE',
49
+ },
50
+ },
51
+ ],
52
+ baseVectorLayers: [],
53
+ },
54
+ ],
55
+ };
56
+
57
+ const EllipsoidProvider = new EllipsoidTerrainProvider({});
58
+
59
+ // eslint-disable-next-line @typescript-eslint/naming-convention
60
+ const MCCesiumProviderMercator = new CesiumTerrainProvider({
61
+ url: new Resource({
62
+ url: 'http://localhost:3000/terrain_mercator_crop',
63
+ }),
64
+ });
65
+
66
+ // eslint-disable-next-line @typescript-eslint/naming-convention
67
+ const MCCesiumProviderW84 = new CesiumTerrainProvider({
68
+ url: new Resource({
69
+ url: 'http://localhost:3000/terrain_w84_geo_crop',
70
+ }),
71
+ });
72
+
73
+ const ArcGisProvider = new ArcGISTiledElevationTerrainProvider({
74
+ url:
75
+ 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer',
76
+ });
77
+
78
+ const terrainProviderListQmesh = [
79
+ {
80
+ id: 'NONE',
81
+ value: EllipsoidProvider,
82
+ },
83
+ {
84
+ id: 'MC Mercator - Cesium Terrain Provider',
85
+ value: MCCesiumProviderMercator,
86
+ },
87
+ {
88
+ id: 'MC W84 - Cesium Terrain Provider',
89
+ value: MCCesiumProviderW84,
90
+ },
91
+ {
92
+ id: 'Arc Gis Terrain Provider',
93
+ value: ArcGisProvider,
94
+ },
95
+ ];
96
+
97
+ interface ITerrainProviderItem {
98
+ id: string;
99
+ value: TerrainProvider | undefined;
100
+ }
101
+
102
+ interface ITerrainProviderSelectorProps {
103
+ terrainProviderList: ITerrainProviderItem[];
104
+ }
105
+
106
+ const TerrainProviderSelector: React.FC<ITerrainProviderSelectorProps> = ({
107
+ terrainProviderList,
108
+ }) => {
109
+ const mapViewer = useCesiumMap();
110
+
111
+ return (
112
+ <>
113
+ <select
114
+ defaultValue={terrainProviderList[0].id}
115
+ onChange={(evt): void => {
116
+ const selected = terrainProviderList.find(
117
+ (item) => item.id === evt.target.value
118
+ );
119
+ mapViewer.terrainProvider = (selected as ITerrainProviderItem)
120
+ .value as TerrainProvider;
121
+ }}
122
+ >
123
+ {terrainProviderList.map((provider) => {
124
+ return <option key={provider.id}>{provider.id}</option>;
125
+ })}
126
+ </select>
127
+ </>
128
+ );
129
+ };
130
+
131
+ export const QuantizedMeshHeightsTool: Story = () => {
132
+ const [center] = useState<[number, number]>([-122, 43]);
133
+ return (
134
+ <div style={mapDivStyle}>
135
+ <CesiumMap
136
+ center={center}
137
+ zoom={5}
138
+ imageryProvider={false}
139
+ sceneModes={[CesiumSceneMode.SCENE3D, CesiumSceneMode.COLUMBUS_VIEW]}
140
+ baseMaps={BASE_MAPS}
141
+ >
142
+ <Cesium3DTileset
143
+ isZoomTo={true}
144
+ url="https://3d.ofek-air.com/3d/Jeru_Old_City_Cesium/ACT/Jeru_Old_City_Cesium_ACT.json"
145
+ />
146
+ <TerrainProviderSelector
147
+ terrainProviderList={terrainProviderListQmesh}
148
+ />
149
+ <TerrainianHeightTool />
150
+ <InspectorTool />
151
+ </CesiumMap>
152
+ </div>
153
+ );
154
+ };
155
+ QuantizedMeshHeightsTool.storyName = 'Heights Tool';
@@ -13,10 +13,11 @@ import { Story, Meta } from '@storybook/react/types-6-0';
13
13
  import { CesiumMap, useCesiumMap } from '../map';
14
14
  import { CesiumSceneMode } from '../map.types';
15
15
  import { Cesium3DTileset } from '../layers';
16
+ import { LayerType } from '../layers-manager';
16
17
  import QuantizedMeshTerrainProvider from './custom/quantized-mesh-terrain-provider';
17
18
 
18
19
  export default {
19
- title: 'Cesium Map',
20
+ title: 'Cesium Map/QuantizedMesh',
20
21
  component: CesiumMap,
21
22
  parameters: {
22
23
  layout: 'fullscreen',
@@ -40,7 +41,7 @@ const BASE_MAPS = {
40
41
  baseRasteLayers: [
41
42
  {
42
43
  id: 'GOOGLE_TERRAIN',
43
- type: 'XYZ_LAYER',
44
+ type: 'XYZ_LAYER' as LayerType,
44
45
  opacity: 1,
45
46
  zIndex: 0,
46
47
  options: {
@@ -159,7 +160,7 @@ const TerrainProviderSelector: React.FC<ITerrainProviderSelectorProps> = ({
159
160
  );
160
161
  };
161
162
 
162
- export const QuantizedMesh: Story = () => {
163
+ export const QuantizedMeshProviders: Story = () => {
163
164
  // const [center] = useState<[number, number]>([24, -200]);
164
165
  const [center] = useState<[number, number]>([-122, 43]);
165
166
  return (
@@ -181,3 +182,4 @@ export const QuantizedMesh: Story = () => {
181
182
  </div>
182
183
  );
183
184
  };
185
+ QuantizedMeshProviders.storyName = 'Providers';
@@ -7,7 +7,7 @@ import {
7
7
  Proj,
8
8
  COORDINATES_WGS_FRACTION_DIGITS,
9
9
  COORDINATES_MERCATOR_FRACTION_DIGITS,
10
- } from '..';
10
+ } from '../../utils/projections';
11
11
 
12
12
  export interface RCoordinatesTrackerToolProps {
13
13
  projection?: Proj;
@@ -0,0 +1,15 @@
1
+ import React, { useEffect } from 'react';
2
+ import { viewerCesiumInspectorMixin } from 'cesium';
3
+ import { CesiumViewer, useCesiumMap } from '../map';
4
+
5
+ export interface InspectorProps {}
6
+
7
+ export const InspectorTool: React.FC<InspectorProps> = (props) => {
8
+ const mapViewer: CesiumViewer = useCesiumMap();
9
+
10
+ useEffect(() => {
11
+ mapViewer.extend(viewerCesiumInspectorMixin);
12
+ }, [mapViewer]);
13
+
14
+ return <></>;
15
+ };
@@ -0,0 +1,167 @@
1
+ import React, { ChangeEvent } from 'react';
2
+ import {
3
+ Cartesian2,
4
+ Ellipsoid,
5
+ Color as CesiumColor,
6
+ LabelStyle as CesiumLabelStyle,
7
+ VerticalOrigin as CesiumVerticalOrigin,
8
+ Cartographic,
9
+ sampleTerrainMostDetailed,
10
+ } from 'cesium';
11
+ import { CesiumViewer, useCesiumMap } from '../map';
12
+
13
+ interface IParsedData {
14
+ cartographic: Cartographic;
15
+ cartesian: Cartesian2;
16
+ }
17
+
18
+ const LABEL_PIXEL_OFFSET = -25;
19
+ const FIRST_DATA_ROW_IDX = 2;
20
+
21
+ export interface TerrainianHeightProps {}
22
+
23
+ export const TerrainianHeightTool: React.FC<TerrainianHeightProps> = (
24
+ props
25
+ ) => {
26
+ const mapViewer: CesiumViewer = useCesiumMap();
27
+
28
+ const csvToArray = (str: string, delimiter = ','): IParsedData[] => {
29
+ // const headers = str.slice(0, str.indexOf('\n')).split(delimiter);
30
+ const rows = str.slice(str.indexOf('\n') + 1).split('\n');
31
+
32
+ const arr = rows.map((row) => {
33
+ const values = row.split(delimiter);
34
+ const el = Cartographic.fromDegrees(
35
+ parseFloat(values[0]),
36
+ parseFloat(values[1])
37
+ );
38
+ // const el = headers.reduce((object: Record<string, number>, header, index) => {
39
+ // const trimmedHeader = header.trim();
40
+ // object[trimmedHeader] = parseFloat(values[index]);
41
+ // return object;
42
+ // }, {});
43
+
44
+ //return el;
45
+ return {
46
+ cartographic: el,
47
+ cartesian: new Cartesian2(parseFloat(values[0]), parseFloat(values[1])),
48
+ };
49
+ });
50
+
51
+ return arr;
52
+ };
53
+
54
+ const loadCSV = (evt: ChangeEvent<HTMLInputElement>): void => {
55
+ evt.preventDefault();
56
+ evt.persist();
57
+ const reader = new FileReader();
58
+
59
+ reader.onload = (e: ProgressEvent<FileReader>): any => {
60
+ const text = e.target?.result;
61
+ const parsed = csvToArray(text as string);
62
+ const ellipsoid = Ellipsoid.WGS84;
63
+
64
+ console.log('Loaded CSV content:\n', text);
65
+
66
+ void sampleTerrainMostDetailed(
67
+ mapViewer.terrainProvider,
68
+ parsed.map((item) => item.cartographic)
69
+ ).then(
70
+ (updatedPositions) => {
71
+ console.log(updatedPositions);
72
+
73
+ mapViewer.scene.globe.depthTestAgainstTerrain = true;
74
+ mapViewer.entities.suspendEvents();
75
+ mapViewer.entities.removeAll();
76
+
77
+ updatedPositions.forEach((position, idx) => {
78
+ mapViewer.entities.add({
79
+ name: (idx + FIRST_DATA_ROW_IDX).toString(),
80
+ position: ellipsoid.cartographicToCartesian(position),
81
+ billboard: {
82
+ verticalOrigin: CesiumVerticalOrigin.BOTTOM,
83
+ scale: 0.7,
84
+ image: 'assets/img/map-marker.gif',
85
+ },
86
+ label: {
87
+ text: (idx + FIRST_DATA_ROW_IDX).toString(),
88
+ font: '14pt monospace',
89
+ fillColor: CesiumColor.BLACK,
90
+ style: CesiumLabelStyle.FILL_AND_OUTLINE,
91
+ outlineWidth: 4,
92
+ outlineColor: CesiumColor.BLACK,
93
+ verticalOrigin: CesiumVerticalOrigin.BOTTOM,
94
+ pixelOffset: new Cartesian2(0, LABEL_PIXEL_OFFSET),
95
+ },
96
+ description: `
97
+ Long: ${parsed[idx].cartesian.x} </br>
98
+ Lat: ${parsed[idx].cartesian.y} </br>
99
+ Height(m): <span style="font-weight: 500">${position.height}</span>
100
+ `,
101
+ });
102
+ });
103
+
104
+ mapViewer.entities.resumeEvents();
105
+
106
+ if (evt.target.files !== null) {
107
+ exportToCsv(
108
+ `terranian_heights_${evt.target.files[0].name}`,
109
+ parsed
110
+ );
111
+ evt.target.value = '';
112
+ }
113
+
114
+ console.log(
115
+ 'Pinned point count is ',
116
+ mapViewer.entities.values.length
117
+ );
118
+ },
119
+ (err) => {
120
+ console.error('ERROR while sampleTerrainMostDetailed:', err);
121
+ }
122
+ );
123
+ };
124
+
125
+ if (evt.target.files?.[0]) {
126
+ reader.readAsText(evt.target.files[0]);
127
+ }
128
+ };
129
+
130
+ const exportToCsv = (filename: string, rows: IParsedData[]): void => {
131
+ const processRow = (row: IParsedData): string => {
132
+ let finalVal = '';
133
+ finalVal += row.cartesian.x.toString() + ',';
134
+ finalVal += row.cartesian.y.toString() + ',';
135
+ finalVal += row.cartographic.height.toString();
136
+ return finalVal + '\n';
137
+ };
138
+
139
+ let csvFile = 'long,lat,height\n';
140
+ rows.forEach((row) => {
141
+ csvFile += processRow(row);
142
+ });
143
+
144
+ const blob = new Blob([csvFile], { type: 'text/csv;charset=utf-8;' });
145
+ const link = document.createElement('a');
146
+ const url = URL.createObjectURL(blob);
147
+ link.setAttribute('href', url);
148
+ link.setAttribute('download', filename);
149
+ link.style.visibility = 'hidden';
150
+ document.body.appendChild(link);
151
+ link.click();
152
+ document.body.removeChild(link);
153
+ };
154
+
155
+ return (
156
+ <>
157
+ <input
158
+ type="file"
159
+ id="csvFile"
160
+ accept=".csv"
161
+ onChange={(e: ChangeEvent<HTMLInputElement>): void => {
162
+ loadCSV(e);
163
+ }}
164
+ />
165
+ </>
166
+ );
167
+ };
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import { action } from '@storybook/addon-actions';
3
3
  import { Story } from '@storybook/react/types-6-0';
4
- import { CSFStory } from '../../utils/story';
5
- import { SupportedLocales } from '../../models/enums';
6
- import { DateTimeRangePicker } from '../date-range-picker';
7
- import { DateTimeRangePickerFormControl } from '../date-range-picker.form-control';
4
+ import { CSFStory } from '../utils/story';
5
+ import { SupportedLocales } from '../models/enums';
6
+ import { DateTimeRangePicker } from './date-range-picker';
7
+ import { DateTimeRangePickerFormControl } from './date-range-picker.form-control';
8
8
 
9
9
  export default {
10
- title: 'Picker',
10
+ title: 'Date Range Picker',
11
11
  component: DateTimeRangePicker,
12
12
  };
13
13