@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
|
@@ -155,9 +155,7 @@ describe('map:grid-source', () => {
|
|
|
155
155
|
describe('geotiff', () => {
|
|
156
156
|
const geotiffOptions = {
|
|
157
157
|
geotiff: {
|
|
158
|
-
url: 'http://kMap.test/data.tif'
|
|
159
|
-
// because nock doesnt know howto intercept fecth
|
|
160
|
-
forceXHR: true
|
|
158
|
+
url: 'http://kMap.test/data.tif'
|
|
161
159
|
}
|
|
162
160
|
}
|
|
163
161
|
|
|
@@ -18,7 +18,7 @@ describe('map:services', () => {
|
|
|
18
18
|
let app, server, port, // baseUrl,
|
|
19
19
|
userService, userObject, catalogService, defaultLayers,
|
|
20
20
|
zones, zonesService, vigicruesStationsService, nbStations, vigicruesObsService,
|
|
21
|
-
adsbObsService, items, eventListeners, eventCount, eventData
|
|
21
|
+
adsbObsService, openradiationService, items, eventListeners, eventCount, eventData
|
|
22
22
|
|
|
23
23
|
function eventsOn (service) {
|
|
24
24
|
eventListeners = {}
|
|
@@ -617,6 +617,64 @@ describe('map:services', () => {
|
|
|
617
617
|
// Let enough time to process
|
|
618
618
|
.timeout(10000)
|
|
619
619
|
|
|
620
|
+
it('create and feed the openradiation service', async () => {
|
|
621
|
+
// Create the service
|
|
622
|
+
const openradiationLayer = _.find(defaultLayers, { name: 'openradiation' })
|
|
623
|
+
expect(openradiationLayer).toExist()
|
|
624
|
+
expect(openradiationLayer.service === 'openradiation').beTrue()
|
|
625
|
+
await createFeaturesService.call(app, {
|
|
626
|
+
collection: openradiationLayer.service,
|
|
627
|
+
featureId: openradiationLayer.featureId,
|
|
628
|
+
featureLabel: openradiationLayer.featureLabel,
|
|
629
|
+
variables: openradiationLayer.variables,
|
|
630
|
+
// Raise simplified events
|
|
631
|
+
skipEvents: ['updated'],
|
|
632
|
+
simplifyEvents: ['created', 'patched', 'removed']
|
|
633
|
+
})
|
|
634
|
+
openradiationService = app.getService(openradiationLayer.service)
|
|
635
|
+
expect(openradiationService).toExist()
|
|
636
|
+
// Feed the collection
|
|
637
|
+
const observations = fs.readJsonSync(path.join(__dirname, 'data/openradiation.json'))
|
|
638
|
+
await openradiationService.create(observations)
|
|
639
|
+
})
|
|
640
|
+
// Let enough time to process
|
|
641
|
+
.timeout(5000)
|
|
642
|
+
|
|
643
|
+
it('performs geometry and value aggregation on openradiation service, similar to gradient path query', async () => {
|
|
644
|
+
const aggregationQuery = {
|
|
645
|
+
'properties.userId': 'Yann29',
|
|
646
|
+
time: {
|
|
647
|
+
$gte: new Date('2025-05-24T12:00:00.00Z').toISOString(),
|
|
648
|
+
$lte: new Date('2025-05-24T18:15:00.00Z').toISOString()
|
|
649
|
+
},
|
|
650
|
+
$groupBy: 'apparatusId',
|
|
651
|
+
$aggregate: ['geometry', 'value'],
|
|
652
|
+
$sort: { time: 1 }
|
|
653
|
+
}
|
|
654
|
+
// Aggregation requires feature ID index to be built so we add some time to do so
|
|
655
|
+
await utility.promisify(setTimeout)(5000)
|
|
656
|
+
const result = await openradiationService.find({ query: Object.assign({}, aggregationQuery) })
|
|
657
|
+
expect(result.features.length).to.equal(1)
|
|
658
|
+
result.features.forEach(feature => {
|
|
659
|
+
expect(feature.time).toExist()
|
|
660
|
+
expect(feature.time.geometry).toExist()
|
|
661
|
+
expect(feature.time.geometry.length).to.equal(82)
|
|
662
|
+
expect(feature.time.geometry[0].isBefore(feature.time.geometry[1])).beTrue()
|
|
663
|
+
expect(feature.time.value).toExist()
|
|
664
|
+
expect(feature.time.value.length).to.equal(82)
|
|
665
|
+
expect(feature.time.value[0].isBefore(feature.time.value[1])).beTrue()
|
|
666
|
+
expect(feature.time.value[0].isSame(feature.time.geometry[0])).beTrue()
|
|
667
|
+
expect(feature.geometry.type).to.equal('GeometryCollection')
|
|
668
|
+
expect(feature.geometry.geometries).toExist()
|
|
669
|
+
expect(feature.geometry.geometries.length).to.equal(82)
|
|
670
|
+
expect(feature.properties).toExist()
|
|
671
|
+
expect(feature.properties.value).toExist()
|
|
672
|
+
expect(feature.properties.value.length).to.equal(82)
|
|
673
|
+
})
|
|
674
|
+
})
|
|
675
|
+
// Let enough time to process
|
|
676
|
+
.timeout(10000)
|
|
677
|
+
|
|
620
678
|
it('clears the layers', async () => {
|
|
621
679
|
for (let i = 0; i < defaultLayers.length; ++i) {
|
|
622
680
|
await catalogService.remove(defaultLayers[i]._id)
|
|
@@ -641,6 +699,7 @@ describe('map:services', () => {
|
|
|
641
699
|
await vigicruesStationsService.Model.drop()
|
|
642
700
|
await vigicruesObsService.Model.drop()
|
|
643
701
|
await adsbObsService.Model.drop()
|
|
702
|
+
await openradiationService.Model.drop()
|
|
644
703
|
await catalogService.Model.drop()
|
|
645
704
|
await userService.Model.drop()
|
|
646
705
|
await app.db.disconnect()
|
|
@@ -6,7 +6,7 @@ import map, { hooks } from '../../../map/api/index.js'
|
|
|
6
6
|
const { util, expect } = chai
|
|
7
7
|
|
|
8
8
|
describe('map:styles', () => {
|
|
9
|
-
let app, server, port, usersService, stylesService
|
|
9
|
+
let app, server, port, usersService, stylesService, tagsService
|
|
10
10
|
|
|
11
11
|
before(async () => {
|
|
12
12
|
chailint(chai, util)
|
|
@@ -22,6 +22,8 @@ describe('map:styles', () => {
|
|
|
22
22
|
await app.configure(core)
|
|
23
23
|
usersService = app.getService('users')
|
|
24
24
|
expect(usersService).toExist()
|
|
25
|
+
tagsService = app.getService('tags')
|
|
26
|
+
expect(tagsService).toExist()
|
|
25
27
|
await app.configure(map)
|
|
26
28
|
stylesService = app.getService('styles')
|
|
27
29
|
expect(stylesService).toExist()
|
|
@@ -53,6 +55,33 @@ describe('map:styles', () => {
|
|
|
53
55
|
})
|
|
54
56
|
.timeout(10000)
|
|
55
57
|
|
|
58
|
+
it('create and update tag', async () => {
|
|
59
|
+
const tag = await tagsService.create({ service: 'styles', property: 'tags', name: 'emissary', description: 'My description', color: '#F05F40' })
|
|
60
|
+
const style = await stylesService.create({ name: 'style2', tags: [{ name: 'emissary', description: 'My description', color: '#F05F40' }] })
|
|
61
|
+
const response = await stylesService.find({ query: { name: 'style2' } })
|
|
62
|
+
expect(response.data.length > 0).beTrue()
|
|
63
|
+
expect(response.data[0]._id.toString()).to.equal(style._id.toString())
|
|
64
|
+
expect(response.data[0].tags.length).to.equal(1)
|
|
65
|
+
expect(response.data[0].tags[0].name).to.equal('emissary')
|
|
66
|
+
|
|
67
|
+
// Update tag
|
|
68
|
+
const updatedTag = await tagsService.patch(tag._id, { color: '#FF0000' })
|
|
69
|
+
expect(updatedTag.color).to.equal('#FF0000')
|
|
70
|
+
const updatedStyle = await stylesService.get(style._id)
|
|
71
|
+
expect(updatedStyle.tags.length).to.equal(1)
|
|
72
|
+
expect(updatedStyle.tags[0].color).to.equal('#FF0000')
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
it('delete tag', async () => {
|
|
76
|
+
const tag = await tagsService.find({ query: { name: 'emissary' } })
|
|
77
|
+
expect(tag.data.length > 0).beTrue()
|
|
78
|
+
const deletedTag = await tagsService.remove(tag.data[0]._id)
|
|
79
|
+
expect(deletedTag._id.toString()).to.equal(tag.data[0]._id.toString())
|
|
80
|
+
const style = await stylesService.find({ query: { name: 'style2' } })
|
|
81
|
+
expect(style.data.length > 0).beTrue()
|
|
82
|
+
expect(style.data[0].tags.length).to.equal(0)
|
|
83
|
+
})
|
|
84
|
+
|
|
56
85
|
// Cleanup
|
|
57
86
|
after(async () => {
|
|
58
87
|
if (server) await server.close()
|
package/test.api.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './test/
|
|
1
|
+
export * from './test/api/index.js'
|
package/vite/App.vue
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Suspense>
|
|
3
|
+
<!-- App content (2D) -->
|
|
4
|
+
<MapActivity style="width: 100%; height: 100%; position: fixed; left: 0;"/>
|
|
5
|
+
</Suspense>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script setup>
|
|
9
|
+
// For debug purpose with src hot reload
|
|
10
|
+
//import { kdkCore } from '../client.map.js'
|
|
11
|
+
// To test library build
|
|
12
|
+
import { kdkCore } from '../client/kdk.client.map.js'
|
|
13
|
+
import MapActivity from './MapActivity.vue'
|
|
14
|
+
|
|
15
|
+
let map, globe, updatingMap, updatingGlobe
|
|
16
|
+
|
|
17
|
+
kdkCore.composables.useSession()
|
|
18
|
+
</script>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div v-show="false" id="globe-credit"/>
|
|
4
|
+
<q-btn color="primary" class="fixed-top-left" style="z-index: 1" :label="synchronize ? 'UNSYNC VIEWS' : 'SYNC VIEWS'" @click="onSynchronize"/>
|
|
5
|
+
<Suspense>
|
|
6
|
+
<div>
|
|
7
|
+
<!-- App content (2D) -->
|
|
8
|
+
<MapActivity :ref="onMapCreated" @map-ready="onMapReady" style="width: 50%; height: 100%; position: fixed; left: 0;"/>
|
|
9
|
+
<!-- App content (3D) -->
|
|
10
|
+
<GlobeActivity :ref="onGlobeCreated" @globe-ready="onGlobeReady" style="width: 50%; height: 100%; position: fixed; right: 0;"/>
|
|
11
|
+
</div>
|
|
12
|
+
</Suspense>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup>
|
|
17
|
+
import { ref } from 'vue'
|
|
18
|
+
// For debug purpose with src hot reload
|
|
19
|
+
//import { kdkCore } from '../client.js'
|
|
20
|
+
// To test library build
|
|
21
|
+
import { kdkCore } from '../client/kdk.client.js'
|
|
22
|
+
import MapActivity from './MapActivityWithGlobe.vue'
|
|
23
|
+
import GlobeActivity from './GlobeActivity.vue'
|
|
24
|
+
|
|
25
|
+
let map, globe, updatingMap, updatingGlobe
|
|
26
|
+
const synchronize = ref(false)
|
|
27
|
+
|
|
28
|
+
kdkCore.composables.useSession()
|
|
29
|
+
|
|
30
|
+
function onSynchronize () {
|
|
31
|
+
synchronize.value = !synchronize.value
|
|
32
|
+
}
|
|
33
|
+
function onMapCreated (ref) {
|
|
34
|
+
if (ref && !map) {
|
|
35
|
+
map = ref
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function onGlobeCreated (ref) {
|
|
39
|
+
if (ref && !globe) {
|
|
40
|
+
globe = ref
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function onMapReady () {
|
|
44
|
+
map.$engineEvents.on('map-ready', () => {
|
|
45
|
+
map.map.on('moveend', updateGlobe)
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
function onGlobeReady () {
|
|
49
|
+
globe.$engineEvents.on('globe-ready', () => {
|
|
50
|
+
globe.viewer.camera.moveEnd.addEventListener(updateMap)
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
function updateGlobe() {
|
|
54
|
+
if (!synchronize.value || updatingMap) return
|
|
55
|
+
updatingMap = true
|
|
56
|
+
const center = map.getCenter()
|
|
57
|
+
globe.center(center.longitude, center.latitude, zoomLevelToAltitude(center.zoomLevel))
|
|
58
|
+
updatingMap = false
|
|
59
|
+
}
|
|
60
|
+
function updateMap() {
|
|
61
|
+
if (!synchronize.value || updatingGlobe) return
|
|
62
|
+
updatingGlobe = true
|
|
63
|
+
const center = globe.getCenter()
|
|
64
|
+
map.center(center.longitude, center.latitude, altitudeToZoomLevel(center.altitude))
|
|
65
|
+
updatingGlobe = false
|
|
66
|
+
}
|
|
67
|
+
// Empirical formula found on https://stackoverflow.com/questions/36544209/converting-altitude-to-z-level-and-vice-versa
|
|
68
|
+
function altitudeToZoomLevel(altitude) {
|
|
69
|
+
var A = 40487.57
|
|
70
|
+
var B = 0.00007096758
|
|
71
|
+
var C = 91610.74
|
|
72
|
+
var D = -40467.74
|
|
73
|
+
|
|
74
|
+
return D+(A-D)/(1+Math.pow(altitude/C, B))
|
|
75
|
+
}
|
|
76
|
+
function zoomLevelToAltitude(zoomLevel) {
|
|
77
|
+
var A = 40487.57
|
|
78
|
+
var B = 0.00007096758
|
|
79
|
+
var C = 91610.74
|
|
80
|
+
var D = -40467.74
|
|
81
|
+
|
|
82
|
+
return C * Math.pow((A-D)/(zoomLevel-D) -1, 1/B)
|
|
83
|
+
}
|
|
84
|
+
</script>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div id="globe" :ref="configureGlobe">
|
|
3
|
+
<q-resize-observer @resize="onGlobeResized" />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
// For debug purpose with src hot reload
|
|
9
|
+
//import { kdkCore, kdkMap } from '../client.globe.js'
|
|
10
|
+
// To test library build
|
|
11
|
+
import { kdkCore, kdkMap } from '../client/kdk.client.js'
|
|
12
|
+
|
|
13
|
+
const name = 'globeActivity'
|
|
14
|
+
const baseActivityMixin = kdkCore.mixins.baseActivity(name)
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
mixins: [
|
|
18
|
+
kdkMap.mixins.globe.baseGlobe,
|
|
19
|
+
kdkMap.mixins.globe.geojsonLayers,
|
|
20
|
+
kdkMap.mixins.globe.fileLayers,
|
|
21
|
+
kdkMap.mixins.globe.style,
|
|
22
|
+
kdkMap.mixins.globe.tooltip,
|
|
23
|
+
kdkMap.mixins.globe.popup,
|
|
24
|
+
kdkMap.mixins.globe.activity,
|
|
25
|
+
kdkMap.mixins.globe.opendapLayers,
|
|
26
|
+
baseActivityMixin,
|
|
27
|
+
kdkMap.mixins.activity,
|
|
28
|
+
kdkMap.mixins.style,
|
|
29
|
+
kdkMap.mixins.featureService,
|
|
30
|
+
kdkMap.mixins.infobox,
|
|
31
|
+
kdkMap.mixins.weacast,
|
|
32
|
+
kdkMap.mixins.context
|
|
33
|
+
],
|
|
34
|
+
methods: {
|
|
35
|
+
async configureGlobe (container) {
|
|
36
|
+
// Avoid reentrance during awaited operations
|
|
37
|
+
if (!container || this.globeContainer) return
|
|
38
|
+
this.globeContainer = container
|
|
39
|
+
// Not yet ready wait for capabilities to be there
|
|
40
|
+
if (!kdkCore.Store.get('capabilities.api')) return
|
|
41
|
+
const token = kdkCore.Store.get('capabilities.api.cesium.token')
|
|
42
|
+
// Wait until viewer is ready
|
|
43
|
+
await this.initializeGlobe(container, token)
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
created () {
|
|
47
|
+
this.setCurrentActivity(this)
|
|
48
|
+
},
|
|
49
|
+
async setup () {
|
|
50
|
+
const activity = kdkMap.composables.useActivity(name)
|
|
51
|
+
const expose = {
|
|
52
|
+
...activity,
|
|
53
|
+
...activity.CurrentActivityContext
|
|
54
|
+
}
|
|
55
|
+
return expose
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div id="map" :ref="configureMap">
|
|
3
|
+
<q-resize-observer @resize="onMapResized" />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
// For debug purpose with src hot reload
|
|
9
|
+
//import { kdkCore, kdkMap } from '../client.map.js'
|
|
10
|
+
// To test library build
|
|
11
|
+
import { kdkCore, kdkMap } from '../client/kdk.client.map.js'
|
|
12
|
+
|
|
13
|
+
const name = 'mapActivity'
|
|
14
|
+
const baseActivityMixin = kdkCore.mixins.baseActivity(name)
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
mixins: [
|
|
18
|
+
kdkMap.mixins.map.baseMap,
|
|
19
|
+
kdkMap.mixins.map.canvasLayers,
|
|
20
|
+
kdkMap.mixins.map.geojsonLayers,
|
|
21
|
+
kdkMap.mixins.map.heatmapLayers,
|
|
22
|
+
kdkMap.mixins.map.fileLayers,
|
|
23
|
+
kdkMap.mixins.map.editLayers,
|
|
24
|
+
kdkMap.mixins.map.style,
|
|
25
|
+
kdkMap.mixins.map.tooltip,
|
|
26
|
+
kdkMap.mixins.map.popup,
|
|
27
|
+
kdkMap.mixins.map.activity,
|
|
28
|
+
kdkMap.mixins.map.tiledMeshLayers,
|
|
29
|
+
kdkMap.mixins.map.tiledWindLayers,
|
|
30
|
+
kdkMap.mixins.map.mapillaryLayers,
|
|
31
|
+
kdkMap.mixins.map.gsmapLayers,
|
|
32
|
+
kdkMap.mixins.map.pmtilesLayers,
|
|
33
|
+
baseActivityMixin,
|
|
34
|
+
kdkMap.mixins.activity,
|
|
35
|
+
kdkMap.mixins.style,
|
|
36
|
+
kdkMap.mixins.featureService,
|
|
37
|
+
kdkMap.mixins.infobox,
|
|
38
|
+
kdkMap.mixins.weacast,
|
|
39
|
+
kdkMap.mixins.levels,
|
|
40
|
+
kdkMap.mixins.context
|
|
41
|
+
],
|
|
42
|
+
methods: {
|
|
43
|
+
async configureMap (container) {
|
|
44
|
+
// Avoid reentrance during awaited operations
|
|
45
|
+
if (!container || this.mapContainer) return
|
|
46
|
+
this.mapContainer = container
|
|
47
|
+
// Wait until map is ready
|
|
48
|
+
await this.initializeMap(container)
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
created () {
|
|
52
|
+
this.setCurrentActivity(this)
|
|
53
|
+
},
|
|
54
|
+
async setup () {
|
|
55
|
+
const activity = kdkMap.composables.useActivity(name)
|
|
56
|
+
const expose = {
|
|
57
|
+
...activity,
|
|
58
|
+
...activity.CurrentActivityContext
|
|
59
|
+
}
|
|
60
|
+
return expose
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
</script>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div id="map" :ref="configureMap">
|
|
3
|
+
<q-resize-observer @resize="onMapResized" />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
// For debug purpose with src hot reload
|
|
9
|
+
//import { kdkCore, kdkMap } from '../client.js'
|
|
10
|
+
// To test library build
|
|
11
|
+
import { kdkCore, kdkMap } from '../client/kdk.client.js'
|
|
12
|
+
|
|
13
|
+
const name = 'mapActivity'
|
|
14
|
+
const baseActivityMixin = kdkCore.mixins.baseActivity(name)
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
mixins: [
|
|
18
|
+
kdkMap.mixins.map.baseMap,
|
|
19
|
+
kdkMap.mixins.map.canvasLayers,
|
|
20
|
+
kdkMap.mixins.map.geojsonLayers,
|
|
21
|
+
kdkMap.mixins.map.heatmapLayers,
|
|
22
|
+
kdkMap.mixins.map.fileLayers,
|
|
23
|
+
kdkMap.mixins.map.editLayers,
|
|
24
|
+
kdkMap.mixins.map.style,
|
|
25
|
+
kdkMap.mixins.map.tooltip,
|
|
26
|
+
kdkMap.mixins.map.popup,
|
|
27
|
+
kdkMap.mixins.map.activity,
|
|
28
|
+
kdkMap.mixins.map.tiledMeshLayers,
|
|
29
|
+
kdkMap.mixins.map.tiledWindLayers,
|
|
30
|
+
kdkMap.mixins.map.mapillaryLayers,
|
|
31
|
+
kdkMap.mixins.map.gsmapLayers,
|
|
32
|
+
kdkMap.mixins.map.pmtilesLayers,
|
|
33
|
+
baseActivityMixin,
|
|
34
|
+
kdkMap.mixins.activity,
|
|
35
|
+
kdkMap.mixins.style,
|
|
36
|
+
kdkMap.mixins.featureService,
|
|
37
|
+
kdkMap.mixins.infobox,
|
|
38
|
+
kdkMap.mixins.weacast,
|
|
39
|
+
kdkMap.mixins.levels,
|
|
40
|
+
kdkMap.mixins.context
|
|
41
|
+
],
|
|
42
|
+
methods: {
|
|
43
|
+
async configureMap (container) {
|
|
44
|
+
// Avoid reentrance during awaited operations
|
|
45
|
+
if (!container || this.mapContainer) return
|
|
46
|
+
this.mapContainer = container
|
|
47
|
+
// Wait until map is ready
|
|
48
|
+
await this.initializeMap(container)
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
created () {
|
|
52
|
+
this.setCurrentActivity(this)
|
|
53
|
+
},
|
|
54
|
+
async setup () {
|
|
55
|
+
const activity = kdkMap.composables.useActivity(name)
|
|
56
|
+
const expose = {
|
|
57
|
+
...activity,
|
|
58
|
+
...activity.CurrentActivityContext
|
|
59
|
+
}
|
|
60
|
+
return expose
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
</script>
|
package/vite/README.md
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# Using KDK with Vite
|
|
2
|
+
|
|
3
|
+
This repository contains the Vite configuration required to:
|
|
4
|
+
* build the KDK client-side library,
|
|
5
|
+
* run application samples based on the KDK.
|
|
6
|
+
|
|
7
|
+
The objectives of such experiment is to be able to:
|
|
8
|
+
1. use the KDK outside our [skeleton](https://kalisio.github.io/skeleton/) in the most simple way (i.e. without configuring the Vue app too specifically),
|
|
9
|
+
2. use the KDK inside an application built with Vite instead of Webpack, which is now the main choice when building apps with Quasar.
|
|
10
|
+
|
|
11
|
+
> [!NOTE]
|
|
12
|
+
> First you need to install required dependencies:
|
|
13
|
+
```bash
|
|
14
|
+
cd vite
|
|
15
|
+
yarn install
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Library build
|
|
19
|
+
|
|
20
|
+
You can retrieve the library files in the KDK :open_file_folder: [client](../client) folder and put it into an external application, to avoid the burden of importing [Cesium](https://cesium.com/) in applications not requiring 3D capabilities the following files are available:
|
|
21
|
+
* 2D capabilities only - minified: `kdk.client.map.min.js`
|
|
22
|
+
* 2D/3D capabilities - minified: `kdk.client.min.js`
|
|
23
|
+
* 2D capabilities only - unminified, `kdk.client.map.js`
|
|
24
|
+
* 2D/3D capabilities - unminified: `kdk.client.js`
|
|
25
|
+
|
|
26
|
+
You can build the KDK client-side libraries like this:
|
|
27
|
+
```bash
|
|
28
|
+
// 2D/3D capabilities - minified/unminified + extras
|
|
29
|
+
yarn build:libs
|
|
30
|
+
// Copy extra files required for external apps like css, i18n, schemas, etc.
|
|
31
|
+
yarn build:libs:extras
|
|
32
|
+
// 2D capabilities only - minified
|
|
33
|
+
yarn build:lib
|
|
34
|
+
// 2D/3D capabilities - minified
|
|
35
|
+
yarn build:lib:globe
|
|
36
|
+
// 2D capabilities only - unminified
|
|
37
|
+
yarn build:lib:debug
|
|
38
|
+
// 2D/3D capabilities - unminified
|
|
39
|
+
yarn build:lib:globe:debug
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
> [!NOTE]
|
|
43
|
+
> Unminified versions for debug purpose are build by defining the `DEBUG` environment variable.
|
|
44
|
+
|
|
45
|
+
## Application samples
|
|
46
|
+
|
|
47
|
+
> [!NOTE]
|
|
48
|
+
> Application samples require unminified library versions to be built first.
|
|
49
|
+
|
|
50
|
+
There are two application samples available:
|
|
51
|
+
* a 2D map view,
|
|
52
|
+
* a 2D map view side-by-side with a 3D globe view that can be synchronized.
|
|
53
|
+
|
|
54
|
+
You can run both samples in dev mode like this:
|
|
55
|
+
```bash
|
|
56
|
+
// 2D view only
|
|
57
|
+
yarn dev
|
|
58
|
+
// 2D/3D views
|
|
59
|
+
yarn dev:globe
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
You can produce application distribution files like this:
|
|
63
|
+
```bash
|
|
64
|
+
// 2D view only
|
|
65
|
+
yarn build:app
|
|
66
|
+
// 2D/3D views
|
|
67
|
+
yarn build:app:globe
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
You should then serve the `dist` folder with eg `http-server` NodeJs module like this:
|
|
71
|
+
```bash
|
|
72
|
+
// Install module first if required
|
|
73
|
+
npm install -g http-server
|
|
74
|
+
cd dist
|
|
75
|
+
http-server --cors --port 3000
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Changes and remaining issues
|
|
79
|
+
|
|
80
|
+
In order to switch from Webpack to Vite and to build a stand alone library the following issues have been tackled or remain to be.
|
|
81
|
+
|
|
82
|
+
> [!NOTE]
|
|
83
|
+
> It was required to add all frontend dependencies required to build with Vite to the main KDK `package.json` file at the root level.
|
|
84
|
+
> Indeed, it appears that if a `node_modules` directory is available at the root level Vite will use it instead of the one located in the directory of the Vite configuration.
|
|
85
|
+
|
|
86
|
+
Some useful links and plugins:
|
|
87
|
+
* https://cesium.com/blog/2024/02/13/configuring-vite-or-webpack-for-cesiumjs/
|
|
88
|
+
* https://quasar.dev/start/vite-plugin/
|
|
89
|
+
* https://github.com/davidmyersdev/vite-plugin-node-polyfills
|
|
90
|
+
* https://github.com/unplugin/unplugin-vue-components
|
|
91
|
+
|
|
92
|
+
### Avoid depending on application specific elements
|
|
93
|
+
|
|
94
|
+
Typically using the router in a library does not make really sense as an app might not use it, if required add a check:
|
|
95
|
+
```js
|
|
96
|
+
const router = useRouter()
|
|
97
|
+
if (router) router.XXX
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Get rid of global properties in the Vue app
|
|
101
|
+
|
|
102
|
+
We were used to inject some objects to be available globally on any Vue component of the app (eg `$store, $api, $config, ...`), we should now directly import the target object:
|
|
103
|
+
```js
|
|
104
|
+
// Don't do
|
|
105
|
+
app.config.globalProperties.$store = Store
|
|
106
|
+
this.$store.patch(...)
|
|
107
|
+
// Do
|
|
108
|
+
import { Store } from ''
|
|
109
|
+
Store.patch(...)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
> [!NOTE]
|
|
113
|
+
> As the `$tie` utility function is used in a lot of components it has not yet been changed.
|
|
114
|
+
|
|
115
|
+
### Avoid importing internal module pathes
|
|
116
|
+
|
|
117
|
+
When building a library Vite requires each external dependency to be listed individually in the build configuration.
|
|
118
|
+
In order to make this smooth we read dependencies from the `package.json` file but this only works when importing the module directly not internal pathes:
|
|
119
|
+
```js
|
|
120
|
+
// Don't do
|
|
121
|
+
import reactive from 'feathers-reactive/dist/feathers-reactive.js'
|
|
122
|
+
// Do
|
|
123
|
+
import { rx as reactive } from 'feathers-reactive'
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
> [!NOTE]
|
|
127
|
+
> This might require changes to dependent modules, notably if not really provided to be natively used as ES modules.
|
|
128
|
+
|
|
129
|
+
### Get rid of dynamic imports
|
|
130
|
+
|
|
131
|
+
Sometimes named imports are not useful because they are static, e.g. the name of the function that will be called is actually defined by a runtime variable.
|
|
132
|
+
Avoid using dynamic import for such use case but prefer importing all named elements with a global alias.
|
|
133
|
+
```js
|
|
134
|
+
// Don't do
|
|
135
|
+
Cesium = await import(`cesium`)
|
|
136
|
+
// Do
|
|
137
|
+
import * as Cesium from 'cesium'
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Avoid aliases to multiple directories
|
|
141
|
+
|
|
142
|
+
We used to define aliases to dynamic load resources like schemas, components, etc. like this:
|
|
143
|
+
```js
|
|
144
|
+
alias: {
|
|
145
|
+
'@schemas': [
|
|
146
|
+
path.resolve(__dirname, 'node_modules/@kalisio/kdk/core/common/schemas'),
|
|
147
|
+
path.resolve(__dirname, 'node_modules/@kalisio/kdk/map/common/schemas')
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
However it does not seem that alias can target multiple directories with Vite, resources should be placed in a single directory whenever possible:
|
|
153
|
+
```js
|
|
154
|
+
alias: {
|
|
155
|
+
'@schemas': fileURLToPath(new URL('node_modules/@kalisio/kdk/extras/schemas', import.meta.url))
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
> [!NOTE]
|
|
160
|
+
> Moving components to a single directory is hard as they are part of the source code split into `core`/`map` directories.
|
|
161
|
+
> This would probably require to rewrite the `loadComponent` utility function using the `@component` alias.
|
|
162
|
+
|
|
163
|
+
### How to integrate Quasar langage packs ?
|
|
164
|
+
|
|
165
|
+
Not yet found a solution to integrate it with Vite, an alias does not seem to work.
|
|
166
|
+
|
|
167
|
+
### How to integrate Vue components ?
|
|
168
|
+
|
|
169
|
+
Not yet tested how to integrate single-file components into the library with Vite, only JS files are considered so far.
|