@kalisio/kdk 2.1.8 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/.travis.test.sh +42 -10
  2. package/README.md +2 -2
  3. package/core/api/application.js +6 -1
  4. package/core/api/authentication.js +17 -1
  5. package/core/api/db.js +7 -2
  6. package/core/api/hooks/hooks.authentication.js +4 -2
  7. package/core/api/hooks/hooks.authorisations.js +12 -2
  8. package/core/api/hooks/hooks.model.js +5 -5
  9. package/core/api/hooks/hooks.organisations.js +0 -4
  10. package/core/api/services/account/account.hooks.js +10 -6
  11. package/core/api/services/account/account.service.js +1 -1
  12. package/{map/api/services/geocoder/geocoder.hooks.js → core/api/services/import-export/import-export.hooks.js} +7 -5
  13. package/core/api/services/import-export/import-export.service.js +11 -0
  14. package/core/api/services/index.js +13 -1
  15. package/core/api/services/users/users.hooks.js +2 -3
  16. package/core/client/api.js +16 -14
  17. package/core/client/capabilities.js +6 -2
  18. package/core/client/components/KContent.vue +11 -1
  19. package/core/client/components/KDialog.vue +17 -15
  20. package/core/client/components/KSponsor.vue +1 -1
  21. package/core/client/components/KTextArea.vue +5 -1
  22. package/core/client/components/app/KAbout.vue +1 -2
  23. package/core/client/components/app/KWelcome.vue +3 -5
  24. package/core/client/components/chart/KTimeSeriesChart.vue +24 -37
  25. package/core/client/components/collection/KColumn.vue +20 -17
  26. package/core/client/components/editor/KModalEditor.vue +0 -2
  27. package/core/client/components/form/KChipsField.vue +12 -2
  28. package/core/client/components/form/KColorField.vue +12 -2
  29. package/core/client/components/form/KColorScaleField.vue +12 -2
  30. package/core/client/components/form/KDateTimeRangeField.vue +12 -2
  31. package/core/client/components/form/KDatetimeField.vue +12 -2
  32. package/core/client/components/form/KEmailField.vue +12 -2
  33. package/core/client/components/form/KFileField.vue +12 -2
  34. package/core/client/components/form/KForm.vue +43 -9
  35. package/core/client/components/form/KIconField.vue +12 -2
  36. package/core/client/components/form/KItemField.vue +25 -4
  37. package/core/client/components/form/KNumberField.vue +12 -2
  38. package/core/client/components/form/KOptionsField.vue +12 -2
  39. package/core/client/components/form/KPasswordField.vue +12 -2
  40. package/core/client/components/form/KPhoneField.vue +13 -3
  41. package/core/client/components/form/KPropertyItemField.vue +12 -2
  42. package/core/client/components/form/KResolutionField.vue +126 -0
  43. package/core/client/components/form/KRoleField.vue +12 -2
  44. package/core/client/components/form/KSelectField.vue +14 -4
  45. package/core/client/components/form/KTextField.vue +12 -2
  46. package/core/client/components/form/KTextareaField.vue +13 -3
  47. package/core/client/components/form/KToggleField.vue +12 -2
  48. package/core/client/components/form/KTokenField.vue +12 -2
  49. package/core/client/components/form/KUnitField.vue +12 -2
  50. package/core/client/components/form/KUrlField.vue +12 -2
  51. package/core/client/components/input/KIconChooser.vue +10 -12
  52. package/core/client/components/input/KPalette.vue +2 -1
  53. package/core/client/components/layout/KPage.vue +5 -4
  54. package/core/client/components/layout/KWindow.vue +10 -10
  55. package/core/client/components/media/KColorScale.vue +26 -20
  56. package/core/client/components/media/KImageViewer.vue +57 -33
  57. package/core/client/components/media/KShape.vue +14 -103
  58. package/core/client/components/screen/KRegisterScreen.vue +0 -1
  59. package/core/client/components/screen/KScreenFooter.vue +0 -18
  60. package/core/client/components/team/KAddMember.vue +14 -11
  61. package/core/client/components/team/KGroupsActivity.vue +14 -0
  62. package/core/client/components/team/KMembersActivity.vue +12 -0
  63. package/core/client/components/team/KTagsActivity.vue +14 -0
  64. package/core/client/components/time/KDateTime.vue +23 -7
  65. package/core/client/components/time/KTimeControl.vue +142 -0
  66. package/core/client/components/tool/KExportTool.vue +57 -0
  67. package/core/client/composables/collection.js +0 -1
  68. package/core/client/composables/pwa.js +0 -1
  69. package/core/client/composables/schema.js +1 -1
  70. package/core/client/composables/session.js +30 -6
  71. package/core/client/exporter.js +141 -0
  72. package/core/client/i18n/core_en.json +93 -24
  73. package/core/client/i18n/core_fr.json +94 -24
  74. package/core/client/index.js +3 -0
  75. package/core/client/layout.js +34 -14
  76. package/core/client/local-storage.js +8 -6
  77. package/core/client/mixins/index.js +0 -1
  78. package/core/client/mixins/mixin.base-field.js +24 -2
  79. package/core/client/mixins/mixin.object-proxy.js +0 -1
  80. package/core/client/readers/reader.csv.js +1 -1
  81. package/core/client/search.js +2 -1
  82. package/core/client/services/index.js +2 -1
  83. package/core/client/services/local-settings.service.js +4 -4
  84. package/core/client/theme.js +3 -3
  85. package/core/client/time.js +4 -0
  86. package/core/client/units.js +149 -4
  87. package/core/client/utils/index.js +13 -6
  88. package/core/client/utils/utils.account.js +1 -1
  89. package/core/client/utils/utils.colors.js +43 -0
  90. package/core/client/utils/utils.platform.js +0 -1
  91. package/core/client/utils/utils.pwa.js +14 -14
  92. package/core/client/utils/utils.session.js +1 -1
  93. package/core/client/utils/utils.shapes.js +270 -0
  94. package/core/client/utils/utils.time.js +37 -0
  95. package/core/common/permissions.js +3 -0
  96. package/core/common/schemas/settings.update.json +50 -29
  97. package/extras/css/core.variables.scss +3 -1
  98. package/extras/tours/map/navigation-bar.js +17 -15
  99. package/extras/tours/map/timeline.js +33 -33
  100. package/map/api/config/categories.cjs +4 -1
  101. package/map/api/hooks/hooks.catalog.js +39 -0
  102. package/map/api/hooks/hooks.features.js +23 -3
  103. package/map/api/hooks/hooks.query.js +31 -10
  104. package/map/api/models/projects.model.mongodb.js +8 -0
  105. package/map/api/services/catalog/catalog.hooks.js +5 -3
  106. package/map/api/services/features/features.hooks.js +18 -6
  107. package/map/api/services/index.js +22 -6
  108. package/map/api/services/projects/projects.hooks.js +118 -0
  109. package/map/client/capture.js +16 -0
  110. package/map/client/cesium/utils/index.js +3 -0
  111. package/map/client/cesium/utils/utils.events.js +30 -0
  112. package/map/client/cesium/utils/utils.popup.js +17 -0
  113. package/map/client/cesium/{utils.js → utils/utils.style.js} +53 -49
  114. package/map/client/components/KCapture.vue +50 -0
  115. package/map/client/components/KCaptureTextArea.vue +53 -0
  116. package/map/client/components/KCompass.vue +2 -2
  117. package/map/client/components/KFeaturesChart.vue +1 -1
  118. package/map/client/components/KFeaturesFilter.vue +2 -2
  119. package/map/client/components/KLayerStyleForm.vue +256 -430
  120. package/map/client/components/KLevelSlider.vue +1 -1
  121. package/map/client/components/KNorth.vue +31 -0
  122. package/map/client/components/KProjectMenu.vue +88 -0
  123. package/map/client/components/KTimezoneMap.vue +36 -23
  124. package/map/client/components/catalog/KAddLayer.vue +3 -4
  125. package/map/client/components/catalog/KConnectLayer.vue +16 -4
  126. package/map/client/components/catalog/KCreateLayer.vue +1 -2
  127. package/map/client/components/catalog/KCreateProject.vue +100 -0
  128. package/map/client/components/catalog/KCreateView.vue +25 -2
  129. package/map/client/components/catalog/KLayersPanel.vue +24 -27
  130. package/map/client/components/catalog/KLayersSelector.vue +1 -1
  131. package/map/client/components/catalog/KProjectEditor.vue +91 -0
  132. package/map/client/components/catalog/KProjectManager.vue +60 -0
  133. package/map/client/components/catalog/KProjectSelector.vue +38 -0
  134. package/map/client/components/catalog/KProjectsPanel.vue +153 -0
  135. package/map/client/components/catalog/KSelectLayers.vue +96 -0
  136. package/map/client/components/catalog/KSelectViews.vue +96 -0
  137. package/map/client/components/catalog/KViewsPanel.vue +66 -30
  138. package/map/client/components/form/KDirectionField.vue +24 -5
  139. package/map/client/components/form/KLayerCategoryField.vue +12 -2
  140. package/map/client/components/form/KLocationField.vue +20 -5
  141. package/map/client/components/form/KOwsLayerField.vue +12 -2
  142. package/map/client/components/form/KOwsServiceField.vue +12 -2
  143. package/map/client/components/form/KSelectLayersField.vue +159 -0
  144. package/map/client/components/form/KSelectViewsField.vue +121 -0
  145. package/map/client/components/form/KTimezoneField.vue +24 -17
  146. package/map/client/components/legend/KColorScaleLegend.vue +1 -1
  147. package/map/client/components/legend/KLayerLegend.vue +61 -0
  148. package/map/client/components/legend/KLegend.vue +45 -44
  149. package/map/client/components/legend/KLegendRenderer.vue +5 -3
  150. package/map/client/components/legend/KSymbolsLegend.vue +12 -10
  151. package/map/client/components/legend/KVariablesLegend.vue +78 -0
  152. package/map/client/components/location/KGeocodersFilter.vue +2 -4
  153. package/map/client/components/location/KLocationMap.vue +48 -17
  154. package/map/client/components/location/KLocationSearch.vue +13 -3
  155. package/map/client/components/tools/KSearchTool.vue +17 -12
  156. package/map/client/components/widget/KElevationProfile.vue +16 -19
  157. package/map/client/components/widget/KMapillaryViewer.vue +21 -22
  158. package/map/client/components/widget/KTimeSeries.vue +35 -23
  159. package/map/client/composables/activity.js +15 -2
  160. package/map/client/composables/catalog.js +66 -0
  161. package/map/client/composables/highlight.js +56 -20
  162. package/map/client/composables/index.js +2 -0
  163. package/map/client/composables/location.js +25 -18
  164. package/map/client/composables/project.js +122 -0
  165. package/map/client/geolocation.js +1 -1
  166. package/map/client/globe.js +2 -0
  167. package/map/client/i18n/map_en.json +123 -76
  168. package/map/client/i18n/map_fr.json +124 -72
  169. package/map/client/index.js +3 -0
  170. package/map/client/init.js +17 -0
  171. package/map/client/leaflet/GSMaPLayer.js +16 -17
  172. package/map/client/leaflet/ShapeMarker.js +40 -0
  173. package/map/client/leaflet/TiledFeatureLayer.js +1 -1
  174. package/map/client/leaflet/TiledMeshLayer.js +11 -15
  175. package/map/client/leaflet/TiledWindLayer.js +6 -10
  176. package/map/client/leaflet/utils/index.js +4 -0
  177. package/map/client/leaflet/utils/utils.events.js +41 -0
  178. package/map/client/leaflet/utils/utils.popup.js +21 -0
  179. package/map/client/leaflet/utils/utils.style.js +191 -0
  180. package/map/client/leaflet/utils/utils.tiles.js +87 -0
  181. package/map/client/map.js +2 -0
  182. package/map/client/mixins/globe/mixin.base-globe.js +29 -21
  183. package/map/client/mixins/globe/mixin.geojson-layers.js +132 -69
  184. package/map/client/mixins/globe/mixin.popup.js +2 -1
  185. package/map/client/mixins/globe/mixin.style.js +6 -4
  186. package/map/client/mixins/globe/mixin.tooltip.js +8 -3
  187. package/map/client/mixins/map/mixin.base-map.js +13 -11
  188. package/map/client/mixins/map/mixin.edit-layers.js +15 -15
  189. package/map/client/mixins/map/mixin.forecast-layers.js +3 -1
  190. package/map/client/mixins/map/mixin.geojson-layers.js +56 -20
  191. package/map/client/mixins/map/mixin.georaster-layers.js +4 -11
  192. package/map/client/mixins/map/mixin.heatmap-layers.js +1 -1
  193. package/map/client/mixins/map/mixin.popup.js +2 -1
  194. package/map/client/mixins/map/mixin.style.js +4 -67
  195. package/map/client/mixins/map/mixin.tiled-mesh-layers.js +2 -1
  196. package/map/client/mixins/map/mixin.tiled-wind-layers.js +4 -2
  197. package/map/client/mixins/map/mixin.tooltip.js +2 -1
  198. package/map/client/mixins/mixin.activity.js +66 -191
  199. package/map/client/mixins/mixin.catalog-panel.js +6 -6
  200. package/map/client/mixins/mixin.context.js +13 -10
  201. package/map/client/mixins/mixin.feature-service.js +29 -300
  202. package/map/client/mixins/mixin.weacast.js +11 -17
  203. package/map/client/pixi-utils.js +1 -1
  204. package/map/client/planets.js +58 -0
  205. package/map/client/utils/index.js +6 -0
  206. package/map/client/utils/utils.capture.js +176 -0
  207. package/map/client/utils/utils.catalog.js +149 -0
  208. package/map/client/utils/utils.features.js +364 -0
  209. package/map/client/utils/utils.js +0 -151
  210. package/map/client/utils/utils.layers.js +174 -0
  211. package/map/client/utils/utils.location.js +91 -23
  212. package/map/client/utils/utils.project.js +8 -0
  213. package/map/client/utils/utils.schema.js +0 -1
  214. package/map/client/utils/utils.style.js +297 -0
  215. package/map/client/utils.all.js +2 -2
  216. package/map/client/utils.globe.js +1 -1
  217. package/map/client/utils.map.js +1 -1
  218. package/map/common/permissions.js +2 -0
  219. package/map/common/schemas/capture.create.json +132 -0
  220. package/map/common/schemas/projects.create.json +52 -0
  221. package/map/common/schemas/projects.update.json +52 -0
  222. package/package.json +6 -5
  223. package/test/api/core/account.test.js +20 -0
  224. package/test/api/core/config/default.cjs +16 -3
  225. package/test/api/core/import-export.test.js +86 -0
  226. package/test/api/core/test-log-2023-12-19.log +7 -0
  227. package/test/api/core/test-log-2024-01-04.log +14 -0
  228. package/test/api/map/catalog.test.js +164 -0
  229. package/test/api/map/index.test.js +25 -61
  230. package/test/api/map/test-log-2023-11-24.log +121 -0
  231. package/test/api/map/test-log-2023-12-12.log +29 -0
  232. package/test/api/map/test-log-2023-12-13.log +5 -0
  233. package/test/api/map/test-log-2024-01-04.log +2 -0
  234. package/test/api/map/test-log-2024-01-11.log +1 -0
  235. package/test/api/map/test-log-2024-01-25.log +19 -0
  236. package/test/client/core/layout.js +25 -5
  237. package/test/client/core/utils.js +7 -0
  238. package/test/client/map/catalog.js +78 -1
  239. package/test/client/map/time.js +2 -1
  240. package/core/client/components/screen/KEndpointScreen.vue +0 -80
  241. package/core/client/mixins/mixin.account.js +0 -61
  242. package/extras/icons/kdk.png +0 -0
  243. package/map/api/services/geocoder/geocoder.service.js +0 -79
  244. package/map/client/components/KCaptureToolbar.vue +0 -155
  245. package/map/client/components/KColorLegend.vue +0 -349
  246. package/map/client/components/KTimeline.vue +0 -293
  247. package/map/client/components/KUrlLegend.vue +0 -122
  248. package/map/client/leaflet/utils.js +0 -246
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "CLOSE": "Fermer",
3
3
  "SEARCH": "Rechercher",
