@kalisio/kdk 2.5.2 → 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 +5 -5
- 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/api/services/styles/styles.hooks.js +1 -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 +10 -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 +8 -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/KLevelSlider.vue +10 -8
- 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 +72 -9
- package/map/client/components/styles/KStyleEditorSection.vue +82 -33
- package/map/client/components/styles/KStyleManager.vue +126 -60
- 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/composables/highlight.js +5 -1
- package/map/client/globe.js +2 -0
- package/map/client/i18n/map_en.json +33 -8
- package/map/client/i18n/map_fr.json +33 -8
- 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 +190 -36
- 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 +203 -48
- 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 -26
- 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/push.test.js +1 -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 -955
- 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 -955
- 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 -532
- 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 -520
- 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 -199
- 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 -307
- 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 -461
- 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 -955
- 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 -955
- 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 -532
- 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 -520
- 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 -199
- 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 -307
- 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 -461
- package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +0 -463
- 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 -1309
- 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 -127
- package/coverage/lcov-report/map/api/models/features.model.mongodb.js.html +0 -196
- package/coverage/lcov-report/map/api/models/index.html +0 -161
- package/coverage/lcov-report/map/api/models/projects.model.mongodb.js.html +0 -109
- 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 -313
- 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 -946
- 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/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 -124
- 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 -10392
- package/coverage/map/api/hooks/hooks.catalog.js.html +0 -463
- package/coverage/map/api/hooks/hooks.features.js.html +0 -397
- package/coverage/map/api/hooks/hooks.query.js.html +0 -1309
- 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 -127
- package/coverage/map/api/models/features.model.mongodb.js.html +0 -196
- package/coverage/map/api/models/index.html +0 -161
- package/coverage/map/api/models/projects.model.mongodb.js.html +0 -109
- 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 -313
- 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 -946
- 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/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 -124
- 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-122123-1739872365211-0.json +0 -1
- package/coverage/tmp/coverage-122135-1739872365196-0.json +0 -1
- package/coverage/tmp/coverage-122146-1739872365184-0.json +0 -1
- package/coverage/tmp/coverage-122158-1739872365169-0.json +0 -1
- package/coverage/tmp/coverage-122165-1739872365141-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-05-26.log +0 -22
- package/test/api/map/test-log-2025-05-26.log +0 -12
- 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
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
import _ from 'lodash'
|
|
51
51
|
import logger from 'loglevel'
|
|
52
52
|
import { ref, computed, watch } from 'vue'
|
|
53
|
-
import {
|
|
53
|
+
import { i18n } from '../../../../core/client'
|
|
54
54
|
import { getLayersBySublegend } from '../../utils'
|
|
55
|
-
import { useCurrentActivity
|
|
55
|
+
import { useCurrentActivity } from '../../composables'
|
|
56
56
|
import KLayerLegend from './KLayerLegend.vue'
|
|
57
57
|
|
|
58
58
|
// Props
|
|
@@ -86,24 +86,13 @@ const props = defineProps({
|
|
|
86
86
|
}
|
|
87
87
|
})
|
|
88
88
|
|
|
89
|
-
// Get current project for activity if any
|
|
90
|
-
const { getActivityProject } = useCurrentActivity({ selection: false, probe: false })
|
|
91
|
-
const project = getActivityProject()
|
|
92
|
-
// We expect the project object to expose the underlying API
|
|
93
|
-
const planetApi = project && typeof project.getPlanetApi === 'function' ? project.getPlanetApi() : api
|
|
94
|
-
// Use target catalog according to project
|
|
95
|
-
const { getSublegends: getProjectSublegends } = useCatalog({ project, planetApi })
|
|
96
|
-
// Use global catalog
|
|
97
|
-
const { getSublegends } = useCatalog({ context: 'global' })
|
|
98
|
-
// Use local catalog if any
|
|
99
|
-
const { getSublegends: getContextSublegends } = useCatalog({ context: Store.get('context') })
|
|
100
|
-
|
|
101
89
|
// Data
|
|
102
90
|
const { CurrentActivity } = useCurrentActivity({ selection: false, probe: false })
|
|
103
91
|
const sublegends = ref([])
|
|
104
92
|
const layers = ref([])
|
|
105
93
|
const engine = ref()
|
|
106
94
|
const zoom = ref()
|
|
95
|
+
const requestRefresh = _.debounce(refresh, 300)
|
|
107
96
|
|
|
108
97
|
// Computed
|
|
109
98
|
const layersBySublegend = computed(() => getLayersBySublegend(layers.value, sublegends.value))
|
|
@@ -112,17 +101,13 @@ const layersBySublegend = computed(() => getLayersBySublegend(layers.value, subl
|
|
|
112
101
|
watch([() => props.sublegends, () => props.sublegendsFromCatalog], async () => {
|
|
113
102
|
// Retrieve the legends from catalog if required
|
|
114
103
|
if (props.sublegendsFromCatalog) {
|
|
115
|
-
sublegends.value = await
|
|
116
|
-
if (project) {
|
|
117
|
-
sublegends.value = _.uniqBy(_.concat(sublegends.value, await getProjectSublegends()), 'name')
|
|
118
|
-
}
|
|
119
|
-
if (Store.get('context')) {
|
|
120
|
-
sublegends.value = _.uniqBy(_.concat(sublegends.value, await getContextSublegends()), 'name')
|
|
121
|
-
}
|
|
104
|
+
sublegends.value = await CurrentActivity.value.getCatalogSublegends()
|
|
122
105
|
} else {
|
|
123
106
|
sublegends.value = []
|
|
124
107
|
}
|
|
125
|
-
sublegends.value = _.uniqBy(_.concat(sublegends.value, props.sublegends), 'name')
|
|
108
|
+
sublegends.value = _.orderBy(_.uniqBy(_.concat(sublegends.value, props.sublegends), 'name'), sublegend => {
|
|
109
|
+
return _.get(sublegend, 'order', 50)
|
|
110
|
+
})
|
|
126
111
|
// register legend translations
|
|
127
112
|
_.forEach(sublegends.value, legend => {
|
|
128
113
|
if (legend.i18n) i18n.registerTranslation(legend.i18n)
|
|
@@ -131,9 +116,10 @@ watch([() => props.sublegends, () => props.sublegendsFromCatalog], async () => {
|
|
|
131
116
|
watch(CurrentActivity, (newActivity, oldActivity) => {
|
|
132
117
|
if (oldActivity) {
|
|
133
118
|
// remove listeners
|
|
134
|
-
oldActivity.value.$engineEvents.off('zoomend',
|
|
135
|
-
oldActivity.value.$engineEvents.off('layer-shown',
|
|
136
|
-
oldActivity.value.$engineEvents.off('layer-hidden',
|
|
119
|
+
oldActivity.value.$engineEvents.off('zoomend', requestRefresh)
|
|
120
|
+
oldActivity.value.$engineEvents.off('layer-shown', requestRefresh)
|
|
121
|
+
oldActivity.value.$engineEvents.off('layer-hidden', requestRefresh)
|
|
122
|
+
oldActivity.value.$engineEvents.off('layer-filter-toggled', requestRefresh)
|
|
137
123
|
// clear legend
|
|
138
124
|
sublegends.value = []
|
|
139
125
|
layers.value = []
|
|
@@ -144,38 +130,45 @@ watch(CurrentActivity, (newActivity, oldActivity) => {
|
|
|
144
130
|
// setup legend
|
|
145
131
|
engine.value = newActivity.engine
|
|
146
132
|
zoom.value = newActivity.getCenter().zoomLevel
|
|
147
|
-
|
|
148
|
-
if (newActivity.isLayerVisible(layer.name)) {
|
|
149
|
-
onShowLayer(layer)
|
|
150
|
-
}
|
|
151
|
-
})
|
|
133
|
+
refresh()
|
|
152
134
|
// install listeners
|
|
153
|
-
newActivity.$engineEvents.on('layer-
|
|
154
|
-
newActivity.$engineEvents.on('layer-
|
|
155
|
-
newActivity.$engineEvents.on('
|
|
135
|
+
newActivity.$engineEvents.on('layer-filter-toggled', requestRefresh)
|
|
136
|
+
newActivity.$engineEvents.on('layer-shown', requestRefresh)
|
|
137
|
+
newActivity.$engineEvents.on('layer-hidden', requestRefresh)
|
|
138
|
+
newActivity.$engineEvents.on('zoomend', requestRefresh)
|
|
156
139
|
}
|
|
157
140
|
}, { immediate: true })
|
|
158
141
|
|
|
159
142
|
// Functions
|
|
160
|
-
function
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
// Check wehther the legend is already registered for that layer
|
|
165
|
-
if (_.find(layers.value, { name: layer.name })) {
|
|
166
|
-
logger.warn(`[KDK] Legend for ${layer.name} already resgistered`)
|
|
167
|
-
return
|
|
168
|
-
}
|
|
169
|
-
logger.debug(`[KDK] Register '${layer.name}' legend`)
|
|
170
|
-
layers.value.push(layer)
|
|
171
|
-
}
|
|
172
|
-
function onHideLayer (layer) {
|
|
173
|
-
if (!layer.legend) return
|
|
174
|
-
logger.debug(`[KDK] Unregister '${layer.name}' legend`)
|
|
175
|
-
_.remove(layers.value, { name: layer.name })
|
|
176
|
-
}
|
|
177
|
-
function onZoomChanged () {
|
|
143
|
+
function refresh () {
|
|
144
|
+
if (!CurrentActivity.value) return
|
|
145
|
+
logger.debug('[KDK] Refreshing legend')
|
|
146
|
+
// set the current zoom
|
|
178
147
|
zoom.value = CurrentActivity.value.getCenter().zoomLevel
|
|
148
|
+
// set the layers for which it is required to display a legend
|
|
149
|
+
const iterator = {
|
|
150
|
+
layers: [],
|
|
151
|
+
groups: []
|
|
152
|
+
}
|
|
153
|
+
_.reduce(CurrentActivity.value.getLayers(), (iterator, layer) => {
|
|
154
|
+
const isVisible = layer.isVisible
|
|
155
|
+
const hasLegend = layer.legend
|
|
156
|
+
const hasFilterLegend = _.some(layer.filters, filter => filter.legend)
|
|
157
|
+
if (isVisible && (hasLegend || hasFilterLegend)) {
|
|
158
|
+
if (!hasLegend) iterator.layers.push(layer)
|
|
159
|
+
else if (!layer.legend.group) iterator.layers.push(layer)
|
|
160
|
+
else {
|
|
161
|
+
const group = layer.legend.group
|
|
162
|
+
if (!_.includes(iterator.groups, group)) {
|
|
163
|
+
iterator.layers.push(layer)
|
|
164
|
+
iterator.groups.push(group)
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return iterator
|
|
169
|
+
}, iterator)
|
|
170
|
+
// order the layers according the name
|
|
171
|
+
layers.value = _.orderBy(iterator.layers, layer => layer.label || layer.name)
|
|
179
172
|
}
|
|
180
173
|
function getHelperIcon (helper) {
|
|
181
174
|
return _.get(helper, 'icon', undefined)
|
|
@@ -28,13 +28,12 @@
|
|
|
28
28
|
self="top left"
|
|
29
29
|
/>
|
|
30
30
|
</div>
|
|
31
|
-
<div v-else style="height: 142px">
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</div>
|
|
31
|
+
<div v-else style="height: 142px; position: relative;">
|
|
32
|
+
<KStamp
|
|
33
|
+
icon="las la-map-marker"
|
|
34
|
+
text="KLocationCardSection.NO_LOCATION"
|
|
35
|
+
class="absolute-center"
|
|
36
|
+
/>
|
|
38
37
|
</div>
|
|
39
38
|
</KCardSection>
|
|
40
39
|
</template>
|
|
@@ -20,6 +20,7 @@ import config from 'config'
|
|
|
20
20
|
import centroid from '@turf/centroid'
|
|
21
21
|
import { KPanel } from '../../../../core/client/components'
|
|
22
22
|
import { api } from '../../../../core/client/api.js'
|
|
23
|
+
import { Store } from '../../../../core/client/store.js'
|
|
23
24
|
import * as mapMixins from '../../mixins/map'
|
|
24
25
|
import { Geolocation } from '../../geolocation.js'
|
|
25
26
|
import { useCatalog, useCurrentActivity } from '../../composables'
|
|
@@ -162,16 +163,19 @@ export default {
|
|
|
162
163
|
}
|
|
163
164
|
// update the location
|
|
164
165
|
this.location = this.modelValue
|
|
166
|
+
// check wether it holds some features
|
|
165
167
|
if (!this.location) return
|
|
168
|
+
const featureType = this.location.type
|
|
169
|
+
if (featureType === 'FeatureCollection' && _.isEmpty(this.location.features)) return
|
|
166
170
|
// backward compatibility with old format with only lat/lon or a geometry, not a feature
|
|
167
|
-
if (
|
|
171
|
+
if (featureType !== 'Feature' && featureType !== 'FeatureCollection') {
|
|
168
172
|
const feature = { type: 'Feature', geometry: this.location, properties: { name: this.location.name } }
|
|
169
173
|
if (!_.has(feature, 'geometry.type')) feature.geometry = { type: 'Point', coordinates: [this.location.longitude, this.location.latitude] }
|
|
170
174
|
this.location = feature
|
|
171
175
|
}
|
|
172
176
|
// create a new layer
|
|
173
|
-
const
|
|
174
|
-
if (
|
|
177
|
+
const geometryType = _.get(this.location, 'geometry.type')
|
|
178
|
+
if (geometryType === 'Point') {
|
|
175
179
|
const coordinates = _.get(this.location, 'geometry.coordinates')
|
|
176
180
|
const style = _.get(this.location, 'style', _.get(this.engineOptions, 'style.location.point'))
|
|
177
181
|
this.locationLayer = createMarkerFromPointStyle([coordinates[1], coordinates[0]],
|
|
@@ -186,11 +190,11 @@ export default {
|
|
|
186
190
|
logger.warn(`[KDK] cannot get a style type from the feature of geometry type ${feature.geometry.type}`)
|
|
187
191
|
return
|
|
188
192
|
}
|
|
189
|
-
if (styleType === 'line') return getDefaultLineStyle(feature, null, this.engineOptions, 'style.location.line')
|
|
190
|
-
return getDefaultPolygonStyle(feature, null, this.engineOptions, 'style.location.polygon')
|
|
193
|
+
if (styleType === 'line') return getDefaultLineStyle(feature, null, _.get(this.engineOptions, 'style.location.line'))
|
|
194
|
+
return getDefaultPolygonStyle(feature, null, _.get(this.engineOptions, 'style.location.polygon'))
|
|
191
195
|
},
|
|
192
196
|
pointToLayer: (feature, latlng) => {
|
|
193
|
-
const style = getDefaultPointStyle(feature, null, this.engineOptions, 'style.location.point')
|
|
197
|
+
const style = getDefaultPointStyle(feature, null, _.get(this.engineOptions, 'style.location.point'))
|
|
194
198
|
if (!style) {
|
|
195
199
|
logger.warn('[KDK] cannot generate point style from a feature')
|
|
196
200
|
return
|
|
@@ -204,7 +208,7 @@ export default {
|
|
|
204
208
|
},
|
|
205
209
|
onLocationDragged () {
|
|
206
210
|
const latLng = this.locationLayer.getLatLng()
|
|
207
|
-
const newLocation = coordinatesToGeoJSON(latLng.lat, latLng.lng,
|
|
211
|
+
const newLocation = coordinatesToGeoJSON(latLng.lat, latLng.lng, Store.get('locationFormat', 'FFf'))
|
|
208
212
|
this.$emit('update:modelValue', newLocation)
|
|
209
213
|
},
|
|
210
214
|
startDraw (shape) {
|
|
@@ -232,11 +236,11 @@ export default {
|
|
|
232
236
|
const geometry = feature.geometry.type
|
|
233
237
|
if (geometry === 'Point') {
|
|
234
238
|
const coords = feature.geometry.coordinates
|
|
235
|
-
feature.properties.name = formatUserCoordinates(coords[1], coords[0],
|
|
239
|
+
feature.properties.name = formatUserCoordinates(coords[1], coords[0], Store.get('locationFormat', 'FFf'))
|
|
236
240
|
} else {
|
|
237
241
|
const prefix = this.$t(geometry === 'Polygon' ? 'KLocationMap.ZONE' : 'KLocationMap.PATH')
|
|
238
242
|
const coords = _.get(centroid(feature), 'geometry.coordinates')
|
|
239
|
-
feature.properties.name = `${prefix} (${formatUserCoordinates(coords[1], coords[0],
|
|
243
|
+
feature.properties.name = `${prefix} (${formatUserCoordinates(coords[1], coords[0], Store.get('locationFormat', 'FFf'))})`
|
|
240
244
|
}
|
|
241
245
|
this.$emit('update:modelValue', feature)
|
|
242
246
|
// clear draw layer
|
|
@@ -249,23 +253,29 @@ export default {
|
|
|
249
253
|
async mapRefCreated (container) {
|
|
250
254
|
if (container) {
|
|
251
255
|
if (!this.mapReady) {
|
|
252
|
-
// setup map
|
|
256
|
+
// setup the map
|
|
253
257
|
logger.debug('[KDK] Create location map with viewer options', this.engineOptions.viewer)
|
|
254
258
|
this.setupMap(container, this.engineOptions.viewer)
|
|
255
259
|
this.mapReady = true
|
|
256
260
|
// setup base layer
|
|
257
261
|
const baseLayers = await this.getLayers({ type: 'BaseLayer' })
|
|
258
|
-
|
|
262
|
+
// [!] remember Vue won’t wait for async: use mapReady as a guard to
|
|
263
|
+
// prevent executing the process after the component is destroyed
|
|
264
|
+
// https://github.com/kalisio/kdk/issues/1291
|
|
265
|
+
if (this.mapReady && baseLayers.length > 0) await this.addLayer(baseLayers[0])
|
|
259
266
|
// setup location
|
|
260
|
-
this.refresh()
|
|
267
|
+
if (this.mapReady) this.refresh()
|
|
261
268
|
}
|
|
269
|
+
} else {
|
|
270
|
+
// keep trace when the component is being unmounted
|
|
271
|
+
this.mapReady = false
|
|
262
272
|
}
|
|
263
273
|
},
|
|
264
274
|
getLocation () {
|
|
265
275
|
return this.modelValue
|
|
266
276
|
}
|
|
267
277
|
},
|
|
268
|
-
|
|
278
|
+
mounted () {
|
|
269
279
|
this.$engineEvents.on('pm:create', this.stopDraw)
|
|
270
280
|
},
|
|
271
281
|
beforeUnmount () {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
class="text-caption text-grey-9"
|
|
33
33
|
style="writing-mode: vertical-lr; min-width: 1rem;"
|
|
34
34
|
>
|
|
35
|
-
{{ $t(label) }} - {{ getFormattedLevel(
|
|
35
|
+
{{ $t(label) }} - {{ getFormattedLevel(level) }}
|
|
36
36
|
</div>
|
|
37
37
|
</div>
|
|
38
38
|
</div>
|
|
@@ -68,6 +68,10 @@ const levels = computed(() => {
|
|
|
68
68
|
const selectableLevels = _.get(CurrentActivity.value, 'selectableLevels')
|
|
69
69
|
return !_.isEmpty(selectableLevels) ? selectableLevels : null
|
|
70
70
|
})
|
|
71
|
+
const unit = computed(() => {
|
|
72
|
+
const selectableLevels = _.get(CurrentActivity.value, 'selectableLevels')
|
|
73
|
+
return !_.isEmpty(selectableLevels) ? selectableLevels.unit : ''
|
|
74
|
+
})
|
|
71
75
|
const label = computed(() => {
|
|
72
76
|
return _.get(levels.value, 'label')
|
|
73
77
|
})
|
|
@@ -85,10 +89,9 @@ const sliderStep = computed(() => {
|
|
|
85
89
|
})
|
|
86
90
|
|
|
87
91
|
// Watch
|
|
88
|
-
watch(() => CurrentActivity.value.
|
|
89
|
-
if (levels.values) level.value =
|
|
90
|
-
else
|
|
91
|
-
else level.value = 0
|
|
92
|
+
watch(() => CurrentActivity.value.selectedLevel, (selectedLevel) => {
|
|
93
|
+
if (levels.value && levels.value.values) level.value = levels.value.values.indexOf(selectedLevel)
|
|
94
|
+
else level.value = selectedLevel
|
|
92
95
|
})
|
|
93
96
|
|
|
94
97
|
// Functions
|
|
@@ -100,9 +103,8 @@ function onLevelChanged (level) {
|
|
|
100
103
|
}
|
|
101
104
|
}
|
|
102
105
|
function getFormattedLevel (level) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return `${level} ${unit}`
|
|
106
|
+
if (levels.value.values) return `${levels.value.values[level]} ${unit.value}`
|
|
107
|
+
return `${level} ${unit.value}`
|
|
106
108
|
}
|
|
107
109
|
</script>
|
|
108
110
|
|
|
@@ -15,16 +15,20 @@
|
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<script setup>
|
|
18
|
+
import _ from 'lodash'
|
|
18
19
|
import { computed, onMounted, ref } from 'vue'
|
|
19
20
|
import { api } from '../../../../core/client'
|
|
20
21
|
import { useCurrentActivity } from '../../composables'
|
|
21
|
-
import { editLayerStyle } from '../../utils.map'
|
|
22
|
+
import { editLayerStyle, editFilterStyle } from '../../utils.map'
|
|
23
|
+
import { getStyleType } from '../../utils/utils.style.js'
|
|
24
|
+
import KSubMenu from '../../../../core/client/components/menu/KSubMenu.vue'
|
|
22
25
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
// Props
|
|
27
|
+
const props = defineProps({
|
|
28
|
+
context: {
|
|
29
|
+
type: Object,
|
|
30
|
+
required: true
|
|
31
|
+
},
|
|
28
32
|
label: {
|
|
29
33
|
type: String,
|
|
30
34
|
required: true
|
|
@@ -32,27 +36,70 @@ defineProps({
|
|
|
32
36
|
icon: {
|
|
33
37
|
type: String,
|
|
34
38
|
required: false
|
|
39
|
+
},
|
|
40
|
+
ignoreFeatureStyle: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
44
|
+
maxItems: {
|
|
45
|
+
type: Number,
|
|
46
|
+
default: 250
|
|
47
|
+
},
|
|
48
|
+
filteringPolicy: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: 'none',
|
|
51
|
+
validator: (value) => {
|
|
52
|
+
return ['none', 'permissive', 'strict'].includes(value)
|
|
53
|
+
}
|
|
35
54
|
}
|
|
36
55
|
})
|
|
37
56
|
|
|
57
|
+
// Data
|
|
58
|
+
const { CurrentActivity } = useCurrentActivity()
|
|
59
|
+
const styles = ref([])
|
|
60
|
+
|
|
61
|
+
// Computed
|
|
38
62
|
const menuContent = computed(() => {
|
|
39
63
|
if (styles.value.length <= 0) return []
|
|
40
64
|
return styles.value.map((style, i) => ({
|
|
41
65
|
id: 'apply-style-to-layer-' + i,
|
|
42
66
|
label: style.name,
|
|
43
|
-
handler: (
|
|
67
|
+
handler: () => applyToLayer(style)
|
|
44
68
|
}))
|
|
45
69
|
})
|
|
46
70
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
71
|
+
// Functions
|
|
72
|
+
async function applyToLayer (styleToApply) {
|
|
73
|
+
const layer = props.context
|
|
74
|
+
if (_.get(layer, 'filter')) {
|
|
75
|
+
const engineStyle = _.pick(_.get(CurrentActivity.value, 'activityOptions.engine.style', {}), ['point', 'line', 'polygon'])
|
|
76
|
+
await editFilterStyle(layer.layer, layer.filter, engineStyle, styleToApply, props.ignoreFeatureStyle)
|
|
77
|
+
} else {
|
|
78
|
+
await editLayerStyle(layer, styleToApply, props.ignoreFeatureStyle)
|
|
79
|
+
if (CurrentActivity.value.isInMemoryLayer(layer)) {
|
|
80
|
+
await CurrentActivity.value.resetLayer(layer)
|
|
81
|
+
}
|
|
51
82
|
}
|
|
52
83
|
}
|
|
84
|
+
async function getFilterQuery () {
|
|
85
|
+
const layer = _.has(props.context, 'layer') ? props.context.layer : props.context
|
|
86
|
+
let filterQuery = {}
|
|
87
|
+
if (!['permissive', 'strict'].includes(props.filteringPolicy) || !_.has(layer, 'geometryTypes')) return filterQuery
|
|
88
|
+
|
|
89
|
+
const styleTypes = _.uniq(_.map(layer.geometryTypes, type => getStyleType(type)))
|
|
90
|
+
if (props.filteringPolicy === 'strict') {
|
|
91
|
+
filterQuery = { $and: ['point', 'line', 'polygon'].map(type => ({ [type]: { $exists: styleTypes.includes(type) } })) }
|
|
92
|
+
} else {
|
|
93
|
+
filterQuery = { $or: styleTypes.map(type => ({ [type]: { $exists: true } })) }
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return filterQuery
|
|
97
|
+
}
|
|
53
98
|
|
|
54
99
|
onMounted(async () => {
|
|
55
|
-
const
|
|
100
|
+
const baseQuery = { $limit: props.maxItems, $sort: { name: 1 } }
|
|
101
|
+
const filterQuery = await getFilterQuery()
|
|
102
|
+
const res = await api.getService('styles').find({ query: Object.assign({}, baseQuery, filterQuery) })
|
|
56
103
|
styles.value = res.data
|
|
57
104
|
})
|
|
58
105
|
</script>
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
-->
|
|
27
27
|
<KStyleEditorSection
|
|
28
28
|
v-if="canEditPoint"
|
|
29
|
+
v-model="enabledSections.point"
|
|
29
30
|
label="KStyleEditor.POINT_SECTION"
|
|
30
31
|
:style="model"
|
|
31
32
|
type="point"
|
|
@@ -55,6 +56,7 @@
|
|
|
55
56
|
-->
|
|
56
57
|
<KStyleEditorSection
|
|
57
58
|
v-if="canEditLine"
|
|
59
|
+
v-model="enabledSections.line"
|
|
58
60
|
label="KStyleEditor.LINE_SECTION"
|
|
59
61
|
:style="model"
|
|
60
62
|
type="line"
|
|
@@ -70,6 +72,7 @@
|
|
|
70
72
|
-->
|
|
71
73
|
<KStyleEditorSection
|
|
72
74
|
v-if="canEditPolygon"
|
|
75
|
+
v-model="enabledSections.polygon"
|
|
73
76
|
label="KStyleEditor.POLYGON_SECTION"
|
|
74
77
|
:style="model"
|
|
75
78
|
type="polygon"
|
|
@@ -105,7 +108,10 @@ import _ from 'lodash'
|
|
|
105
108
|
import config from 'config'
|
|
106
109
|
import logger from 'loglevel'
|
|
107
110
|
import { ref, computed, watch } from 'vue'
|
|
108
|
-
import {
|
|
111
|
+
import { Notify } from 'quasar'
|
|
112
|
+
import { i18n } from '../../../../core/client/i18n.js'
|
|
113
|
+
import { api } from '../../../../core/client/api.js'
|
|
114
|
+
import { containsText } from '../../../../core/client/utils/index.js'
|
|
109
115
|
import { useCurrentActivity } from '../../composables'
|
|
110
116
|
import KPanel from '../../../../core/client/components/KPanel.vue'
|
|
111
117
|
import KStyleEditorSection from './KStyleEditorSection.vue'
|
|
@@ -149,6 +155,11 @@ const { CurrentActivityContext } = useCurrentActivity()
|
|
|
149
155
|
const formRef = ref(null)
|
|
150
156
|
const model = ref(null)
|
|
151
157
|
const mode = props.style ? 'edition' : 'creation'
|
|
158
|
+
const enabledSections = ref({ point: true, line: true, polygon: true })
|
|
159
|
+
const formValues = {
|
|
160
|
+
name: _.get(props.style, 'name', ''),
|
|
161
|
+
tags: _.get(props.style, 'tags', [])
|
|
162
|
+
}
|
|
152
163
|
const formSchema = {
|
|
153
164
|
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
154
165
|
$id: 'http://kalisio.xyz/schemas/style-editor#',
|
|
@@ -162,16 +173,35 @@ const formSchema = {
|
|
|
162
173
|
component: 'form/KTextField',
|
|
163
174
|
label: 'KStyleEditor.NAME_LABEL'
|
|
164
175
|
}
|
|
176
|
+
},
|
|
177
|
+
tags: {
|
|
178
|
+
type: 'array',
|
|
179
|
+
minLength: 3,
|
|
180
|
+
maxLength: 256,
|
|
181
|
+
services: [
|
|
182
|
+
{
|
|
183
|
+
service: 'tags',
|
|
184
|
+
field: 'name',
|
|
185
|
+
description: 'label',
|
|
186
|
+
baseQuery: {
|
|
187
|
+
service: 'styles'
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
field: {
|
|
192
|
+
component: 'form/KTagField',
|
|
193
|
+
label: 'KTagManager.TITLE',
|
|
194
|
+
service: 'styles',
|
|
195
|
+
property: 'tags'
|
|
196
|
+
},
|
|
197
|
+
multiselect: true,
|
|
198
|
+
minCharsToSearch: 0
|
|
165
199
|
}
|
|
166
200
|
},
|
|
167
201
|
required: ['name']
|
|
168
202
|
}
|
|
169
203
|
|
|
170
204
|
// Computed
|
|
171
|
-
const formValues = computed(() => {
|
|
172
|
-
if (_.isEmpty(props.style)) return null
|
|
173
|
-
return { name: _.get(props.style, 'name') }
|
|
174
|
-
})
|
|
175
205
|
const engine = computed(() => {
|
|
176
206
|
return _.cloneDeep(_.get(CurrentActivityContext.config, 'engine', _.get(config, 'engines.leaflet')))
|
|
177
207
|
})
|
|
@@ -212,7 +242,7 @@ const buttons = computed(() => {
|
|
|
212
242
|
},
|
|
213
243
|
{
|
|
214
244
|
id: 'apply-style',
|
|
215
|
-
label: '
|
|
245
|
+
label: mode === 'creation' ? 'CREATE' : 'UPDATE',
|
|
216
246
|
renderer: 'form-button',
|
|
217
247
|
handler: apply
|
|
218
248
|
}
|
|
@@ -224,8 +254,17 @@ const canEditPolygon = computed(() => props.allowedTypes.includes('polygon'))
|
|
|
224
254
|
|
|
225
255
|
// Watch
|
|
226
256
|
watch(() => props.style, (value) => {
|
|
227
|
-
|
|
257
|
+
const onFirstLoad = model.value === null
|
|
258
|
+
|
|
259
|
+
if (!value) model.value = _.clone(_.pick(engine.value.style, ['point', 'line', 'polygon']))
|
|
228
260
|
else model.value = value
|
|
261
|
+
|
|
262
|
+
_.forEach(['point', 'line', 'polygon'], section => {
|
|
263
|
+
if (!_.get(model.value, section)) {
|
|
264
|
+
if (onFirstLoad) enabledSections.value[section] = false
|
|
265
|
+
_.set(model.value, section, getDefaultValue(section))
|
|
266
|
+
}
|
|
267
|
+
})
|
|
229
268
|
}, { immediate: true })
|
|
230
269
|
|
|
231
270
|
// Functions
|
|
@@ -233,12 +272,13 @@ function getDefaultValue (path) {
|
|
|
233
272
|
return _.get(engine.value.style, path, _.cloneDeep(_.get(DefaultStyle, path)))
|
|
234
273
|
}
|
|
235
274
|
const onNameChanged = _.debounce(async (field, value) => {
|
|
275
|
+
if (field !== 'name' || !value) return
|
|
236
276
|
if (_.size(value) > 2) await checkName(value)
|
|
237
277
|
}, 200)
|
|
238
278
|
async function checkName (name) {
|
|
239
279
|
if (mode === 'edition' && name === props.style.name) return true
|
|
240
280
|
const service = api.getService('styles')
|
|
241
|
-
const hasName = await
|
|
281
|
+
const hasName = await containsText(service, 'name', name)
|
|
242
282
|
if (!hasName || !formRef.value) return true
|
|
243
283
|
formRef.value.getField('name').reference.invalidate(i18n.t('KStyleEditor.STYLE_ALREADY_EXISTS', { style: name }))
|
|
244
284
|
return false
|
|
@@ -251,7 +291,30 @@ async function apply () {
|
|
|
251
291
|
const isUnique = await checkName(values.name)
|
|
252
292
|
if (!isUnique) return false
|
|
253
293
|
// create to patch the style
|
|
254
|
-
let data =
|
|
294
|
+
let data = Object.assign({}, model.value, values)
|
|
295
|
+
// omit disabled feature types
|
|
296
|
+
const omitKeys = []
|
|
297
|
+
let atLeastOneSectionEnabled = false
|
|
298
|
+
_.forIn(enabledSections.value, (value, key) => {
|
|
299
|
+
if (!value) {
|
|
300
|
+
omitKeys.push(key)
|
|
301
|
+
if (mode !== 'creation') {
|
|
302
|
+
_.set(data, `$unset.${key}`, true)
|
|
303
|
+
}
|
|
304
|
+
} else {
|
|
305
|
+
atLeastOneSectionEnabled = true
|
|
306
|
+
}
|
|
307
|
+
})
|
|
308
|
+
if (!atLeastOneSectionEnabled) {
|
|
309
|
+
Notify.create({
|
|
310
|
+
type: 'negative',
|
|
311
|
+
message: i18n.t('KStyleEditor.ALL_SECTIONS_DISABLED')
|
|
312
|
+
})
|
|
313
|
+
return false
|
|
314
|
+
}
|
|
315
|
+
data = _.omit(data, omitKeys)
|
|
316
|
+
// keep only usefull data from tags
|
|
317
|
+
data.tags = _.map(values.tags, tag => _.pick(tag, ['name', 'description', 'color']))
|
|
255
318
|
if (mode === 'creation') {
|
|
256
319
|
data = _.merge(data, { type: 'style', scope: 'user' })
|
|
257
320
|
logger.debug('[KDK] Create style with values:', data)
|