@kalisio/kdk 2.5.3 → 2.6.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.
- package/.github/workflows/main.yaml +35 -6
- package/client.globe.js +8 -0
- package/client.js +8 -0
- package/client.map.js +8 -0
- package/core/api/hooks/hooks.push.js +3 -2
- package/core/api/hooks/hooks.tags.js +56 -0
- package/core/api/models/tags.model.mongodb.js +8 -0
- package/core/api/services/index.js +33 -2
- package/core/api/services/tags/tags.hooks.js +47 -0
- package/core/client/api.js +5 -5
- package/core/client/components/KActivity.vue +3 -2
- package/core/client/components/KChip.vue +2 -2
- package/core/client/components/KEditor.vue +3 -1
- package/core/client/components/KFollower.vue +4 -4
- package/core/client/components/KStore.vue +1 -1
- package/core/client/components/KTab.vue +20 -7
- package/core/client/components/account/KProfile.vue +9 -25
- package/core/client/components/action/KAction.vue +10 -10
- package/core/client/components/action/KToggleFullscreenAction.vue +2 -11
- package/core/client/components/app/KHome.vue +3 -2
- package/core/client/components/collection/KFilter.vue +5 -4
- package/core/client/components/collection/KGrid.vue +5 -1
- package/core/client/components/collection/KItemsFilter.vue +47 -0
- package/core/client/components/collection/KItemsSorter.vue +42 -0
- package/core/client/components/collection/KScrollDown.vue +2 -2
- package/core/client/components/collection/KSearchFilterControl.vue +3 -2
- package/core/client/components/collection/KSorter.vue +33 -37
- package/core/client/components/collection/KTagsFilterControl.vue +14 -40
- package/core/client/components/collection/KTagsFilterView.vue +10 -45
- package/core/client/components/collection/KTimeFilterControl.vue +6 -7
- package/core/client/components/collection/KTimeFilterView.vue +13 -22
- package/core/client/components/collection/KTimeLine.vue +18 -9
- package/core/client/components/form/KColorField.vue +13 -6
- package/core/client/components/form/KColorScaleField.vue +7 -12
- package/core/client/components/form/KFileField.vue +118 -89
- package/core/client/components/form/KForm.vue +30 -18
- package/core/client/components/form/KIconField.vue +4 -1
- package/core/client/components/form/KNumberField.vue +9 -2
- package/core/client/components/form/KSelectField.vue +1 -4
- package/core/client/components/form/KTagField.vue +229 -0
- package/core/client/components/form/KTextField.vue +4 -0
- package/core/client/components/form/KTextareaField.vue +3 -1
- package/core/client/components/input/KShapePicker.vue +3 -3
- package/core/client/components/layout/KFab.vue +32 -20
- package/core/client/components/layout/KPage.vue +11 -6
- package/core/client/components/layout/KWindow.vue +5 -0
- package/core/client/components/media/index.js +2 -6
- package/core/client/components/menu/KMenu.vue +12 -10
- package/core/client/components/menu/KSubMenu.vue +12 -12
- package/core/client/components/messages/KMessageCard.vue +13 -12
- package/core/client/components/messages/KMessageComposer.vue +13 -9
- package/core/client/components/messages/KMessagesTimeLine.vue +16 -8
- package/core/client/components/tags/KTagFilter.vue +99 -0
- package/core/client/components/tags/KTagItem.vue +65 -0
- package/core/client/components/tags/KTagManager.vue +198 -0
- package/core/client/components/tags/KTagSelection.vue +82 -0
- package/core/client/components/time/KDate.vue +3 -17
- package/core/client/components/time/KDateTime.vue +1 -1
- package/core/client/components/time/KTime.vue +0 -4
- package/core/client/composables/collection-filter.js +41 -2
- package/core/client/composables/collection.js +3 -3
- package/core/client/composables/index.js +1 -0
- package/core/client/composables/pwa.js +13 -0
- package/core/client/composables/session.js +7 -8
- package/core/client/composables/user.js +36 -0
- package/core/client/directives/index.js +1 -0
- package/core/client/directives/v-drop-file.js +174 -0
- package/core/client/document.js +2 -1
- package/core/client/exporter.js +17 -3
- package/core/client/i18n/core_en.json +34 -7
- package/core/client/i18n/core_fr.json +36 -9
- package/core/client/i18n.js +26 -11
- package/core/client/layout.js +5 -5
- package/core/client/mixins/mixin.base-activity.js +8 -5
- package/core/client/mixins/mixin.base-editor.js +2 -1
- package/core/client/mixins/mixin.base-field.js +3 -2
- package/core/client/mixins/mixin.base-item.js +12 -10
- package/core/client/mixins/mixin.service.js +3 -1
- package/core/client/platform.js +0 -3
- package/core/client/readers/reader.json.js +2 -2
- package/core/client/utils/index.js +2 -0
- package/core/client/utils/utils.collection.js +6 -6
- package/core/client/utils/utils.colors.js +46 -19
- package/core/client/utils/utils.files.js +19 -0
- package/core/client/utils/utils.locale.js +13 -17
- package/core/client/utils/utils.services.js +27 -0
- package/core/client/utils/utils.shapes.js +2 -2
- package/core/client/utils/utils.tags.js +17 -0
- package/core/client/utils/utils.tours.js +31 -0
- package/core/common/permissions.js +3 -0
- package/core/common/schemas/tags.update.json +35 -0
- package/core/common/schemas/users.update-profile.json +1 -1
- package/core/common/utils.js +5 -5
- package/extras/configs/panes.top.js +11 -0
- package/extras/configs/stickies.js +1 -1
- package/extras/configs/widgets.left.js +13 -1
- package/extras/libs/jsts.min.js +8 -0
- package/{test/client/core/account.js → extras/tests/core/account.mjs} +4 -4
- package/extras/tests/core/api.mjs +114 -0
- package/{test/client/core/collection.js → extras/tests/core/collection.mjs} +8 -8
- package/{test/client/core/dialogs.js → extras/tests/core/dialogs.mjs} +1 -1
- package/extras/tests/core/index.mjs +9 -0
- package/{test/client/core/layout.js → extras/tests/core/layout.mjs} +7 -3
- package/{test/client/core/runner.js → extras/tests/core/runner.mjs} +3 -3
- package/{test/client/core/screens.js → extras/tests/core/screens.mjs} +1 -1
- package/{test/client/core/utils.js → extras/tests/core/utils.mjs} +79 -26
- package/extras/tests/index.mjs +4 -0
- package/{test/client/map/api.js → extras/tests/map/api.mjs} +1 -1
- package/{test/client/map/catalog.js → extras/tests/map/catalog.mjs} +18 -18
- package/{test/client/map/controls.js → extras/tests/map/controls.mjs} +3 -3
- package/extras/tests/map/index.mjs +5 -0
- package/{test/client/map/time.js → extras/tests/map/time.mjs} +3 -3
- package/{test/client/map/utils.js → extras/tests/map/utils.mjs} +6 -5
- package/extras/tours/fab.js +36 -0
- package/extras/tours/layout.js +49 -0
- package/extras/tours/pane.left.js +78 -0
- package/extras/tours/pane.right.js +145 -0
- package/extras/tours/pane.top.js +239 -0
- package/map/api/config/layers.cjs +28 -13
- package/map/api/hooks/hooks.query.js +12 -7
- package/map/api/models/catalog.model.mongodb.js +17 -6
- package/map/api/services/catalog/catalog.hooks.js +1 -1
- package/map/api/services/index.js +18 -1
- package/map/client/cesium/utils/utils.cesium.js +25 -65
- package/map/client/cesium/utils/utils.features.js +1 -0
- package/map/client/cesium/utils/utils.geojson.js +1 -0
- package/map/client/cesium/utils/utils.style.js +7 -6
- package/map/client/components/KFeatureEditor.vue +3 -3
- package/map/client/components/KFeaturesChart.vue +4 -4
- package/map/client/components/KFeaturesFilterEditor.vue +19 -13
- package/map/client/components/KFeaturesFilterManager.vue +7 -4
- package/map/client/components/KFeaturesTable.vue +2 -2
- package/map/client/components/KLayerEditor.vue +6 -6
- package/map/client/components/KMeasureTool.vue +2 -1
- package/map/client/components/catalog/KBaseLayersSelector.vue +1 -1
- package/map/client/components/catalog/KCategoryItem.vue +15 -1
- package/map/client/components/catalog/KConnectLayer.vue +2 -2
- package/map/client/components/catalog/KCreateView.vue +3 -2
- package/map/client/components/catalog/KFilteredLayerItem.vue +26 -6
- package/map/client/components/catalog/KImportLayer.vue +6 -3
- package/map/client/components/catalog/KLayerCategories.vue +6 -6
- package/map/client/components/catalog/KLayerItem.vue +12 -2
- package/map/client/components/catalog/KLayersList.vue +180 -0
- package/map/client/components/catalog/KLayersPanel.vue +146 -36
- package/map/client/components/catalog/KLayersSelector.vue +96 -48
- package/map/client/components/catalog/KProjectEditor.vue +0 -9
- package/map/client/components/catalog/KProjectSelector.vue +3 -2
- package/map/client/components/catalog/KProjectsPanel.vue +23 -8
- package/map/client/components/catalog/KViewsPanel.vue +18 -8
- package/map/client/components/catalog/KWeatherLayersSelector.vue +3 -3
- package/map/client/components/form/KDirectionField.vue +3 -6
- package/map/client/components/form/KLayerCategoryField.vue +2 -2
- package/map/client/components/form/KOwsServiceField.vue +25 -24
- package/map/client/components/form/KSelectLayersField.vue +4 -4
- package/map/client/components/form/KSelectViewsField.vue +4 -4
- package/map/client/components/legend/KLayerLegend.vue +11 -2
- package/map/client/components/legend/KLegend.vue +44 -51
- package/map/client/components/location/KLocationCardSection.vue +6 -7
- package/map/client/components/location/KLocationMap.vue +23 -13
- package/map/client/components/stickies/KPosition.vue +5 -0
- package/map/client/components/styles/KLayerStyleAction.vue +59 -12
- package/map/client/components/styles/KStyleEditor.vue +71 -8
- package/map/client/components/styles/KStyleEditorSection.vue +82 -33
- package/map/client/components/styles/KStyleManager.vue +119 -59
- package/map/client/components/styles/KStylePreview.vue +9 -25
- package/map/client/components/styles/KStylePreviewItem.vue +22 -1
- package/map/client/components/tools/KSearchTool.vue +1 -1
- package/map/client/components/widget/KElevationProfile.vue +20 -17
- package/map/client/components/widget/KInformationBox.vue +5 -5
- package/map/client/components/widget/KMapillaryViewer.vue +2 -1
- package/map/client/components/widget/KTimeSeries.vue +11 -9
- package/map/client/globe.js +2 -0
- package/map/client/i18n/map_en.json +29 -7
- package/map/client/i18n/map_fr.json +29 -7
- package/map/client/leaflet/GradientPath.js +61 -24
- package/map/client/leaflet/ShapeMarker.js +12 -5
- package/map/client/leaflet/TiledMeshLayer.js +3 -3
- package/map/client/leaflet/utils/utils.geojson.js +66 -8
- package/map/client/leaflet/utils/utils.style.js +14 -15
- package/map/client/mixins/globe/mixin.base-globe.js +181 -34
- package/map/client/mixins/globe/mixin.file-layers.js +3 -0
- package/map/client/mixins/globe/mixin.geojson-layers.js +179 -31
- package/map/client/mixins/globe/mixin.opendap-layers.js +2 -1
- package/map/client/mixins/globe/mixin.style.js +23 -1
- package/map/client/mixins/globe/mixin.tooltip.js +14 -2
- package/map/client/mixins/map/mixin.base-map.js +146 -58
- package/map/client/mixins/map/mixin.edit-layers.js +18 -15
- package/map/client/mixins/map/mixin.geojson-layers.js +181 -106
- package/map/client/mixins/map/mixin.heatmap-layers.js +3 -2
- package/map/client/mixins/map/mixin.map-activity.js +6 -1
- package/map/client/mixins/map/mixin.mapillary-layers.js +2 -1
- package/map/client/mixins/map/mixin.pmtiles-layers.js +3 -3
- package/map/client/mixins/map/mixin.tiled-mesh-layers.js +3 -2
- package/map/client/mixins/map/mixin.tiled-wind-layers.js +3 -2
- package/map/client/mixins/mixin.activity.js +197 -51
- package/map/client/mixins/mixin.context.js +11 -11
- package/map/client/mixins/mixin.feature-service.js +11 -9
- package/map/client/mixins/mixin.weacast.js +5 -3
- package/map/client/readers/reader.geojson.js +3 -1
- package/map/client/utils/utils.capture.js +3 -3
- package/map/client/utils/utils.catalog.js +9 -5
- package/map/client/utils/utils.features.js +120 -54
- package/map/client/utils/utils.js +25 -10
- package/map/client/utils/utils.layers.js +148 -24
- package/map/client/utils/utils.location.js +26 -9
- package/map/client/utils/utils.schema.js +2 -1
- package/map/client/utils/utils.style.js +53 -9
- package/map/common/geotiff-grid-source.js +1 -3
- package/map/common/opendap-utils.js +0 -1
- package/map/common/tms-utils.js +0 -1
- package/map/common/wcs-utils.js +0 -1
- package/map/common/wfs-utils.js +0 -1
- package/map/common/wms-utils.js +7 -1
- package/map/common/wmts-utils.js +0 -1
- package/package.json +12 -12
- package/scripts/init_runner.sh +3 -3
- package/scripts/kash/CHANGELOG.md +27 -0
- package/scripts/kash/kash.sh +556 -237
- package/scripts/kash/scripts/run_tests.sh +44 -5
- package/scripts/setup_workspace.sh +23 -13
- package/test/api/core/config/default.cjs +2 -1
- package/test/api/core/tags.test.js +62 -0
- package/test/api/map/config/default.cjs +2 -1
- package/test/api/map/config/layers.json +9 -0
- package/test/api/map/data/openradiation.json +13811 -0
- package/test/api/map/grid-sources.test.js +1 -3
- package/test/api/map/index.test.js +60 -1
- package/test/api/map/style.test.js +30 -1
- package/test.api.js +1 -1
- package/vite/App.vue +18 -0
- package/vite/AppWithGlobe.vue +84 -0
- package/vite/GlobeActivity.vue +58 -0
- package/vite/MapActivity.vue +63 -0
- package/vite/MapActivityWithGlobe.vue +63 -0
- package/vite/README.md +169 -0
- package/vite/config.js +221 -0
- package/vite/index_with_globe.html +50 -0
- package/vite/index_with_map.html +50 -0
- package/vite/package.json +173 -0
- package/vite/quasar.variables.scss +17 -0
- package/vite/vite.config.js +166 -0
- package/vite/yarn.lock +11641 -0
- package/core/client/components/media/KImageViewer.vue +0 -68
- package/core/client/components/media/KMarkdownViewer.vue +0 -55
- package/core/client/components/media/KMediaBrowser.vue +0 -301
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/core/api/application.js.html +0 -1870
- package/coverage/core/api/authentication.js.html +0 -874
- package/coverage/core/api/db.js.html +0 -793
- package/coverage/core/api/hooks/hooks.authentication.js.html +0 -139
- package/coverage/core/api/hooks/hooks.authorisations.js.html +0 -958
- package/coverage/core/api/hooks/hooks.groups.js.html +0 -229
- package/coverage/core/api/hooks/hooks.logger.js.html +0 -163
- package/coverage/core/api/hooks/hooks.model.js.html +0 -967
- package/coverage/core/api/hooks/hooks.organisations.js.html +0 -541
- package/coverage/core/api/hooks/hooks.push.js.html +0 -265
- package/coverage/core/api/hooks/hooks.query.js.html +0 -862
- package/coverage/core/api/hooks/hooks.schemas.js.html +0 -298
- package/coverage/core/api/hooks/hooks.service.js.html +0 -319
- package/coverage/core/api/hooks/hooks.storage.js.html +0 -193
- package/coverage/core/api/hooks/hooks.users.js.html +0 -595
- package/coverage/core/api/hooks/index.html +0 -266
- package/coverage/core/api/hooks/index.js.html +0 -115
- package/coverage/core/api/index.html +0 -176
- package/coverage/core/api/index.js.html +0 -148
- package/coverage/core/api/marshall.js.html +0 -448
- package/coverage/core/api/models/groups.model.mongodb.js.html +0 -109
- package/coverage/core/api/models/index.html +0 -131
- package/coverage/core/api/models/messages.model.mongodb.js.html +0 -121
- package/coverage/core/api/models/organisations.model.mongodb.js.html +0 -94
- package/coverage/core/api/models/tags.model.mongodb.js.html +0 -115
- package/coverage/core/api/models/users.model.mongodb.js.html +0 -115
- package/coverage/core/api/services/account/account.hooks.js.html +0 -208
- package/coverage/core/api/services/account/account.service.js.html +0 -436
- package/coverage/core/api/services/account/index.html +0 -131
- package/coverage/core/api/services/authorisations/authorisations.hooks.js.html +0 -184
- package/coverage/core/api/services/authorisations/authorisations.service.js.html +0 -520
- package/coverage/core/api/services/authorisations/index.html +0 -131
- package/coverage/core/api/services/databases/databases.hooks.js.html +0 -193
- package/coverage/core/api/services/databases/databases.service.js.html +0 -100
- package/coverage/core/api/services/databases/index.html +0 -131
- package/coverage/core/api/services/groups/groups.hooks.js.html +0 -178
- package/coverage/core/api/services/groups/index.html +0 -116
- package/coverage/core/api/services/import-export/import-export.hooks.js.html +0 -184
- package/coverage/core/api/services/import-export/import-export.service.js.html +0 -118
- package/coverage/core/api/services/import-export/index.html +0 -131
- package/coverage/core/api/services/index.html +0 -116
- package/coverage/core/api/services/index.js.html +0 -532
- package/coverage/core/api/services/mailer/index.html +0 -131
- package/coverage/core/api/services/mailer/mailer.hooks.js.html +0 -190
- package/coverage/core/api/services/mailer/mailer.service.js.html +0 -118
- package/coverage/core/api/services/messages/index.html +0 -116
- package/coverage/core/api/services/messages/messages.hooks.js.html +0 -202
- package/coverage/core/api/services/organisations/index.html +0 -131
- package/coverage/core/api/services/organisations/organisations.hooks.js.html +0 -178
- package/coverage/core/api/services/organisations/organisations.service.js.html +0 -343
- package/coverage/core/api/services/push/index.html +0 -131
- package/coverage/core/api/services/push/push.hooks.js.html +0 -190
- package/coverage/core/api/services/push/push.service.js.html +0 -121
- package/coverage/core/api/services/storage/index.html +0 -131
- package/coverage/core/api/services/storage/storage.hooks.js.html +0 -190
- package/coverage/core/api/services/storage/storage.service.js.html +0 -172
- package/coverage/core/api/services/tags/index.html +0 -116
- package/coverage/core/api/services/tags/tags.hooks.js.html +0 -178
- package/coverage/core/api/services/users/index.html +0 -131
- package/coverage/core/api/services/users/users.hooks.js.html +0 -310
- package/coverage/core/api/services/users/users.service.js.html +0 -100
- package/coverage/core/api/utils.js.html +0 -118
- package/coverage/core/common/errors.js.html +0 -88
- package/coverage/core/common/index.html +0 -191
- package/coverage/core/common/index.js.html +0 -115
- package/coverage/core/common/permissions.js.html +0 -733
- package/coverage/core/common/schema.js.html +0 -190
- package/coverage/core/common/utils.js.html +0 -226
- package/coverage/core/common/utils.offline.js.html +0 -199
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -476
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/core/api/application.js.html +0 -1870
- package/coverage/lcov-report/core/api/authentication.js.html +0 -874
- package/coverage/lcov-report/core/api/db.js.html +0 -793
- package/coverage/lcov-report/core/api/hooks/hooks.authentication.js.html +0 -139
- package/coverage/lcov-report/core/api/hooks/hooks.authorisations.js.html +0 -958
- package/coverage/lcov-report/core/api/hooks/hooks.groups.js.html +0 -229
- package/coverage/lcov-report/core/api/hooks/hooks.logger.js.html +0 -163
- package/coverage/lcov-report/core/api/hooks/hooks.model.js.html +0 -967
- package/coverage/lcov-report/core/api/hooks/hooks.organisations.js.html +0 -541
- package/coverage/lcov-report/core/api/hooks/hooks.push.js.html +0 -265
- package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +0 -862
- package/coverage/lcov-report/core/api/hooks/hooks.schemas.js.html +0 -298
- package/coverage/lcov-report/core/api/hooks/hooks.service.js.html +0 -319
- package/coverage/lcov-report/core/api/hooks/hooks.storage.js.html +0 -193
- package/coverage/lcov-report/core/api/hooks/hooks.users.js.html +0 -595
- package/coverage/lcov-report/core/api/hooks/index.html +0 -266
- package/coverage/lcov-report/core/api/hooks/index.js.html +0 -115
- package/coverage/lcov-report/core/api/index.html +0 -176
- package/coverage/lcov-report/core/api/index.js.html +0 -148
- package/coverage/lcov-report/core/api/marshall.js.html +0 -448
- package/coverage/lcov-report/core/api/models/groups.model.mongodb.js.html +0 -109
- package/coverage/lcov-report/core/api/models/index.html +0 -131
- package/coverage/lcov-report/core/api/models/messages.model.mongodb.js.html +0 -121
- package/coverage/lcov-report/core/api/models/organisations.model.mongodb.js.html +0 -94
- package/coverage/lcov-report/core/api/models/tags.model.mongodb.js.html +0 -115
- package/coverage/lcov-report/core/api/models/users.model.mongodb.js.html +0 -115
- package/coverage/lcov-report/core/api/services/account/account.hooks.js.html +0 -208
- package/coverage/lcov-report/core/api/services/account/account.service.js.html +0 -436
- package/coverage/lcov-report/core/api/services/account/index.html +0 -131
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.hooks.js.html +0 -184
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.service.js.html +0 -520
- package/coverage/lcov-report/core/api/services/authorisations/index.html +0 -131
- package/coverage/lcov-report/core/api/services/databases/databases.hooks.js.html +0 -193
- package/coverage/lcov-report/core/api/services/databases/databases.service.js.html +0 -100
- package/coverage/lcov-report/core/api/services/databases/index.html +0 -131
- package/coverage/lcov-report/core/api/services/groups/groups.hooks.js.html +0 -178
- package/coverage/lcov-report/core/api/services/groups/index.html +0 -116
- package/coverage/lcov-report/core/api/services/import-export/import-export.hooks.js.html +0 -184
- package/coverage/lcov-report/core/api/services/import-export/import-export.service.js.html +0 -118
- package/coverage/lcov-report/core/api/services/import-export/index.html +0 -131
- package/coverage/lcov-report/core/api/services/index.html +0 -116
- package/coverage/lcov-report/core/api/services/index.js.html +0 -532
- package/coverage/lcov-report/core/api/services/mailer/index.html +0 -131
- package/coverage/lcov-report/core/api/services/mailer/mailer.hooks.js.html +0 -190
- package/coverage/lcov-report/core/api/services/mailer/mailer.service.js.html +0 -118
- package/coverage/lcov-report/core/api/services/messages/index.html +0 -116
- package/coverage/lcov-report/core/api/services/messages/messages.hooks.js.html +0 -202
- package/coverage/lcov-report/core/api/services/organisations/index.html +0 -131
- package/coverage/lcov-report/core/api/services/organisations/organisations.hooks.js.html +0 -178
- package/coverage/lcov-report/core/api/services/organisations/organisations.service.js.html +0 -343
- package/coverage/lcov-report/core/api/services/push/index.html +0 -131
- package/coverage/lcov-report/core/api/services/push/push.hooks.js.html +0 -190
- package/coverage/lcov-report/core/api/services/push/push.service.js.html +0 -121
- package/coverage/lcov-report/core/api/services/storage/index.html +0 -131
- package/coverage/lcov-report/core/api/services/storage/storage.hooks.js.html +0 -190
- package/coverage/lcov-report/core/api/services/storage/storage.service.js.html +0 -172
- package/coverage/lcov-report/core/api/services/tags/index.html +0 -116
- package/coverage/lcov-report/core/api/services/tags/tags.hooks.js.html +0 -178
- package/coverage/lcov-report/core/api/services/users/index.html +0 -131
- package/coverage/lcov-report/core/api/services/users/users.hooks.js.html +0 -310
- package/coverage/lcov-report/core/api/services/users/users.service.js.html +0 -100
- package/coverage/lcov-report/core/api/utils.js.html +0 -118
- package/coverage/lcov-report/core/common/errors.js.html +0 -88
- package/coverage/lcov-report/core/common/index.html +0 -191
- package/coverage/lcov-report/core/common/index.js.html +0 -115
- package/coverage/lcov-report/core/common/permissions.js.html +0 -733
- package/coverage/lcov-report/core/common/schema.js.html +0 -190
- package/coverage/lcov-report/core/common/utils.js.html +0 -226
- package/coverage/lcov-report/core/common/utils.offline.js.html +0 -199
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -476
- package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +0 -553
- package/coverage/lcov-report/map/api/hooks/hooks.features.js.html +0 -397
- package/coverage/lcov-report/map/api/hooks/hooks.query.js.html +0 -1294
- package/coverage/lcov-report/map/api/hooks/index.html +0 -161
- package/coverage/lcov-report/map/api/hooks/index.js.html +0 -94
- package/coverage/lcov-report/map/api/index.html +0 -131
- package/coverage/lcov-report/map/api/index.js.html +0 -139
- package/coverage/lcov-report/map/api/marshall.js.html +0 -178
- package/coverage/lcov-report/map/api/models/alerts.model.mongodb.js.html +0 -106
- package/coverage/lcov-report/map/api/models/catalog.model.mongodb.js.html +0 -169
- package/coverage/lcov-report/map/api/models/features.model.mongodb.js.html +0 -196
- package/coverage/lcov-report/map/api/models/index.html +0 -176
- package/coverage/lcov-report/map/api/models/projects.model.mongodb.js.html +0 -109
- package/coverage/lcov-report/map/api/models/styles.model.mongodb.js.html +0 -112
- package/coverage/lcov-report/map/api/services/alerts/alerts.hooks.js.html +0 -274
- package/coverage/lcov-report/map/api/services/alerts/alerts.service.js.html +0 -610
- package/coverage/lcov-report/map/api/services/alerts/index.html +0 -131
- package/coverage/lcov-report/map/api/services/catalog/catalog.hooks.js.html +0 -328
- package/coverage/lcov-report/map/api/services/catalog/index.html +0 -116
- package/coverage/lcov-report/map/api/services/daptiles/daptiles.service.js.html +0 -1510
- package/coverage/lcov-report/map/api/services/daptiles/index.html +0 -116
- package/coverage/lcov-report/map/api/services/features/features.hooks.js.html +0 -310
- package/coverage/lcov-report/map/api/services/features/features.service.js.html +0 -544
- package/coverage/lcov-report/map/api/services/features/index.html +0 -131
- package/coverage/lcov-report/map/api/services/index.html +0 -116
- package/coverage/lcov-report/map/api/services/index.js.html +0 -1054
- package/coverage/lcov-report/map/api/services/projects/index.html +0 -116
- package/coverage/lcov-report/map/api/services/projects/projects.hooks.js.html +0 -439
- package/coverage/lcov-report/map/api/services/styles/index.html +0 -116
- package/coverage/lcov-report/map/api/services/styles/styles.hooks.js.html +0 -196
- package/coverage/lcov-report/map/common/dynamic-grid-source.js.html +0 -466
- package/coverage/lcov-report/map/common/errors.js.html +0 -94
- package/coverage/lcov-report/map/common/geotiff-grid-source.js.html +0 -544
- package/coverage/lcov-report/map/common/grid.js.html +0 -1612
- package/coverage/lcov-report/map/common/index.html +0 -371
- package/coverage/lcov-report/map/common/index.js.html +0 -172
- package/coverage/lcov-report/map/common/meteo-model-grid-source.js.html +0 -556
- package/coverage/lcov-report/map/common/moment-utils.js.html +0 -157
- package/coverage/lcov-report/map/common/opendap-grid-source.js.html +0 -868
- package/coverage/lcov-report/map/common/opendap-utils.js.html +0 -826
- package/coverage/lcov-report/map/common/permissions.js.html +0 -130
- package/coverage/lcov-report/map/common/time-based-grid-source.js.html +0 -418
- package/coverage/lcov-report/map/common/tms-utils.js.html +0 -274
- package/coverage/lcov-report/map/common/wcs-grid-source.js.html +0 -364
- package/coverage/lcov-report/map/common/wcs-utils.js.html +0 -586
- package/coverage/lcov-report/map/common/weacast-grid-source.js.html +0 -1033
- package/coverage/lcov-report/map/common/wfs-utils.js.html +0 -574
- package/coverage/lcov-report/map/common/wms-utils.js.html +0 -451
- package/coverage/lcov-report/map/common/wmts-utils.js.html +0 -547
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov.info +0 -11520
- package/coverage/map/api/hooks/hooks.catalog.js.html +0 -553
- package/coverage/map/api/hooks/hooks.features.js.html +0 -397
- package/coverage/map/api/hooks/hooks.query.js.html +0 -1294
- package/coverage/map/api/hooks/index.html +0 -161
- package/coverage/map/api/hooks/index.js.html +0 -94
- package/coverage/map/api/index.html +0 -131
- package/coverage/map/api/index.js.html +0 -139
- package/coverage/map/api/marshall.js.html +0 -178
- package/coverage/map/api/models/alerts.model.mongodb.js.html +0 -106
- package/coverage/map/api/models/catalog.model.mongodb.js.html +0 -169
- package/coverage/map/api/models/features.model.mongodb.js.html +0 -196
- package/coverage/map/api/models/index.html +0 -176
- package/coverage/map/api/models/projects.model.mongodb.js.html +0 -109
- package/coverage/map/api/models/styles.model.mongodb.js.html +0 -112
- package/coverage/map/api/services/alerts/alerts.hooks.js.html +0 -274
- package/coverage/map/api/services/alerts/alerts.service.js.html +0 -610
- package/coverage/map/api/services/alerts/index.html +0 -131
- package/coverage/map/api/services/catalog/catalog.hooks.js.html +0 -328
- package/coverage/map/api/services/catalog/index.html +0 -116
- package/coverage/map/api/services/daptiles/daptiles.service.js.html +0 -1510
- package/coverage/map/api/services/daptiles/index.html +0 -116
- package/coverage/map/api/services/features/features.hooks.js.html +0 -310
- package/coverage/map/api/services/features/features.service.js.html +0 -544
- package/coverage/map/api/services/features/index.html +0 -131
- package/coverage/map/api/services/index.html +0 -116
- package/coverage/map/api/services/index.js.html +0 -1054
- package/coverage/map/api/services/projects/index.html +0 -116
- package/coverage/map/api/services/projects/projects.hooks.js.html +0 -439
- package/coverage/map/api/services/styles/index.html +0 -116
- package/coverage/map/api/services/styles/styles.hooks.js.html +0 -196
- package/coverage/map/common/dynamic-grid-source.js.html +0 -466
- package/coverage/map/common/errors.js.html +0 -94
- package/coverage/map/common/geotiff-grid-source.js.html +0 -544
- package/coverage/map/common/grid.js.html +0 -1612
- package/coverage/map/common/index.html +0 -371
- package/coverage/map/common/index.js.html +0 -172
- package/coverage/map/common/meteo-model-grid-source.js.html +0 -556
- package/coverage/map/common/moment-utils.js.html +0 -157
- package/coverage/map/common/opendap-grid-source.js.html +0 -868
- package/coverage/map/common/opendap-utils.js.html +0 -826
- package/coverage/map/common/permissions.js.html +0 -130
- package/coverage/map/common/time-based-grid-source.js.html +0 -418
- package/coverage/map/common/tms-utils.js.html +0 -274
- package/coverage/map/common/wcs-grid-source.js.html +0 -364
- package/coverage/map/common/wcs-utils.js.html +0 -586
- package/coverage/map/common/weacast-grid-source.js.html +0 -1033
- package/coverage/map/common/wfs-utils.js.html +0 -574
- package/coverage/map/common/wms-utils.js.html +0 -451
- package/coverage/map/common/wmts-utils.js.html +0 -547
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -196
- package/coverage/tmp/coverage-151198-1753351220086-0.json +0 -1
- package/coverage/tmp/coverage-151210-1753351220070-0.json +0 -1
- package/coverage/tmp/coverage-151221-1753351129816-0.json +0 -1
- package/coverage/tmp/coverage-151233-1753351129803-0.json +0 -1
- package/coverage/tmp/coverage-151240-1753351129770-0.json +0 -1
- package/coverage/tmp/coverage-151307-1753351220058-0.json +0 -1
- package/coverage/tmp/coverage-151319-1753351220044-0.json +0 -1
- package/coverage/tmp/coverage-151326-1753351220010-0.json +0 -1
- package/extras/tours/core/account-profile.js +0 -32
- package/extras/tours/core/account.js +0 -143
- package/extras/tours/core/add-member.js +0 -75
- package/extras/tours/core/add-tag.js +0 -13
- package/extras/tours/core/create-group.js +0 -19
- package/extras/tours/core/create-organisation.js +0 -19
- package/extras/tours/core/create-tag.js +0 -26
- package/extras/tours/core/edit-member-role.js +0 -13
- package/extras/tours/core/groups.js +0 -65
- package/extras/tours/core/join-group.js +0 -13
- package/extras/tours/core/login.js +0 -41
- package/extras/tours/core/members.js +0 -108
- package/extras/tours/core/register.js +0 -61
- package/extras/tours/core/send-reset-password.js +0 -14
- package/extras/tours/core/tags.js +0 -65
- package/extras/tours/map/catalog-panel.js +0 -112
- package/extras/tours/map/fab.js +0 -26
- package/extras/tours/map/navigation-bar.js +0 -187
- package/extras/tours/map/side-nav.js +0 -36
- package/test/api/core/test-log-2025-02-05.log +0 -23
- package/test/api/core/test-log-2025-05-21.log +0 -15
- package/test/api/core/test-log-2025-06-25.log +0 -9
- package/test/api/core/test-log-2025-07-24.log +0 -44
- package/test/api/map/test-log-2025-05-27.log +0 -13
- package/test/api/map/test-log-2025-06-23.log +0 -7
- package/test/api/map/test-log-2025-07-24.log +0 -11
- package/test/client/core/api.js +0 -361
- package/test/client/core/index.js +0 -9
- package/test/client/index.js +0 -4
- package/test/client/map/index.js +0 -5
- package/test.client.js +0 -1
- /package/{test/client/core/time.js → extras/tests/core/time.mjs} +0 -0
- /package/extras/tours/{map/add-layer.js → add-layer.js} +0 -0
- /package/extras/tours/{map/catalog-categories.js → catalog-categories.js} +0 -0
- /package/extras/tours/{map/connect-layer.js → connect-layer.js} +0 -0
- /package/extras/tours/{map/create-layer.js → create-layer.js} +0 -0
- /package/extras/tours/{map/create-view.js → create-view.js} +0 -0
- /package/extras/tours/{map/import-layer.js → import-layer.js} +0 -0
- /package/extras/tours/{map/timeline.js → pane.bottom.js} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _ from 'lodash'
|
|
2
2
|
import moment from 'moment'
|
|
3
|
+
import { Entity } from 'cesium'
|
|
3
4
|
import { Time, Units } from '../../../../core/client/index.js'
|
|
4
5
|
|
|
5
6
|
export const tooltip = {
|
|
@@ -7,15 +8,26 @@ export const tooltip = {
|
|
|
7
8
|
applyTooltips (entities, options) {
|
|
8
9
|
for (let i = 0; i < entities.values.length; i++) {
|
|
9
10
|
const entity = entities.values[i]
|
|
11
|
+
// Get any previous tooltip entity
|
|
12
|
+
const previousTooltipEntity = this.getChildForEntity(entity)
|
|
10
13
|
const tooltip = this.generateStyle('tooltip', entity, options)
|
|
11
14
|
if (tooltip) {
|
|
12
15
|
// Default tooltip position (can change in sticky mode)
|
|
13
16
|
const position = this.getPositionForEntity(entity)
|
|
14
17
|
if (position) {
|
|
15
|
-
const tooltipEntity =
|
|
18
|
+
const tooltipEntity = new Entity({ parent: entity, position, label: tooltip })
|
|
16
19
|
// This option is not cesium specific so we have to manage it manually
|
|
17
|
-
|
|
20
|
+
tooltipEntity.sticky = true
|
|
21
|
+
if (!previousTooltipEntity) {
|
|
22
|
+
this.viewer.entities.add(tooltipEntity)
|
|
23
|
+
} else {
|
|
24
|
+
previousTooltipEntity.position = tooltipEntity.position
|
|
25
|
+
previousTooltipEntity.label = tooltipEntity.label
|
|
26
|
+
tooltipEntity.parent = null
|
|
27
|
+
}
|
|
18
28
|
}
|
|
29
|
+
} else if (previousTooltipEntity) {
|
|
30
|
+
this.viewer.entities.remove(previousTooltipEntity)
|
|
19
31
|
}
|
|
20
32
|
}
|
|
21
33
|
},
|
|
@@ -2,16 +2,13 @@ import _ from 'lodash'
|
|
|
2
2
|
import sift from 'sift'
|
|
3
3
|
import logger from 'loglevel'
|
|
4
4
|
import moment from 'moment'
|
|
5
|
-
import
|
|
6
|
-
import Emitter from 'tiny-emitter'
|
|
5
|
+
import { EventBus } from 'quasar'
|
|
7
6
|
import { point, rhumbDistance, rhumbBearing, rhumbDestination } from '@turf/turf'
|
|
7
|
+
import L from 'leaflet'
|
|
8
8
|
import 'leaflet/dist/leaflet.css'
|
|
9
9
|
// This ensure we have all required plugins
|
|
10
10
|
import 'leaflet-fullscreen'
|
|
11
11
|
import 'leaflet-fullscreen/dist/leaflet.fullscreen.css'
|
|
12
|
-
import 'leaflet.markercluster/dist/MarkerCluster.css'
|
|
13
|
-
import 'leaflet.markercluster/dist/MarkerCluster.Default.css'
|
|
14
|
-
import 'leaflet.markercluster'
|
|
15
12
|
import '@kalisio/leaflet.donutcluster/src/Leaflet.DonutCluster.css'
|
|
16
13
|
import '@kalisio/leaflet.donutcluster'
|
|
17
14
|
import 'leaflet.vectorgrid/dist/Leaflet.VectorGrid.bundled.js'
|
|
@@ -27,12 +24,14 @@ import 'leaflet-timedimension/dist/leaflet.timedimension.control.css'
|
|
|
27
24
|
import '@geoman-io/leaflet-geoman-free'
|
|
28
25
|
import '@geoman-io/leaflet-geoman-free/dist/leaflet-geoman.css'
|
|
29
26
|
import 'leaflet-rotate/dist/leaflet-rotate-src.js'
|
|
27
|
+
|
|
30
28
|
import { Time } from '../../../../core/client/time.js'
|
|
31
|
-
import {
|
|
29
|
+
import { Events } from '../../../../core/client/events.js'
|
|
30
|
+
import { getLocale } from '../../../../core/client/utils/index.js'
|
|
32
31
|
import '../../leaflet/BoxSelection.js'
|
|
33
32
|
import '../../leaflet/WindBarb.js'
|
|
34
33
|
import { Geolocation } from '../../geolocation.js'
|
|
35
|
-
import { LeafletEvents, TouchEvents, bindLeafletEvents } from '../../utils.map.js' // https://github.com/socib/Leaflet.TimeDimension/issues/124
|
|
34
|
+
import { LeafletEvents, TouchEvents, bindLeafletEvents, getNearestTime } from '../../utils.map.js' // https://github.com/socib/Leaflet.TimeDimension/issues/124
|
|
36
35
|
import { generateLayerDefinition } from '../../utils/utils.layers.js'
|
|
37
36
|
import * as maths from '../../../../core/client/utils/utils.math.js'
|
|
38
37
|
|
|
@@ -117,7 +116,7 @@ export const baseMap = {
|
|
|
117
116
|
if (this.map.pm === undefined) {
|
|
118
117
|
this.map.options.pmIgnore = false
|
|
119
118
|
L.PM.reInitLayer(this.map)
|
|
120
|
-
this.map.pm.setLang(
|
|
119
|
+
this.map.pm.setLang(getLocale())
|
|
121
120
|
}
|
|
122
121
|
// Leaflet does not really manage touch events, it provides compatibility mapping with mouse events
|
|
123
122
|
// but it will not really trigger touch event from the map object, as a consequence we manage this by ourselves
|
|
@@ -331,30 +330,35 @@ export const baseMap = {
|
|
|
331
330
|
})
|
|
332
331
|
},
|
|
333
332
|
createLeafletLayer (options) {
|
|
333
|
+
const name = options.name
|
|
334
334
|
const leafletOptions = options.leaflet || options
|
|
335
|
-
// Manage panes to make z-index work for all types of layers
|
|
335
|
+
// Manage panes to make z-index work for all types of layers.
|
|
336
336
|
// Indeed, although DOM-based layers can use setZIndex() to manage rendering order
|
|
337
|
-
// SVG/Canvas-based layers provide no mean to manage render order except using bringToFront() or bringToBack()
|
|
337
|
+
// SVG/Canvas-based layers provide no mean to manage render order except using bringToFront() or bringToBack().
|
|
338
338
|
// This is why Leaflet 1.0 introduced panes: https://leafletjs.com/reference.html#map-pane & https://leafletjs.com/examples/map-panes/
|
|
339
|
-
// By implicitely create a pane for each provided z-index makes this transparent for the user
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
339
|
+
// By implicitely create a pane for each provided z-index makes this transparent for the user.
|
|
340
|
+
const layerPane = { name }
|
|
341
|
+
const hasMinZoom = !!_.get(leafletOptions, 'minZoom')
|
|
342
|
+
const hasMaxZoom = !!_.get(leafletOptions, 'maxZoom')
|
|
343
|
+
const hasZIndex = !!_.get(leafletOptions, 'zIndex')
|
|
344
|
+
if (hasMinZoom) layerPane.minZoom = _.get(leafletOptions, 'minZoom')
|
|
345
|
+
if (hasMaxZoom) layerPane.maxZoom = _.get(leafletOptions, 'maxZoom')
|
|
346
|
+
if (hasZIndex) layerPane.zIndex = _.get(leafletOptions, 'zIndex')
|
|
347
|
+
if (hasZIndex) {
|
|
348
|
+
this.createLeafletPane(layerPane)
|
|
349
|
+
// Set layer to use its default pane as target
|
|
350
|
+
// Avoid erasing any existing pane, if so the pane should have been created taken into account the layer zIndex up-front
|
|
351
|
+
if (!_.has(leafletOptions, 'pane')) _.set(leafletOptions, 'pane', layerPane.name)
|
|
348
352
|
}
|
|
349
353
|
// Different panes inside a layer can be used to manage visibility according to zoom level
|
|
350
|
-
const panes = _.get(leafletOptions, 'panes')
|
|
354
|
+
const panes = _.get(leafletOptions, 'panes', [])
|
|
351
355
|
if (panes) {
|
|
352
356
|
panes.forEach(paneOptions => {
|
|
353
357
|
const pane = this.createLeafletPane(paneOptions)
|
|
354
358
|
Object.assign(pane, paneOptions)
|
|
355
359
|
})
|
|
356
|
-
this.updateLeafletPanesVisibility()
|
|
357
360
|
}
|
|
361
|
+
this.updateLeafletPanesVisibility()
|
|
358
362
|
|
|
359
363
|
// Some Leaflet constructors can have additional arguments given as options
|
|
360
364
|
let args = _.get(leafletOptions, 'options', [])
|
|
@@ -402,7 +406,14 @@ export const baseMap = {
|
|
|
402
406
|
_.set(timeDimension, 'period', 'P1D')
|
|
403
407
|
const timeRange = _.get(timeDimension, 'times')
|
|
404
408
|
const timeRangeComponents = (typeof timeRange === 'string' ? timeRange.split('/') : [])
|
|
405
|
-
|
|
409
|
+
const timeList = (typeof timeRange === 'string' ? timeRange.split(',') : [])
|
|
410
|
+
let times = [] // Time list as moment objects to ease search
|
|
411
|
+
if (!_.isEmpty(timeList)) {
|
|
412
|
+
// In this case there is no period as time list should be ISO
|
|
413
|
+
_.unset(timeDimension, 'period')
|
|
414
|
+
// Convert to moment objects
|
|
415
|
+
times = _.sortBy(timeList.map(time => moment.utc(time)), (time) => time.valueOf())
|
|
416
|
+
} else if (timeRangeComponents.length === 2) {
|
|
406
417
|
_.set(timeDimension, 'times', `${timeRange}/P1D`)
|
|
407
418
|
} else if (timeRangeComponents.length === 3) {
|
|
408
419
|
_.set(timeDimension, 'period', timeRangeComponents[2])
|
|
@@ -417,16 +428,30 @@ export const baseMap = {
|
|
|
417
428
|
currentTime: Time.getCurrentTime().toDate().getTime()
|
|
418
429
|
})
|
|
419
430
|
// This allow the layer to conform our internal time interface
|
|
420
|
-
layer.setCurrentTime = (datetime) => {
|
|
431
|
+
layer.setCurrentTime = (datetime) => {
|
|
432
|
+
layer._timeDimension.setCurrentTime(datetime.toDate().getTime())
|
|
433
|
+
}
|
|
421
434
|
// Default implementation always generate ISO datetime that might break some servers with eg day period only
|
|
422
435
|
layer._createLayerForTime = (time) => {
|
|
436
|
+
time = moment.utc(time)
|
|
423
437
|
// Remove some internals to avoid polluting request
|
|
424
438
|
const wmsParams = _.omit(layer._baseLayer.options, ['timeDimension', 'isVisible', 'type'])
|
|
425
439
|
// Format time according to period
|
|
426
|
-
if (periodAsDuration.years() > 0)
|
|
427
|
-
|
|
428
|
-
else if (periodAsDuration.
|
|
429
|
-
|
|
440
|
+
if (periodAsDuration.years() > 0) {
|
|
441
|
+
wmsParams.time = time.format('YYYY').toISOString()
|
|
442
|
+
} else if (periodAsDuration.months() > 0) {
|
|
443
|
+
wmsParams.time = time.format('YYYY-MM')
|
|
444
|
+
} else if (periodAsDuration.days() > 0) {
|
|
445
|
+
wmsParams.time = time.format('YYYY-MM-DD')
|
|
446
|
+
} else if (!_.isEmpty(times)) {
|
|
447
|
+
// Find nearest available time, as we keep the list ordered it could use a faster algorithm in utility function
|
|
448
|
+
const { index, difference } = getNearestTime(time, times, true)
|
|
449
|
+
// Keep original time format in any case it is not ISO
|
|
450
|
+
if (index >= 0) wmsParams.time = timeList[index]
|
|
451
|
+
else wmsParams.time = time.toISOString()
|
|
452
|
+
} else {
|
|
453
|
+
wmsParams.time = time.toISOString()
|
|
454
|
+
}
|
|
430
455
|
// Some Leaflet constructors can have additional arguments given as options
|
|
431
456
|
let args = _.get(leafletOptions, 'options', [])
|
|
432
457
|
// Can be an array or a single object for a single additonnal argument
|
|
@@ -506,8 +531,6 @@ export const baseMap = {
|
|
|
506
531
|
this.map.addLayer(leafletLayer)
|
|
507
532
|
layer.isVisible = true
|
|
508
533
|
|
|
509
|
-
// Ensure base layer will not pop on top of others
|
|
510
|
-
if (layer.type === 'BaseLayer') leafletLayer.bringToBack()
|
|
511
534
|
// Apply the current time if needed
|
|
512
535
|
if (typeof leafletLayer.setCurrentTime === 'function') leafletLayer.setCurrentTime(Time.getCurrentTime())
|
|
513
536
|
this.onLayerShown(layer, leafletLayer)
|
|
@@ -551,15 +574,17 @@ export const baseMap = {
|
|
|
551
574
|
this.$emit('layer-added', layer)
|
|
552
575
|
this.$engineEvents.emit('layer-added', layer)
|
|
553
576
|
},
|
|
554
|
-
async addGeoJsonLayer (layerSpec, geoJson) {
|
|
577
|
+
async addGeoJsonLayer (layerSpec, geoJson, zoom = true) {
|
|
555
578
|
if (!generateLayerDefinition(layerSpec, geoJson)) return
|
|
556
579
|
// Create an empty layer used as a container
|
|
557
580
|
await this.addLayer(layerSpec)
|
|
558
581
|
// Set the content
|
|
559
582
|
await this.updateLayer(layerSpec.name, geoJson)
|
|
560
|
-
// Zoom to
|
|
561
|
-
if (
|
|
562
|
-
|
|
583
|
+
// Zoom to the layer
|
|
584
|
+
if (zoom) {
|
|
585
|
+
if (geoJson.bbox) this.zoomToBBox(geoJson.bbox)
|
|
586
|
+
else this.zoomToLayer(layerSpec.name)
|
|
587
|
+
}
|
|
563
588
|
},
|
|
564
589
|
renameLayer (previousName, newName) {
|
|
565
590
|
const layer = this.getLayerByName(previousName)
|
|
@@ -637,41 +662,98 @@ export const baseMap = {
|
|
|
637
662
|
zoomToBBox (bbox) {
|
|
638
663
|
this.zoomToBounds([[bbox[1], bbox[0]], [bbox[3], bbox[2]]])
|
|
639
664
|
},
|
|
665
|
+
bringLayerToFront (name) {
|
|
666
|
+
let leafletLayer = this.getLeafletLayerByName(name)
|
|
667
|
+
if (!leafletLayer) return
|
|
668
|
+
// If panes are declared on this layer push it front to make it on top of others should be sufficient.
|
|
669
|
+
const panes = _.get(leafletLayer, 'options.panes')
|
|
670
|
+
if (panes) {
|
|
671
|
+
panes.forEach(paneOptions => {
|
|
672
|
+
const pane = this.getLeafletPaneByName(this.getLeafletPaneName(paneOptions))
|
|
673
|
+
if (pane) L.DomUtil.toFront(pane)
|
|
674
|
+
})
|
|
675
|
+
return
|
|
676
|
+
}
|
|
677
|
+
// Handle case where there's clustering on top (cf. updateLayer)
|
|
678
|
+
if (leafletLayer instanceof L.MarkerClusterGroup) {
|
|
679
|
+
const container = leafletLayer
|
|
680
|
+
leafletLayer = leafletLayer.getLayers().find(layer => layer._container === container)
|
|
681
|
+
}
|
|
682
|
+
if (leafletLayer && (typeof leafletLayer.bringToFront === 'function')) leafletLayer.bringToFront()
|
|
683
|
+
},
|
|
684
|
+
bringLayerToBack (name) {
|
|
685
|
+
let leafletLayer = this.getLeafletLayerByName(name)
|
|
686
|
+
if (!leafletLayer) return
|
|
687
|
+
// If panes are declared on this layer push it back to make it under others should be sufficient.
|
|
688
|
+
const panes = _.get(leafletLayer, 'options.panes')
|
|
689
|
+
if (panes) {
|
|
690
|
+
panes.forEach(paneOptions => {
|
|
691
|
+
const pane = this.getLeafletPaneByName(this.getLeafletPaneName(paneOptions))
|
|
692
|
+
if (pane) L.DomUtil.toBack(pane)
|
|
693
|
+
})
|
|
694
|
+
return
|
|
695
|
+
}
|
|
696
|
+
// Handle case where there's clustering on top (cf. updateLayer)
|
|
697
|
+
if (leafletLayer instanceof L.MarkerClusterGroup) {
|
|
698
|
+
const container = leafletLayer
|
|
699
|
+
leafletLayer = leafletLayer.getLayers().find(layer => layer._container === container)
|
|
700
|
+
}
|
|
701
|
+
if (leafletLayer && (typeof leafletLayer.bringToBack === 'function')) leafletLayer.bringToBack()
|
|
702
|
+
},
|
|
640
703
|
animateCenter (timestamp) {
|
|
704
|
+
// Note: as this callback is called frequently by the animation system
|
|
705
|
+
// we don't use lodash utility functions like _.get/_.set to improve performances
|
|
706
|
+
|
|
641
707
|
// Initialize animation time origin
|
|
642
708
|
if (!this.centerAnimation.startTime) this.centerAnimation.startTime = timestamp
|
|
643
|
-
const { id, duration, startTime,
|
|
709
|
+
const { id, duration, startTime, fps,
|
|
644
710
|
animate: { center, zoom, bearing },
|
|
645
711
|
startLongitude, endLatitude, startLatitude, startZoom, startBearing,
|
|
646
712
|
endLongitude, endZoom, endBearing } = this.centerAnimation
|
|
647
|
-
const
|
|
648
|
-
|
|
713
|
+
const elapsedSinceStart = timestamp - startTime
|
|
714
|
+
// If we target a specific frame rate check if we need to update or not
|
|
715
|
+
if (fps && this.centerAnimation.lastTime) {
|
|
716
|
+
const elapsedSinceLastFrame = timestamp - this.centerAnimation.lastTime
|
|
717
|
+
const fpsInterval = 1000 / fps
|
|
718
|
+
if (elapsedSinceLastFrame < fpsInterval) {
|
|
719
|
+
this.centerAnimation.id = requestAnimationFrame(this.animateCenter)
|
|
720
|
+
// For debug purpose only, avoid flooding the browser
|
|
721
|
+
//logger.debug('[KDK] Skipping center animation frame')
|
|
722
|
+
return
|
|
723
|
+
} else {
|
|
724
|
+
// For debug purpose only, avoid flooding the browser
|
|
725
|
+
//logger.debug('[KDK] Drawing center animation frame')
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
// Else animate if animation not yet finished
|
|
729
|
+
const percent = Math.abs(elapsedSinceStart / (1000 * duration))
|
|
649
730
|
let percentCenter, percentZoom, percentBearing
|
|
650
731
|
if (percent <= 1) {
|
|
651
732
|
const currentCenter = this.getCenter()
|
|
652
733
|
if (center) {
|
|
653
|
-
const easingCenterFunction =
|
|
654
|
-
const easingCenterParameters =
|
|
734
|
+
const easingCenterFunction = center.easing.function
|
|
735
|
+
const easingCenterParameters = center.easing.parameters || []
|
|
655
736
|
percentCenter = maths[easingCenterFunction](percent, ...easingCenterParameters)
|
|
656
737
|
}
|
|
657
738
|
if (zoom) {
|
|
658
|
-
const easingZoomFunction =
|
|
659
|
-
const easingZoomParameters =
|
|
739
|
+
const easingZoomFunction = zoom.easing.function
|
|
740
|
+
const easingZoomParameters = zoom.easing.parameters || []
|
|
660
741
|
percentZoom = maths[easingZoomFunction](percent, ...easingZoomParameters)
|
|
661
742
|
}
|
|
662
743
|
if (bearing) {
|
|
663
|
-
const easingBearingFunction =
|
|
664
|
-
const easingBearingParameters =
|
|
744
|
+
const easingBearingFunction = bearing.easing.function
|
|
745
|
+
const easingBearingParameters = bearing.easing.parameters || []
|
|
665
746
|
percentBearing = maths[easingBearingFunction](percent, ...easingBearingParameters)
|
|
666
747
|
}
|
|
667
|
-
const
|
|
668
|
-
const
|
|
748
|
+
const offset = this.centerAnimation.offset
|
|
749
|
+
const dx = (center && offset ? percentCenter * offset.x || 0 : 0)
|
|
750
|
+
const dy = (center && offset ? percentCenter * offset.y || 0 : 0)
|
|
669
751
|
let dLongitude = currentCenter.longitude, dLatitude = currentCenter.latitude
|
|
670
752
|
if (center) {
|
|
671
753
|
if (center.rhumb) {
|
|
672
754
|
const destination = rhumbDestination(this.centerAnimation.rhumbStart, percentCenter * this.centerAnimation.rhumbDistance, this.centerAnimation.rhumbBearing)
|
|
673
|
-
dLongitude =
|
|
674
|
-
dLatitude =
|
|
755
|
+
dLongitude = destination.geometry.coordinates[0]
|
|
756
|
+
dLatitude = destination.geometry.coordinates[1]
|
|
675
757
|
} else {
|
|
676
758
|
dLongitude = startLongitude + percentCenter * (endLongitude - startLongitude)
|
|
677
759
|
dLatitude = startLatitude + percentCenter * (endLatitude - startLatitude)
|
|
@@ -686,7 +768,8 @@ export const baseMap = {
|
|
|
686
768
|
// Then normalize the final result to be between 0 and 360
|
|
687
769
|
dBearing = (bearing ? (startBearing + percentBearing * bearingDifference + 360) % 360 : null)
|
|
688
770
|
}
|
|
689
|
-
this.center(dLongitude, dLatitude, dZoom, dBearing, { offset: { x: Math.round(dx), y: Math.round(dy) } })
|
|
771
|
+
this.center(dLongitude, dLatitude, dZoom, dBearing, { offset: { x: Math.round(dx), y: Math.round(dy) }, bearingTolerance: this.centerAnimation.bearingTolerance })
|
|
772
|
+
this.centerAnimation.lastTime = timestamp
|
|
690
773
|
this.centerAnimation.id = requestAnimationFrame(this.animateCenter)
|
|
691
774
|
} else {
|
|
692
775
|
this.centerAnimation.id = null
|
|
@@ -698,14 +781,15 @@ export const baseMap = {
|
|
|
698
781
|
if (_.isNil(bearing)) bearing = this.map.getBearing()
|
|
699
782
|
// Keep bearing positive, required for interpolation to work correctly
|
|
700
783
|
if (bearing < 0) bearing += 360
|
|
701
|
-
|
|
702
784
|
const duration = _.get(options, 'duration', 0)
|
|
703
785
|
if (duration) {
|
|
786
|
+
// For debug purpose only, avoid flooding the browser
|
|
787
|
+
//logger.debug('Calling center() with', longitude, latitude, options)
|
|
704
788
|
_.defaultsDeep(options, {
|
|
705
789
|
animate: {
|
|
706
|
-
center: { easing: { function: '
|
|
707
|
-
zoom: { easing: { function: '
|
|
708
|
-
bearing: { easing: { function: '
|
|
790
|
+
center: { easing: { function: 'linear' }, rhumb: false },
|
|
791
|
+
zoom: { easing: { function: 'linear' } },
|
|
792
|
+
bearing: { easing: { function: 'linear' } }
|
|
709
793
|
}
|
|
710
794
|
})
|
|
711
795
|
// Leaflet rotate does not manage animation so that we cannot rely on Leaflet built-in animation
|
|
@@ -729,13 +813,13 @@ export const baseMap = {
|
|
|
729
813
|
}
|
|
730
814
|
if (typeof this.map.getBearing === 'function') {
|
|
731
815
|
Object.assign(this.centerAnimation, {
|
|
732
|
-
startBearing: this.getBearing(),
|
|
816
|
+
startBearing: this.map.getBearing(),
|
|
733
817
|
endBearing: bearing
|
|
734
818
|
})
|
|
735
819
|
}
|
|
736
820
|
} else {
|
|
737
|
-
if (typeof this.map.
|
|
738
|
-
this.setBearing(bearing,
|
|
821
|
+
if (typeof this.map.setBearing === 'function') {
|
|
822
|
+
this.setBearing(bearing, options)
|
|
739
823
|
}
|
|
740
824
|
this.map.setView(new L.LatLng(latitude, longitude), zoomLevel, { animate: false, duration: 0 })
|
|
741
825
|
this.map.panBy(offset, { animate: false, duration: 0 })
|
|
@@ -756,7 +840,11 @@ export const baseMap = {
|
|
|
756
840
|
return
|
|
757
841
|
}
|
|
758
842
|
const offset = L.point(_.get(options, 'offset.x', 0), _.get(options, 'offset.y', 0))
|
|
759
|
-
|
|
843
|
+
// As rotating is costly by default we don't really rotate unless the human eye is able to perceive it
|
|
844
|
+
const tolerance = _.get(options, 'bearingTolerance', 0.1)
|
|
845
|
+
if (Math.abs(this.map.getBearing() - bearing) >= tolerance) {
|
|
846
|
+
this.map.setBearing(bearing, offset)
|
|
847
|
+
}
|
|
760
848
|
},
|
|
761
849
|
getBearing () {
|
|
762
850
|
if (typeof this.map.getBearing !== 'function') {
|
|
@@ -843,15 +931,15 @@ export const baseMap = {
|
|
|
843
931
|
// Register support for WMS-T
|
|
844
932
|
this.registerLeafletConstructor(this.createLeafletTimedWmsLayer)
|
|
845
933
|
// Internal event bus
|
|
846
|
-
this.$engineEvents = new
|
|
934
|
+
this.$engineEvents = new EventBus()
|
|
847
935
|
this.$engineEvents.on('zoomend', this.onMapZoomChanged)
|
|
848
|
-
|
|
936
|
+
Events.on('time-current-time-changed', this.onCurrentMapTimeChanged)
|
|
849
937
|
},
|
|
850
938
|
beforeUnmount () {
|
|
851
939
|
this.clearLayers()
|
|
852
940
|
L.DomEvent.off(this.map._container, TouchEvents.join(' '), this.onTouchEvent, this)
|
|
853
941
|
this.$engineEvents.off('zoomend', this.onMapZoomChanged)
|
|
854
|
-
|
|
942
|
+
Events.off('time-current-time-changed', this.onCurrentMapTimeChanged)
|
|
855
943
|
},
|
|
856
944
|
unmounted () {
|
|
857
945
|
if (this.map) {
|
|
@@ -5,8 +5,9 @@ import { getType, getCoords, getGeom } from '@turf/invariant'
|
|
|
5
5
|
import { uid } from 'quasar'
|
|
6
6
|
import { Store } from '../../../../core/client/store.js'
|
|
7
7
|
import { Units } from '../../../../core/client/units.js'
|
|
8
|
+
import { api } from '../../../../core/client/api.js'
|
|
8
9
|
import {
|
|
9
|
-
bindLeafletEvents, unbindLeafletEvents,
|
|
10
|
+
getGeoJsonFeatures, bindLeafletEvents, unbindLeafletEvents,
|
|
10
11
|
getDefaultPointStyle, getDefaultLineStyle, getDefaultPolygonStyle, createMarkerFromPointStyle,
|
|
11
12
|
convertSimpleStyleToPointStyle, convertSimpleStyleToLineStyle, convertSimpleStyleToPolygonStyle,
|
|
12
13
|
formatUserCoordinates, getFeatureId, listenToFeaturesServiceEventsForLayer, unlistenToFeaturesServiceEventsForLayer
|
|
@@ -46,7 +47,7 @@ export const editLayers = {
|
|
|
46
47
|
if (this.editedPopup) this.editedFeature.bindPopup(this.editedPopup)
|
|
47
48
|
// Update feature after edition from DB or memory
|
|
48
49
|
const service = (this.editedLayer._id ? _.get(this.editedLayer, 'service', 'features') : 'features-edition')
|
|
49
|
-
const feature = await
|
|
50
|
+
const feature = await api.getService(service).get(this.editedFeature.feature._id)
|
|
50
51
|
this.editableLayer.removeLayer(this.editedFeature)
|
|
51
52
|
this.editableLayer.addData(feature)
|
|
52
53
|
this.editedPopup = null
|
|
@@ -56,7 +57,9 @@ export const editLayers = {
|
|
|
56
57
|
},
|
|
57
58
|
methods: {
|
|
58
59
|
isLayerEdited (layer) {
|
|
59
|
-
|
|
60
|
+
if (!this.editedLayer) return false
|
|
61
|
+
if (this.editedLayer._id && layer._id) return (this.editedLayer._id === layer._id)
|
|
62
|
+
else return (this.editedLayer.name === layer.name)
|
|
60
63
|
},
|
|
61
64
|
getGeoJsonEditOptions (options, geometryTypes) {
|
|
62
65
|
let filteredOptions = options
|
|
@@ -87,20 +90,20 @@ export const editLayers = {
|
|
|
87
90
|
if (isLine) {
|
|
88
91
|
// Skip line editing style if not editing lines
|
|
89
92
|
if (!_.isEmpty(geometryTypes) && !geometryTypes.includes('LineString') && !geometryTypes.includes('MultiLineString')) return style(feature)
|
|
90
|
-
else return getDefaultLineStyle(feature, layerStyle,
|
|
93
|
+
else return getDefaultLineStyle(feature, layerStyle, _.get(this, 'activityOptions.engine.style.edition.line'))
|
|
91
94
|
}
|
|
92
95
|
const isPolygon = ((feature.geometry.type === 'Polygon') || (feature.geometry.type === 'MultiPolygon'))
|
|
93
96
|
if (isPolygon) {
|
|
94
97
|
// Skip polygon editing style if not editing polygons
|
|
95
98
|
if (!_.isEmpty(geometryTypes) && !geometryTypes.includes('Polygon') && !geometryTypes.includes('MultiPolygon')) return style(feature)
|
|
96
|
-
else return getDefaultPolygonStyle(feature, layerStyle, _.get(this, 'activityOptions.engine
|
|
99
|
+
else return getDefaultPolygonStyle(feature, layerStyle, _.get(this, 'activityOptions.engine.style.edition.polygon'))
|
|
97
100
|
}
|
|
98
101
|
logger.warn(`[KDK] the geometry of type of ${feature.geometry.type} is not supported`)
|
|
99
102
|
},
|
|
100
103
|
pointToLayer: (feature, latlng) => {
|
|
101
104
|
// Skip point editing style if not editing points
|
|
102
105
|
if (!_.isEmpty(geometryTypes) && !geometryTypes.includes('Point') && !geometryTypes.includes('MultiPoint')) return pointToLayer(feature, layer)
|
|
103
|
-
const style = getDefaultPointStyle(feature, layerStyle, _.get(this, 'activityOptions.engine
|
|
106
|
+
const style = getDefaultPointStyle(feature, layerStyle, _.get(this, 'activityOptions.engine.style.edition.point'))
|
|
104
107
|
style.options = { pmIgnore: false } // Allow geoman edition
|
|
105
108
|
return createMarkerFromPointStyle(latlng, style)
|
|
106
109
|
}
|
|
@@ -194,7 +197,7 @@ export const editLayers = {
|
|
|
194
197
|
// Move source layers to edition layers, required as eg clusters are not supported
|
|
195
198
|
// and also to manage partial edition of large datasets
|
|
196
199
|
const geoJson = leafletLayer.toGeoJSON()
|
|
197
|
-
let editedFeatures = geoJson
|
|
200
|
+
let editedFeatures = getGeoJsonFeatures(geoJson)
|
|
198
201
|
if (_.isEmpty(features) && _.isEmpty(geometryTypes)) {
|
|
199
202
|
leafletLayer.clearLayers()
|
|
200
203
|
} else if (!_.isEmpty(features)) {
|
|
@@ -218,7 +221,7 @@ export const editLayers = {
|
|
|
218
221
|
// Generate in memory service _id as string to match what's done with mongo
|
|
219
222
|
feature._id = uid().toString()
|
|
220
223
|
// Service will use the provided _id as object key
|
|
221
|
-
await
|
|
224
|
+
await api.getService('features-edition').create(feature)
|
|
222
225
|
}
|
|
223
226
|
} else {
|
|
224
227
|
// Listen to layer changes
|
|
@@ -290,8 +293,8 @@ export const editLayers = {
|
|
|
290
293
|
// for in memory edition, clear service
|
|
291
294
|
if (this.editedLayer._id === undefined) {
|
|
292
295
|
const geoJson = this.editableLayer.toGeoJSON()
|
|
293
|
-
const features = geoJson
|
|
294
|
-
const service =
|
|
296
|
+
const features = getGeoJsonFeatures(geoJson)
|
|
297
|
+
const service = api.getService('features-edition')
|
|
295
298
|
await Promise.all(features.map((f) => service.remove(f._id)))
|
|
296
299
|
} else {
|
|
297
300
|
// Clear listeners to layer changes
|
|
@@ -424,7 +427,7 @@ export const editLayers = {
|
|
|
424
427
|
// Generate in memory service _id as string to match what's done with mongo
|
|
425
428
|
geoJson._id = idValue
|
|
426
429
|
// Service will use the provided _id as object key
|
|
427
|
-
await
|
|
430
|
+
await api.getService('features-edition').create(geoJson)
|
|
428
431
|
}
|
|
429
432
|
this.editableLayer.removeLayer(leafletLayer)
|
|
430
433
|
this.editableLayer.addData(geoJson)
|
|
@@ -443,8 +446,8 @@ export const editLayers = {
|
|
|
443
446
|
if (this.editedLayer._id) {
|
|
444
447
|
await this.editFeaturesGeometry(geoJson, this.editedLayer)
|
|
445
448
|
} else {
|
|
446
|
-
const features = geoJson
|
|
447
|
-
const service =
|
|
449
|
+
const features = getGeoJsonFeatures(geoJson)
|
|
450
|
+
const service = api.getService('features-edition')
|
|
448
451
|
// Remember those operations because we need to make sure we wait for completion
|
|
449
452
|
// before clearing the in memory edition service in stopEditLayer
|
|
450
453
|
const operations = Promise.all(features.map((f) => service.patch(f._id, { geometry: f.geometry })))
|
|
@@ -471,8 +474,8 @@ export const editLayers = {
|
|
|
471
474
|
if (this.editedLayer._id) {
|
|
472
475
|
await this.removeFeatures(geoJson, this.editedLayer)
|
|
473
476
|
} else {
|
|
474
|
-
const features = geoJson
|
|
475
|
-
const service =
|
|
477
|
+
const features = getGeoJsonFeatures(geoJson)
|
|
478
|
+
const service = api.getService('features-edition')
|
|
476
479
|
await Promise.all(features.map((f) => service.remove(f._id)))
|
|
477
480
|
}
|
|
478
481
|
},
|