4
+ "LAYERS_LABEL": "Mes données",
5
+ "VIEWS_LABEL": "Mes vues",
6
+ "PROJECTS_LABEL": "Mes projets",
7
+ "CATALOG_LABEL": "Catalogue",
8
+ "PROJECT_LAYERS_LABEL": "Données",
9
+ "PROJECT_VIEWS_LABEL": "Vues",
4
10
  "errors": {
5
11
  "GEOLOCATION_NOT_SUPPORTED": "La géolocalisation ne semble pas disponible sur votre appareil ou navigateur.",
6
12
  "GEOLOCATION_ERROR": "Il nous est impossible de déterminer votre position, cela peut affecter certaines fonctionnalités de l'application.",
@@ -17,6 +23,20 @@
17
23
  "INVALID_GPX_FILE": "{file} n'est pas un fichier GPX valide",
18
24
  "INVALID_KML_FILE": "{file} n'est pas un fichier KML valide"
19
25
  },
26
+ "utils": {
27
+ "layers": {
28
+ "INVALID_FEATURES_DIALOG_TITLE": "Elements invalides",
29
+ "INVALID_FEATURES_DIALOG_MESSAGE": "Votre couche comporte {total} éléments dont la géométrie est invalide (e.g. auto-intersection). En conséquence ces éléments seront supprimés avant la sauvegarde.",
30
+ "DOWNLOAD_INVALID_FEATURES_LABEL": "En sélectionnant cette option vos éléments invalides seront exportés dans un fichier avant l'enregistrement",
31
+ "INVALID_FEATURES_FILE": "ElementsInvalides.geojson",
32
+ "SAVING_LABEL": "Veuillez patienter pendant l'enregistrement des données,</br>{processed} éléments traités sur {total}",
33
+ "SAVE_DIALOG_TITLE": "Tuilage de la couche {layer}",
34
+ "SAVE_DIALOG_MESSAGE": "Votre couche comportant de trop nombreux éléments a été optimisée pour un affichage fluide.</br>En conséquence elle ne sera visible qu'à une échelle locale à partir d'un certain niveau de zoom.",
35
+ "REMOVING_LABEL": "Veuillez patienter pendant la suppression des données",
36
+ "REMOVE_DIALOG_TITLE": "Supprimer {layer} ?",
37
+ "REMOVE_DIALOG_MESSAGE": "Etes vous sûr de vouloir supprimer {layer} de votre espace de travail ?"
38
+ }
39
+ },
20
40
  "mixins": {
21
41
  "fileLayers": {
22
42
  "IMPORTED_DATA_NAME": "Mes données"
@@ -25,15 +45,7 @@
25
45
  "CONVERT_UNITS": "Cliquer pour changer d'unité"
26
46
  },
27
47
  "activity": {
28
- "ADD_LAYER": "Ajouter une nouvelle couche",
29
- "SAVE_LABEL": "Sauvegarder la couche",
30
- "SAVING_LABEL": "Veuillez patienter pendant l'enregistrement des données,</br>{processed} éléments traités sur {total}",
31
- "INVALID_FEATURES_DIALOG_TITLE": "Elements invalides",
32
- "INVALID_FEATURES_DIALOG_MESSAGE": "Votre couche comporte {features.length} éléments dont la géométrie est invalide (e.g. auto-intersection). En conséquence ces éléments seront supprimés avant la sauvegarde.",
33
- "DOWNLOAD_INVALID_FEATURES_LABEL": "En sélectionnant cette option vos éléments invalides seront exportés dans un fichier avant l'enregistrement",
34
- "INVALID_FEATURES_FILE": "ElementsInvalides.geojson",
35
- "SAVE_DIALOG_TITLE": "Tuilage de la couche {layer}",
36
- "SAVE_DIALOG_MESSAGE": "Votre couche comportant de trop nombreux éléments a été optimisée pour un affichage fluide.</br>En conséquence elle ne sera visible qu'à une échelle locale à partir d'un certain niveau de zoom.",
48
+ "ADD_LAYER": "Ajouter une couche",
37
49
  "EDIT_LABEL": "Editer les propriétés",
38
50
  "EDIT_LAYER_STYLE_LABEL": "Editer le style",
39
51
  "FILTER_DATA_LABEL": "Filtrer les données",
@@ -42,10 +54,6 @@
42
54
  "START_EDIT_DATA_LABEL": "Editer les données",
43
55
  "STOP_EDIT_DATA_LABEL": "Clôturer l'édition des données",
44
56
  "EDITING_DATA_MESSAGE": "Edition en cours",
45
- "REMOVE_LABEL": "Supprimer",
46
- "REMOVING_LABEL": "Veuillez patienter pendant la suppression des données",
47
- "REMOVE_DIALOG_TITLE": "Supprimer {layer} ?",
48
- "REMOVE_DIALOG_MESSAGE": "Etes vous sûr de vouloir supprimer {layer} de votre espace de travail ?",
49
57
  "ZOOM_TO_LABEL": "Zoomer sur",
50
58
  "ZOOM_IN": "Zoomer",
51
59
  "ZOOM_OUT": "Dézoomer",
@@ -64,12 +72,17 @@
64
72
  "DISPLAY_LEGEND": "Afficher la légende",
65
73
  "HIDE_LEGEND": "Masquer la légende",
66
74
  "SEARCH_LOCATION": "Rechercher un lieu",
75
+ "ADD_VIEW": "Ajouter une vue",
67
76
  "CREATE_VIEW": "Créer une vue",
77
+ "CREATE_PROJECT": "Créer un projet",
78
+ "MANAGE_PROJECT": "Gérer le projet",
68
79
  "SYNCHRONIZE_TIMELINE_LABEL": "Synchroniser temporellement",
69
80
  "TOOLS": "Outils",
70
81
  "SAVE_LAYER_EDITION_CHANGES": "Sauver les changements apportés",
71
82
  "DISCARD_LAYER_EDITION_CHANGES": "Rejeter les changements apportés",
72
- "CAPTURE_VIEW": "Capturer la vue"
83
+ "CAPTURE_VIEW": "Capturer la vue",
84
+ "SAVE_LABEL": "Sauvegarder la couche",
85
+ "REMOVE_LABEL": "Supprimer"
73
86
  },
74
87
  "timeseries": {
75
88
  "FORECAST_PROBE": "Prévisions"
@@ -190,10 +203,6 @@
190
203
  "POPUP": "Vous êtes à moins de {distance} {unit} de ce point",
191
204
  "OUTSIDE_MAP_BOUNDS": "Vous semblez localisé en dehors de la carte"
192
205
  },
193
- "geocoders": {
194
- "BAN": "BAN",
195
- "NOMINATIN": "Nominatin"
196
- },
197
206
  "schemas": {
198
207
  "CATALOG_CREATE_TITLE": "Créer une nouvelles couche de données",
199
208
  "CATALOG_NAME_FIELD_LABEL": "Saisissez le nom de la nouvelle couche",
@@ -205,16 +214,38 @@
205
214
  "LAYER_CATEGORY_ICON_FIELD_LABEL": "Choisissez une icône pour la catégorie",
206
215
  "LAYER_CATEGORY_LAYERS_FIELD_LABEL": "Sélectionnez les couches dans cette catégorie",
207
216
  "LAYER_CATEGORY_EXCLUSIVE_FIELD_LABEL": "Rendre la sélection exclusive au sein de la catégorie",
217
+ "PROJECT_CREATE_TITLE": "Créer un nouveau projet ?",
218
+ "PROJECT_NAME_FIELD_LABEL": "Saisissez le nom du projet",
219
+ "PROJECT_DESCRIPTION_FIELD_LABEL": "Saisissez la description du projet",
220
+ "PROJECT_LAYERS_FIELD_LABEL": "Sélectionnez les couches dans ce projet",
221
+ "PROJECT_VIEWS_FIELD_LABEL": "Sélectionnez les vues dans ce projet",
222
+ "PROJECT_INDENTIFIER_FIELD_LABEL": "Saisissez l'identifiant du projet pour les applications tierces",
208
223
  "MAP_SETTINGS": "Paramètres cartographiques",
209
224
  "RESTORE_VIEW_FIELD_LABEL": "Sauvegarder l'emprise courante",
210
225
  "RESTORE_LAYERS_FIELD_LABEL": "Sauvegarder les couches actives",
211
226
  "LOCATION_FORMAT_LABEL": "Format de coordonnées",
212
- "LOCATION_FORMAT_HELPER": "<a target='_blank' href='https://github.com/nerik/formatcoords#formatting'>&#x1F6C8;</a>",
213
227
  "TIMELINE_SETTINGS": "Paramètrage du sélecteur temporel",
214
228
  "TIMELINE_STEP": "Pas du sélécteur temporel, en minutes",
215
229
  "TIMELINE_INTERVAL": "Fréquence de rafraichissement des données en temps-réel",
216
230
  "TIMESERIES_SETTINGS": "Paramètrage des séries temporelles",
217
- "TIMESERIES_SPAN": "Intervalle des séries temporelles, en heures"
231
+ "TIMESERIES_SPAN": "Intervalle des séries temporelles, en heures",
232
+ "CAPTURE_RESOLUTION_FIELD_LABEL": "Paramétrez la résolution",
233
+ "CAPTURE_HEADER_FIELD_LABEL": "Paramétrez le titre",
234
+ "CAPTURE_FOOTER_FIELD_LABEL": "Paramétrez le pied de page",
235
+ "CAPTURE_NOT_DISPLAYED_FIELD_LABEL": "Ne pas afficher",
236
+ "CAPTURE_LEGEND_POSITION_FIELD_LABEL": "Paramétrez la position de la légende",
237
+ "CAPTURE_LEFT_POSITION_FIELD_LABEL": " Afficher à gauche",
238
+ "CAPTURE_RIGHT_POSITION_FIELD_LABEL": " Afficher à droite",
239
+ "CAPTURE_COMPASS_POSITION_FIELD_LABEL": "Paramétrez la position de la boussole",
240
+ "CAPTURE_TOP_LEFT_POSITION_FIELD_LABEL": "Afficher en haut à gauche",
241
+ "CAPTURE_TOP_RIGHT_POSITION_FIELD_LABEL": "Afficher en haut à droite",
242
+ "CAPTURE_BOTTOM_RIGHT_POSITION_FIELD_LABEL": "Afficher en bas à droite",
243
+ "CAPTURE_BOTTOM_LEFT_POSITION_FIELD_LABEL": "Afficher en bas à gauche",
244
+ "CAPTURE_ADVANCED_SETTINGS": "Paramètres avancés",
245
+ "CAPTURE_DATETIME_RANGE_FIELD_LABEL": "Paramétrez l'intervalle de temps",
246
+ "CAPTURE_FORMAT_FIELD_LABEL": "Sélectionnez le format de fichier",
247
+ "CAPTURE_PDF_FORMAT_FIELD_LABEL": "PDF",
248
+ "CAPTURE_PNG_FORMAT_FIELD_LABEL": "PNG"
218
249
  },
219
250
  "tours": {
220
251
  "navigation-bar": {
@@ -281,17 +312,16 @@
281
312
  "timeline": {
282
313
  "TIMELINE_LABEL": "La ligne de temps permet d'accéder aux actions relative à la temporalité des données affichées.",
283
314
  "DATE_LABEL": "Sélectionnez n'importe quelle date via ce bouton.",
284
- "NOW_LABEL": "Suivez le temps courant via ce bouton.",
285
- "NEXT_STEP_LABEL": "Avancez dans le temps tel que configuré dans vos paramètres.",
286
- "PREVIOUS_STEP_LABEL": "Reculez dans le temps tel que configuré dans vos paramètres.",
287
- "SETTINGS_LINK_LABEL": "Mettre à jour vos paramètres dans le menu principal",
288
- "PICK_MINUTES_LABEL": "Modifiez les minutes du temps courant.",
315
+ "PICK_DAY_LABEL": "Choisissez directement un jour.",
316
+ "PICK_TIMES_LABEL": "Ou choisissez directement l'horaire.",
317
+ "NOW_LABEL": "Activez le temps courant via ce bouton.",
318
+ "STEP_LABEL": "Mettre à jour le pas via ce bouton.",
319
+ "NEXT_STEP_LABEL": "Avancez dans le temps selon le pas configuré.",
320
+ "PREVIOUS_STEP_LABEL": "Reculez dans le temps selon le pas configuré.",
289
321
  "NEXT_HOUR_LABEL": "Avancez dans le temps d'une heure.",
290
322
  "PREVIOUS_HOUR_LABEL": "Reculez dans le temps d'une heure.",
291
- "PICK_HOUR_LABEL": "Ou choisissez directement l'horaire.",
292
323
  "NEXT_DAY_LABEL": "Avancez dans le temps d'un jour.",
293
- "PREVIOUS_DAY_LABEL": "Reculez dans le temps d'un jour.",
294
- "PICK_DAY_LABEL": "Ou choisissez directement un jour."
324
+ "PREVIOUS_DAY_LABEL": "Reculez dans le temps d'un jour."
295
325
  },
296
326
  "fab": {
297
327
  "PROBE_LABEL": "Sonder les prévision météorologiques à la position de votre choix.",
@@ -348,16 +378,19 @@
348
378
  "UNSUPPORTED_LAYER_CRS": "La projection utilisée par cette couche n'est pas supportée.",
349
379
  "UNSUPPORTED_LAYER_FORMAT": "Le format de données utilisé par cette couche n'est pas supporté."
350
380
  },
381
+ "KSelectViewsField": {
382
+ "EMPTY": "Aucune disponible"
383
+ },
351
384
  "KLocationSearch": {
352
385
  "SEARCH": "@:SEARCH",
353
- "NO_RESULTS": "@:EMPTY",
386
+ "NO_RESULT": "Aucun résultat trouvé",
354
387
  "FILTER": "Filtrer les services de recherche",
355
388
  "GEOLOCATE": "Me localiser",
356
389
  "EDIT": "Editer sur une carte"
357
390
  },
358
391
  "KLocationField": {
359
392
  "SEARCH": "@:SEARCH",
360
- "NO_RESULTS": "@:EMPTY",
393
+ "NO_RESULT": "Aucun résultat trouvé",
361
394
  "FILTER": "Filtrer les services de recherche",
362
395
  "GEOLOCATE": "Me localiser",
363
396
  "DRAW": "Dessiner sur une carte"
@@ -404,7 +437,19 @@
404
437
  "KViewsPanel": {
405
438
  "SORT_VIEWS": "Trier les vues",
406
439
  "REMOVE_VIEW": "@:REMOVE",
407
- "SET_HOME_VIEW": "Définir comme vue par défaut"
440
+ "SET_HOME_VIEW": "Définir comme vue par défaut",
441
+ "REMOVE_DIALOG_TITLE": "Supprimer {view} ?",
442
+ "REMOVE_DIALOG_MESSAGE": "Etes vous sûr de vouloir supprimer {view} de votre espace de travail ?"
443
+ },
444
+ "KProjectsPanel": {
445
+ "SORT_PROJECTS": "Trier les projets",
446
+ "EDIT_PROJECT": "@:EDIT",
447
+ "REMOVE_PROJECT": "@:REMOVE",
448
+ "REMOVE_DIALOG_TITLE": "Supprimer {project} ?",
449
+ "REMOVE_DIALOG_MESSAGE": "Etes vous sûr de vouloir supprimer {project} de votre espace de travail ?"
450
+ },
451
+ "KProjectEditor": {
452
+ "BACKGROUND_LAYER_REQUIRED": "Un projet doit au moins contenir un fond cartographique."
408
453
  },
409
454
  "KFeaturesFilter": {
410
455
  "TITLE": "Filtre des données de la couche",
@@ -454,21 +499,33 @@
454
499
  "POINTS": "Icônes",
455
500
  "LINES": "Lignes",
456
501
  "POLYGONS": "Polygones",
457
- "DEFAULT_POINT_STYLE": "Icône par défaut",
458
- "POINT_CLUSTERING": "Regrouper les icônes jusqu'au niveau",
459
- "ADD_POINT_STYLE": "Sélectionnez une propriété à associer à une icône",
460
- "REMOVE_POINT_STYLE": "Supprimer l'icône associée à cette valeur",
502
+ "DEFAULT_ICON_STYLE": "Icône par défaut",
503
+ "DEFAULT_POINT_STYLE": "Style de point par défaut",
504
+ "PROPERTY_ICON_STYLE": "Icône",
505
+ "PROPERTY_POINT_STYLE": "Point",
506
+ "ICON_SIZE": " taille",
507
+ "POINT_SIZE": " taille",
508
+ "POINT_SHAPE": " forme",
509
+ "WHEN_PROPERTY_IS_POINT_STYLE": "lorsque {property}",
510
+ "POINT_CLUSTERING": "Regrouper jusqu'au niveau",
511
+ "ADD_POINT_STYLE": "Ajouter un style pour une valeur de",
512
+ "REMOVE_POINT_STYLE": "Supprimer le style associé à cette valeur",
461
513
  "DEFAULT_LINE_STYLE": "Style de ligne par défaut",
462
- "LINE_WIDTH": "Largeur ",
463
- "LINE_OPACITY": "Opacité ",
464
- "ADD_LINE_STYLE": "Sélectionnez une propriété à associer à un style",
514
+ "PROPERTY_LINE_STYLE": "Style de ligne",
515
+ "WHEN_PROPERTY_IS_LINE_STYLE": "lorsque {property}",
516
+ "LINE_WIDTH": "largeur ",
517
+ "LINE_OPACITY": "opacité ",
518
+ "ADD_LINE_STYLE": "Ajouter un style pour une valeur de",
465
519
  "REMOVE_LINE_STYLE": "Supprimer le style associée à cette valeur",
466
520
  "DEFAULT_POLYGON_LINE_STYLE": "Style de contour par défaut",
467
521
  "DEFAULT_POLYGON_FILL_STYLE": "Style de remplissage par défaut",
468
- "POLYGON_LINE_WIDTH": "Largeur ",
469
- "POLYGON_LINE_OPACITY": "Opacité ",
470
- "POLYGON_FILL_OPACITY": "Opacité ",
471
- "ADD_POLYGON_STYLE": "Sélectionnez une propriété à associer à un style",
522
+ "PROPERTY_POLYGON_LINE_STYLE": "Contour",
523
+ "PROPERTY_POLYGON_FILL_STYLE": "Remplisssage",
524
+ "WHEN_PROPERTY_IS_POLYGON_STYLE": "lorsque {property}",
525
+ "POLYGON_LINE_WIDTH": "largeur ",
526
+ "POLYGON_LINE_OPACITY": "opacité ",
527
+ "POLYGON_FILL_OPACITY": "opacité ",
528
+ "ADD_POLYGON_STYLE": "Ajouter un style pour une valeur de",
472
529
  "REMOVE_POLYGON_STYLE": "Supprimer le style associée à cette valeur",
473
530
  "POPUP": "Bulle contextuelle",
474
531
  "ADD_POPUP": "Sélectionnez des propriétés à afficher dans la bulle",
@@ -478,10 +535,10 @@
478
535
  "ADD_INFOBOX": "Sélectionnez des propriétés à afficher dans la boîte",
479
536
  "IN": "parmis",
480
537
  "NOT_IN": "différent(e) de",
481
- "EQUAL": "égal(e) à",
482
- "NOT_EQUAL": "différent(e) de",
483
- "GREATER_THAN": "supérieur(e) à",
484
- "LOWER_THAN": "inférieur(e) à"
538
+ "EQUAL": "est",
539
+ "NOT_EQUAL": "n'est pas",
540
+ "GREATER_THAN": ">",
541
+ "LOWER_THAN": "<"
485
542
  },
486
543
  "KLayerStyleEditor": {
487
544
  "EDIT_LAYER_STYLE_TITLE": "Editer le style de la couche"
@@ -495,16 +552,6 @@
495
552
  "ARCHIVES_LABEL": "Archives",
496
553
  "NO_MODEL_AVAILABLE": "Aucun modèle disponible"
497
554
  },
498
- "KTimeline": {
499
- "PREVIOUS_DAY": "Jour précédent",
500
- "NEXT_DAY": "Jour suivant ",
501
- "PREVIOUS_HOUR": "Heure précédente",
502
- "NEXT_HOUR": "Heure suivante",
503
- "PREVIOUS_STEP": "Pas précédent",
504
- "NEXT_STEP": "Pas suivant",
505
- "SET_NOW": "Temps réel",
506
- "SET_DATE": "Aller à une date"
507
- },
508
555
  "KInformationBox": {
509
556
  "LABEL": "Boîte d'information",
510
557
  "NO_FEATURE_PROPERTIES": "Aucune information disponible",
@@ -538,11 +585,16 @@
538
585
  },
539
586
  "KAddLayer": {
540
587
  "TITLE": "Ajouter une nouvelle couche",
588
+ "PROJECT_TITLE": "Sélectionner les couches",
541
589
  "NAME_FIELD_LABEL": "Saisissez le nom de la nouvelle couche",
542
590
  "DESCRIPTION_FIELD_LABEL": "Saisissez une description de la nouvelle couche",
543
591
  "CATEGORY_FIELD_LABEL": "Sélectionnez ou saisissez une catégorie",
544
592
  "FEATURE_ID_FIELD_LABEL": "Saisissez un identifiant unique"
545
593
  },
594
+ "KSelectLayers": {
595
+ "LAYERS_FIELD_LABEL": "Choisissez les couches du projet",
596
+ "SELECT_BUTTON": "Sélectionner"
597
+ },
546
598
  "KImportLayer": {
547
599
  "FILE_FIELD_LABEL": "Sélectionnez le fichier à importer",
548
600
  "NAME_FIELD_LABEL": "@:KAddLayer.NAME_FIELD_LABEL",
@@ -569,12 +621,25 @@
569
621
  "CATEGORY_FIELD_LABEL": "@:KAddLayer.CATEGORY_FIELD_LABEL",
570
622
  "CREATE_BUTTON": "Créer"
571
623
  },
624
+ "KAddView": {
625
+ "TITLE": "Ajouter une vue",
626
+ "PROJECT_TITLE": "Sélectionner les vues"
627
+ },
628
+ "KSelectViews": {
629
+ "VIEWS_FIELD_LABEL": "Choisissez les vues du projets",
630
+ "SELECT_BUTTON": "Sélectionner"
631
+ },
572
632
  "KCreateView": {
573
633
  "MODAL_TITLE": "Créer une nouvelle vue ?",
574
634
  "NAME_FIELD_LABEL": "Saisissez le nom de la vue",
575
635
  "DESCRIPTION_FIELD_LABEL": "Saisissez la description de la vue",
576
636
  "LAYERS_FIELD_LABEL": "Sauvegarder les couches actives"
577
637
  },
638
+ "KCreateProject": {
639
+ "MODAL_TITLE": "Créer un nouveau projet ?",
640
+ "NAME_FIELD_LABEL": "Saisissez le nom du projet",
641
+ "DESCRIPTION_FIELD_LABEL": "Saisissez la description du projet"
642
+ },
578
643
  "KLayerEditionToolbar": {
579
644
  "ADD_POLYGON_FEATURES": "Ajouter des entités polygonales",
580
645
  "ADD_RECTANGLE_FEATURES": "Ajouter des entités rectangulaires",
@@ -586,23 +651,10 @@
586
651
  "ROTATE_FEATURES": "Tourner des entités",
587
652
  "REMOVE_FEATURES": "Effacer des entités"
588
653
  },
589
- "KCaptureToolbar": {
590
- "SD_LABEL": "Définition Standard",
591
- "SD_DESCRIPTION": "4:3, 640 x 480",
592
- "HD_LABEL": "Haute Définition",
593
- "HD_DESCRIPTION": "16:9, 1280 x 720",
594
- "FHD_LABEL": "Full HD",
595
- "FHD_DESCRIPTION": "16:9, 1920 x 1080",
596
- "QHD_LABEL": "Quad HD",
597
- "QHD_DESCRIPTION": "16:9, 2560 x 1440",
598
- "2K_LABEL": "2K",
599
- "2K_DESCRIPTION": "1:1.77, 2048 x 1080",
600
- "4K_LABEL": "4K ou Ultra HD",
601
- "4K_DESCRIPTION": "1:1.9, 3840 x 2160",
602
- "8K_LABEL": "8K ou Full Ultra HD",
603
- "8K_DESCRIPTION": "16∶9, 7680 x 4320",
654
+ "KCapture": {
604
655
  "CAPTURE_ACTION": "Capturer la vue",
605
- "CAPTURING_VIEW": "En attente de capture de la vue"
656
+ "CAPTURING_VIEW": "En attente de capture de la vue",
657
+ "ERROR_MESSAGE": "Une capture est déjà en cours"
606
658
  },
607
659
  "KMeasureTool": {
608
660
  "TOOL_BUTTON_LABEL": "Afficher l'outil de mesures",
@@ -8,11 +8,14 @@ import init from './init.js'
8
8
  const mixins = Object.assign({}, commonMixins, { map: mapMixins, globe: globeMixins })
9
9
 
10
10
  export * from './geolocation.js'
11
+ export * from './capture.js'
12
+ export * from './planets.js'
11
13
  export * from './canvas-draw-context.js'
12
14
  export { utils }
13
15
  export { elevationUtils }
14
16
  export { composables }
15
17
  export { mixins }
16
18
  export * from '../common/index.js'
19
+ export * from './init.js'
17
20
 
18
21
  export default init
@@ -5,6 +5,7 @@ import logger from 'loglevel'
5
5
  import { memory } from '@feathersjs/memory'
6
6
  import { Store, Reader, utils as kCoreUtils } from '../../core/client/index.js'
7
7
  import { Geolocation } from './geolocation.js'
8
+ import { Planets } from './planets.js'
8
9
  import * as readers from './readers/index.js'
9
10
 
10
11
  function siftMatcher (originalQuery) {
@@ -14,6 +15,21 @@ function siftMatcher (originalQuery) {
14
15
  return _.omit(originalQuery, ...keysToOmit)
15
16
  }
16
17
 
18
+ // Decorate core API with some of the required features for map
19
+ export function setupApi (configuration) {
20
+ const api = this
21
+ // We need to implement time management as our api is sometimes used
22
+ // by layers expecting a Weacast interface
23
+ api.setForecastTime = (time) => {
24
+ api.forecastTime = time
25
+ api.emit('forecast-time-changed', time)
26
+ }
27
+ api.getForecastTime = () => {
28
+ return api.forecastTime
29
+ }
30
+ return api
31
+ }
32
+
17
33
  export default async function init () {
18
34
  const api = this
19
35
 
@@ -35,6 +51,7 @@ export default async function init () {
35
51
 
36
52
  // Initialize singletons that might be used globally first
37
53
  Geolocation.initialize()
54
+ Planets.initialize()
38
55
 
39
56
  // Then, create the models listened by the different components
40
57
  // You must use the patch method on the store to update those models
@@ -1,7 +1,7 @@
1
1
  import _ from 'lodash'
2
2
  import L from 'leaflet'
3
3
  import moment from 'moment'
4
- import { buildColorMap } from '../utils.js'
4
+ import { utils as kdkCoreUtils } from '../../../core.client.js'
5
5
 
6
6
  const GSMaPLayer = L.TileLayer.extend({
7
7
  initialize (options) {
@@ -14,36 +14,35 @@ const GSMaPLayer = L.TileLayer.extend({
14
14
  L.TileLayer.prototype.initialize.call(this, url, updatedOptions)
15
15
 
16
16
  // colormap legend support
17
- this.colorMap = buildColorMap(_.get(options, 'chromajs'))
18
- if (this.colorMap) {
19
- this.on('tileload', (event) => {
20
- if (!this.hasData) {
21
- this.fire('data')
22
- this.hasData = true
23
- }
24
- })
17
+ const colorMapOptions = options.chromajs
18
+ if (colorMapOptions) {
19
+ this.colorMap = kdkCoreUtils.buildColorScale(colorMapOptions)
20
+ if (this.colorMap) {
21
+ this.on('tileload', (event) => {
22
+ if (!this.hasData) {
23
+ this.fire('data')
24
+ this.hasData = true
25
+ }
26
+ })
27
+ }
25
28
  }
26
29
  },
27
30
 
28
31
  makeUrl (time) {
29
32
  const t = time || moment()
30
-
31
33
  // data interval is every half hour for GSMaP_NOW
32
34
  const halfHour = moment.duration(30, 'minutes')
33
35
  const stepTime = moment(Math.trunc(t / halfHour) * halfHour).utc()
34
-
35
- const baseUrl = 'https://sharaku.eorc.jaxa.jp/cgi-bin/trmm/GSMaP_NOW/tilemap/tile_'
36
+ const baseUrl = 'https://sharaku.eorc.jaxa.jp/cgi-bin/trmm/GSMaP_NOW/tilemap/'
36
37
  const timeQuery = `year=${stepTime.year()}&month=${stepTime.month() + 1}&day=${stepTime.date()}&hour=${stepTime.hour()}&min=${stepTime.minute()}&z={z}&x={x}&y={y}`
37
-
38
38
  if (this.product === 'rain12' || this.product === 'rain24' || this.product === 'rain72') {
39
- return baseUrl + `total.py?prod=${this.product}&` + timeQuery
39
+ return baseUrl + `tile_total.py?prod=${this.product}&` + timeQuery
40
40
  }
41
41
  if (this.product === 'ir') {
42
- return baseUrl + `ir.py?prod=${this.product}&` + timeQuery
42
+ return baseUrl + `gsmapnow_tile_ir.py?prod=${this.product}&` + timeQuery
43
43
  }
44
-
45
44
  // default product is rain
46
- return baseUrl + 'rain.py?prod=rain&' + timeQuery
45
+ return baseUrl + 'tile_rain.py?prod=rain&' + timeQuery
47
46
  },
48
47
 
49
48
  setCurrentTime (time) {
@@ -0,0 +1,40 @@
1
+ import _ from 'lodash'
2
+ import logger from 'loglevel'
3
+ import L from 'leaflet'
4
+ import { utils as coreUtils } from '../../../core/client/index.js'
5
+
6
+ export const ShapeMarker = L.Marker.extend({
7
+
8
+ // Constructor
9
+ initialize (latlng, options) {
10
+ const shape = coreUtils.createShape(options)
11
+ if (shape) {
12
+ L.Marker.prototype.initialize.call(this, latlng, {
13
+ icon: L.divIcon({
14
+ iconSize: [shape.width, shape.height],
15
+ iconAnchor: this.getAnchor(shape.anchor, shape.size),
16
+ popupAnchor: [0, -shape.height / 2],
17
+ html: shape.html,
18
+ className: ''
19
+ }),
20
+ // forward extra options for different purposes, i.e. clustering
21
+ ..._.get(options, 'options', {})
22
+ })
23
+ } else {
24
+ logger.warn(`[KDK] unable to create the shape with the options: ${options}` )
25
+ }
26
+ },
27
+
28
+ getAnchor (position, size) {
29
+ if (position === 'top-left') return [0, 0]
30
+ if (position === 'top-center') return [size.width / 2, 0]
31
+ if (position === 'top-right') return [size.width, 0]
32
+ if (position === 'middle-left') return [0, size.height / 2]
33
+ if (position === 'middle-right') return [size.width, size.height / 2]
34
+ if (position === 'middle-left') return [0, size.height / 2]
35
+ if (position === 'bottom-left') return [0, size.height]
36
+ if (position === 'bottom-center') return [size.width / 2, size.height]
37
+ if (position === 'bottom-right') return [size.width, size.height]
38
+ return [size.width / 2, size.height / 2]
39
+ }
40
+ })
@@ -4,7 +4,7 @@ import logger from 'loglevel'
4
4
  import bbox from '@turf/bbox'
5
5
  import { featureEach } from '@turf/meta'
6
6
  import { featureCollection } from '@turf/helpers'
7
- import { tile2key, getParentTileInTileSet } from './utils.js'
7
+ import { tile2key, getParentTileInTileSet } from './utils/utils.tiles.js'
8
8
  import { getFeatureId } from '../utils.js'
9
9
 
10
10
  const TiledFeatureLayer = L.GridLayer.extend({
@@ -1,10 +1,11 @@
1
1
  import _ from 'lodash'
2
+ import logger from 'loglevel'
2
3
  import L from 'leaflet'
3
4
  import chroma from 'chroma-js'
4
5
  import * as PIXI from 'pixi.js'
5
6
  import 'leaflet-pixi-overlay'
6
7
  import 'abort-controller/polyfill.js'
7
-
8
+ import { utils as kdkCoreUtils } from '../../../core.client.js'
8
9
  import { buildColorMapShaderCodeFromClasses, buildColorMapShaderCodeFromDomain, buildShaderCode, WEBGL_FUNCTIONS } from '../pixi-utils.js'
9
10
 
10
11
  const TiledMeshLayer = L.GridLayer.extend({
@@ -177,7 +178,7 @@ const TiledMeshLayer = L.GridLayer.extend({
177
178
  done(null, tile)
178
179
  })
179
180
  .catch(err => {
180
- console.log(err)
181
+ logger.error(err)
181
182
  done(err, tile)
182
183
  })
183
184
 
@@ -286,29 +287,24 @@ const TiledMeshLayer = L.GridLayer.extend({
286
287
  this.colorMap = null
287
288
  this.colorMapShaderCode = null
288
289
 
289
- let domain = null
290
- const classes = _.get(this.conf, 'chromajs.classes', null)
290
+ const chromajs = _.get(this.conf, 'chromajs')
291
+ const classes = chromajs.classes
292
+ let domain
291
293
  if (!classes) {
292
- domain = _.get(this.conf, 'chromajs.domain', null)
294
+ domain = chromajs.domain
293
295
  if (!domain) {
294
296
  domain = this.gridSource.getDataBounds()
295
297
  }
296
298
  }
297
-
298
- const invert = _.get(this.conf, 'chromajs.invertScale', false)
299
- const colors = _.get(this.conf, 'chromajs.scale', null)
300
- const scale = chroma.scale(colors)
299
+ const scale = chroma.scale(chromajs.colors)
301
300
  // translate to glsl style colors for shader code
302
301
  const glcolors = scale.colors().map(c => chroma(c).gl())
303
302
 
303
+ this.colorMap = kdkCoreUtils.buildColorScale(chromajs)
304
304
  if (domain) {
305
- this.colorMap = chroma.scale(colors).domain(invert ? domain.slice().reverse() : domain)
306
- this.colorMapShaderCode = buildColorMapShaderCodeFromDomain(domain, glcolors, invert)
305
+ this.colorMapShaderCode = buildColorMapShaderCodeFromDomain(domain, glcolors)
307
306
  } else if (classes) {
308
- this.colorMap = chroma.scale(colors).classes(invert ? classes.slice().reverse() : classes)
309
- this.colorMapShaderCode = buildColorMapShaderCodeFromClasses(classes, glcolors, invert)
310
- } else {
311
- console.error("Couldn't find any domain or classes to build color map!")
307
+ this.colorMapShaderCode = buildColorMapShaderCodeFromClasses(classes, glcolors)
312
308
  }
313
309
  },
314
310
 
@@ -1,8 +1,8 @@
1
1
  import _ from 'lodash'
2
2
  import L from 'leaflet'
3
- import chroma from 'chroma-js'
3
+ import { utils as kdkCoreUtils } from '../../../core.client.js'
4
4
 
5
- import { tile2key, tileSetContainsParent } from './utils.js'
5
+ import { tile2key, tileSetContainsParent } from './utils/utils.tiles.js'
6
6
 
7
7
  const TiledWindLayer = L.GridLayer.extend({
8
8
  initialize (options, uSource, vSource) {
@@ -21,13 +21,9 @@ const TiledWindLayer = L.GridLayer.extend({
21
21
  // set of loaded leaflet tiles
22
22
  this.loadedTiles = new Set()
23
23
 
24
- // build colormap
25
- const domain = _.get(options, 'chromajs.domain', null)
26
- const colors = _.get(options, 'chromajs.scale', null)
27
- const invert = _.get(options, 'chromajs.invertScale', false)
28
- const scale = chroma.scale(colors)
29
- this.colorMap = scale.domain(invert ? domain.slice().reverse() : domain)
30
-
24
+ // Setup the colormap
25
+ const chromajs = _.get(options, 'chromajs')
26
+ this.colorMap = kdkCoreUtils.buildColorScale(chromajs)
31
27
  this.uSource = uSource
32
28
  this.vSource = vSource
33
29
  this.onDataChangedCallback = this.onDataChanged.bind(this)
@@ -41,7 +37,7 @@ const TiledWindLayer = L.GridLayer.extend({
41
37
  minVelocity: this.colorMap.domain()[0],
42
38
  maxVelocity: this.colorMap.domain()[1],
43
39
  velocityScale: 0.01,
44
- colorScale: (invert ? this.colorMap.colors().reverse() : this.colorMap.colors()),
40
+ colorScale: this.colorMap.colors(),
45
41
  data: null
46
42
  }, options)
47
43
  this.velocityLayer = L.velocityLayer(velocityOptions)
@@ -0,0 +1,4 @@
1
+ export * from './utils.events.js'
2
+ export * from './utils.popup.js'
3
+ export * from './utils.style.js'
4
+ export * from './utils.tiles.js'