@kalisio/kdk 2.4.1 → 2.5.1
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/core/api/application.js +12 -12
- package/core/api/authentication.js +51 -7
- package/core/api/hooks/hooks.authentication.js +1 -59
- package/core/api/hooks/hooks.authorisations.js +8 -102
- package/core/api/hooks/hooks.model.js +4 -0
- package/core/api/hooks/hooks.push.js +18 -14
- package/core/api/hooks/hooks.users.js +0 -91
- package/core/api/hooks/index.js +0 -2
- package/core/api/services/account/account.service.js +1 -1
- package/core/api/services/authorisations/authorisations.service.js +28 -29
- package/core/api/services/index.js +38 -50
- package/core/api/services/messages/messages.hooks.js +4 -3
- package/core/api/services/users/users.service.js +5 -0
- package/core/client/api.js +182 -71
- package/core/client/broadcaster.js +20 -0
- package/core/client/capabilities.js +17 -7
- package/core/client/components/KActivity.vue +29 -34
- package/core/client/components/KAvatar.vue +0 -6
- package/core/client/components/KChip.vue +142 -39
- package/core/client/components/KContent.vue +13 -32
- package/core/client/components/KDialog.vue +29 -8
- package/core/client/components/KEditor.vue +120 -0
- package/core/client/components/KFollower.vue +75 -0
- package/core/client/components/KLogo.vue +2 -3
- package/core/client/components/KModal.vue +30 -10
- package/core/client/components/KSponsor.vue +1 -1
- package/core/client/components/KTextArea.vue +2 -5
- package/core/client/components/account/KDeleteAccountManager.vue +1 -1
- package/core/client/components/account/KProfile.vue +52 -14
- package/core/client/components/account/KSubscription.vue +19 -9
- package/core/client/components/account/KSubscriptionsManager.vue +10 -11
- package/core/client/components/action/KAction.vue +44 -24
- package/core/client/components/action/KBugReportAction.vue +4 -5
- package/core/client/components/action/KToggleStickyVisibility.vue +41 -0
- package/core/client/components/action/KToggleWidgetVisibility.vue +41 -0
- package/core/client/components/app/KPlatform.vue +122 -35
- package/core/client/components/app/KRequestProgressBar.vue +59 -0
- package/core/client/components/app/KSettings.vue +13 -2
- package/core/client/components/app/KTour.vue +2 -2
- package/core/client/components/chart/KTimeSeriesChart.vue +11 -3
- package/core/client/components/collection/KCard.vue +27 -33
- package/core/client/components/collection/KCardSection.vue +3 -23
- package/core/client/components/collection/KColumn.vue +0 -5
- package/core/client/components/collection/KDescriptionCardSection.vue +10 -5
- package/core/client/components/collection/KFilterView.vue +15 -0
- package/core/client/components/collection/KGrid.vue +4 -9
- package/core/client/components/collection/KHistory.vue +0 -5
- package/core/client/components/collection/KHistoryEntry.vue +0 -2
- package/core/client/components/collection/KItem.vue +1 -2
- package/core/client/components/collection/KSearchFilterControl.vue +139 -0
- package/core/client/components/collection/KTable.vue +1 -4
- package/core/client/components/collection/KTagsFilterControl.vue +70 -0
- package/core/client/components/collection/KTagsFilterView.vue +61 -0
- package/core/client/components/collection/KTimeFilterControl.vue +40 -0
- package/core/client/components/collection/KTimeFilterView.vue +106 -0
- package/core/client/components/collection/KTimeLine.vue +18 -11
- package/core/client/components/document/KBrowser.vue +283 -0
- package/core/client/components/document/KCsv.vue +52 -0
- package/core/client/components/document/KDocument.vue +19 -5
- package/core/client/components/document/KImage.vue +50 -19
- package/core/client/components/document/KMarkdown.vue +10 -2
- package/core/client/components/document/KUploader.vue +126 -0
- package/core/client/components/document/KVideo.vue +39 -0
- package/core/client/components/form/KDateField.vue +70 -0
- package/core/client/components/form/KDateTimeRangeField.vue +6 -17
- package/core/client/components/form/KDatetimeField.vue +6 -13
- package/core/client/components/form/KForm.vue +8 -8
- package/core/client/components/form/KOptionsField.vue +2 -0
- package/core/client/components/form/KResolutionField.vue +54 -52
- package/core/client/components/form/KSelectField.vue +27 -13
- package/core/client/components/form/KTextareaField.vue +23 -5
- package/core/client/components/graphics/KIcon.vue +64 -0
- package/core/client/components/index.js +1 -3
- package/core/client/components/input/KColorPicker.vue +70 -0
- package/core/client/components/input/KIconPicker.vue +188 -0
- package/core/client/components/input/KShapePicker.vue +81 -0
- package/core/client/components/input/index.js +7 -1
- package/core/client/components/layout/KFab.vue +1 -1
- package/core/client/components/layout/KLayout.vue +14 -2
- package/core/client/components/layout/KOpener.vue +9 -11
- package/core/client/components/layout/KPage.vue +31 -17
- package/core/client/components/layout/KWindow.vue +34 -18
- package/core/client/components/menu/KMenu.vue +52 -36
- package/core/client/components/menu/KSubMenu.vue +105 -0
- package/core/client/components/messages/KMessageCard.vue +207 -0
- package/core/client/components/messages/KMessageComposer.vue +199 -0
- package/core/client/components/messages/KMessagesTimeLine.vue +137 -0
- package/core/client/components/messages/index.js +7 -0
- package/core/client/components/screen/KErrorScreen.vue +2 -3
- package/core/client/components/screen/KLogoutScreen.vue +3 -1
- package/core/client/components/screen/KOAuthLoginScreen.vue +15 -0
- package/core/client/components/screen/KOAuthLogoutScreen.vue +33 -0
- package/core/client/components/screen/KUnauthorizedScreen.vue +16 -0
- package/core/client/components/time/KAbsoluteTimeRange.vue +7 -14
- package/core/client/components/time/KDate.vue +55 -28
- package/core/client/components/time/KDateTime.vue +93 -37
- package/core/client/components/time/KDateTimeRange.vue +197 -52
- package/core/client/components/time/KTime.vue +55 -27
- package/core/client/composables/activity.js +40 -30
- package/core/client/composables/{counter.js → collection-counter.js} +2 -4
- package/core/client/composables/collection-filter.js +111 -0
- package/core/client/composables/collection-timerange.js +56 -0
- package/core/client/composables/collection.js +13 -11
- package/core/client/composables/context.js +92 -0
- package/core/client/composables/errors.js +83 -0
- package/core/client/composables/index.js +5 -1
- package/core/client/composables/layout.js +14 -11
- package/core/client/composables/messages.js +4 -4
- package/core/client/composables/pwa.js +20 -27
- package/core/client/composables/schema.js +1 -1
- package/core/client/composables/screen.js +21 -9
- package/core/client/composables/selection.js +16 -4
- package/core/client/composables/session.js +13 -7
- package/core/client/composables/store.js +2 -1
- package/core/client/context.js +38 -0
- package/core/client/directives/v-hover.js +7 -4
- package/core/client/document.js +43 -15
- package/core/client/events.js +2 -2
- package/core/client/exporter.js +5 -4
- package/core/client/filter.js +1 -8
- package/core/client/guards.js +3 -3
- package/core/client/hooks/hooks.logger.js +1 -1
- package/core/client/hooks/hooks.offline.js +32 -0
- package/core/client/hooks/index.js +2 -1
- package/core/client/i18n/core_en.json +95 -268
- package/core/client/i18n/core_fr.json +181 -353
- package/core/client/index.js +22 -8
- package/core/client/layout.js +64 -25
- package/core/client/local-cache.js +67 -0
- package/core/client/local-storage.js +6 -2
- package/core/client/mixins/index.js +0 -1
- package/core/client/mixins/mixin.base-activity.js +22 -10
- package/core/client/mixins/mixin.base-editor.js +1 -1
- package/core/client/mixins/mixin.base-field.js +10 -1
- package/core/client/mixins/mixin.base-item.js +14 -11
- package/core/client/mixins/mixin.service.js +1 -5
- package/core/client/platform.js +44 -0
- package/core/client/readers/reader.blob.js +3 -3
- package/core/client/readers/reader.csv.js +2 -2
- package/core/client/readers/reader.json.js +2 -2
- package/core/client/services/index.js +7 -11
- package/core/client/storage.js +43 -8
- package/core/client/template-context.js +14 -14
- package/core/client/time.js +2 -2
- package/core/client/units.js +7 -4
- package/core/client/utils/index.js +6 -5
- package/core/client/utils/utils.collection.js +71 -0
- package/core/client/utils/utils.colors.js +29 -8
- package/core/client/utils/utils.content.js +14 -14
- package/core/client/utils/utils.files.js +17 -0
- package/core/client/utils/utils.items.js +4 -0
- package/core/client/utils/utils.math.js +18 -1
- package/core/client/utils/utils.push.js +22 -13
- package/core/client/utils/utils.screen.js +6 -2
- package/core/client/utils/utils.services.js +42 -0
- package/core/client/utils/utils.session.js +48 -12
- package/core/client/utils/utils.shapes.js +15 -11
- package/core/common/permissions.js +3 -108
- package/core/common/schemas/messages.update.json +16 -0
- package/core/common/schemas/settings.update.json +27 -8
- package/core/common/utils.js +2 -0
- package/core/common/utils.offline.js +38 -0
- package/coverage/core/api/application.js.html +296 -296
- package/coverage/core/api/authentication.js.html +206 -74
- package/coverage/core/api/db.js.html +61 -61
- package/coverage/core/api/hooks/hooks.authentication.js.html +15 -189
- package/coverage/core/api/hooks/hooks.authorisations.js.html +180 -462
- package/coverage/core/api/hooks/hooks.groups.js.html +1 -1
- package/coverage/core/api/hooks/hooks.logger.js.html +16 -16
- package/coverage/core/api/hooks/hooks.model.js.html +69 -57
- package/coverage/core/api/hooks/hooks.organisations.js.html +1 -1
- package/coverage/core/api/hooks/hooks.push.js.html +58 -46
- package/coverage/core/api/hooks/hooks.query.js.html +142 -142
- package/coverage/core/api/hooks/hooks.schemas.js.html +1 -1
- package/coverage/core/api/hooks/hooks.service.js.html +1 -1
- package/coverage/core/api/hooks/hooks.storage.js.html +1 -1
- package/coverage/core/api/hooks/hooks.users.js.html +54 -327
- package/coverage/core/api/hooks/index.html +64 -94
- package/coverage/core/api/hooks/index.js.html +4 -10
- package/coverage/core/api/index.html +41 -56
- package/coverage/core/api/index.js.html +1 -1
- package/coverage/core/api/marshall.js.html +9 -9
- package/coverage/core/api/models/groups.model.mongodb.js.html +1 -1
- package/coverage/core/api/models/index.html +13 -58
- package/coverage/core/api/models/messages.model.mongodb.js.html +35 -35
- package/coverage/core/api/models/organisations.model.mongodb.js.html +3 -3
- package/coverage/core/api/models/tags.model.mongodb.js.html +1 -1
- package/coverage/core/api/models/users.model.mongodb.js.html +1 -1
- package/coverage/core/api/services/account/account.hooks.js.html +1 -1
- package/coverage/core/api/services/account/account.service.js.html +67 -67
- package/coverage/core/api/services/account/index.html +16 -16
- package/coverage/core/api/services/authorisations/authorisations.hooks.js.html +1 -1
- package/coverage/core/api/services/authorisations/authorisations.service.js.html +141 -144
- package/coverage/core/api/services/authorisations/index.html +19 -19
- package/coverage/core/api/services/databases/databases.hooks.js.html +82 -82
- package/coverage/core/api/services/databases/databases.service.js.html +20 -20
- package/coverage/core/api/services/databases/index.html +32 -32
- package/coverage/core/api/services/groups/groups.hooks.js.html +1 -1
- package/coverage/core/api/services/groups/index.html +1 -1
- package/coverage/core/api/services/import-export/import-export.hooks.js.html +1 -1
- package/coverage/core/api/services/import-export/import-export.service.js.html +1 -1
- package/coverage/core/api/services/import-export/index.html +1 -1
- package/coverage/core/api/services/index.html +21 -21
- package/coverage/core/api/services/index.js.html +118 -154
- package/coverage/core/api/services/mailer/index.html +1 -1
- package/coverage/core/api/services/mailer/mailer.hooks.js.html +1 -1
- package/coverage/core/api/services/mailer/mailer.service.js.html +1 -1
- package/coverage/core/api/services/messages/index.html +21 -21
- package/coverage/core/api/services/messages/messages.hooks.js.html +89 -86
- package/coverage/core/api/services/organisations/index.html +1 -1
- package/coverage/core/api/services/organisations/organisations.hooks.js.html +1 -1
- package/coverage/core/api/services/organisations/organisations.service.js.html +23 -23
- package/coverage/core/api/services/push/index.html +1 -1
- package/coverage/core/api/services/push/push.hooks.js.html +1 -1
- package/coverage/core/api/services/push/push.service.js.html +1 -1
- package/coverage/core/api/services/storage/index.html +5 -5
- package/coverage/core/api/services/storage/storage.hooks.js.html +1 -1
- package/coverage/core/api/services/storage/storage.service.js.html +27 -27
- package/coverage/core/api/services/tags/index.html +1 -1
- package/coverage/core/api/services/tags/tags.hooks.js.html +1 -1
- package/coverage/core/api/services/users/index.html +23 -8
- package/coverage/core/api/services/users/users.hooks.js.html +1 -1
- package/coverage/core/api/services/users/users.service.js.html +100 -0
- package/coverage/core/api/utils.js.html +1 -1
- package/coverage/core/common/errors.js.html +1 -1
- package/coverage/core/common/index.html +42 -27
- package/coverage/core/common/index.js.html +1 -1
- package/coverage/core/common/permissions.js.html +195 -510
- package/coverage/core/common/schema.js.html +1 -1
- package/coverage/core/common/utils.js.html +12 -6
- package/coverage/core/common/utils.offline.js.html +199 -0
- package/coverage/index.html +142 -172
- package/coverage/lcov-report/core/api/application.js.html +296 -296
- package/coverage/lcov-report/core/api/authentication.js.html +206 -74
- package/coverage/lcov-report/core/api/db.js.html +61 -61
- package/coverage/lcov-report/core/api/hooks/hooks.authentication.js.html +15 -189
- package/coverage/lcov-report/core/api/hooks/hooks.authorisations.js.html +180 -462
- package/coverage/lcov-report/core/api/hooks/hooks.groups.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.logger.js.html +16 -16
- package/coverage/lcov-report/core/api/hooks/hooks.model.js.html +69 -57
- package/coverage/lcov-report/core/api/hooks/hooks.organisations.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.push.js.html +58 -46
- package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +142 -142
- package/coverage/lcov-report/core/api/hooks/hooks.schemas.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.service.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.storage.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.users.js.html +54 -327
- package/coverage/lcov-report/core/api/hooks/index.html +64 -94
- package/coverage/lcov-report/core/api/hooks/index.js.html +4 -10
- package/coverage/lcov-report/core/api/index.html +41 -56
- package/coverage/lcov-report/core/api/index.js.html +1 -1
- package/coverage/lcov-report/core/api/marshall.js.html +9 -9
- package/coverage/lcov-report/core/api/models/groups.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/core/api/models/index.html +13 -58
- package/coverage/lcov-report/core/api/models/messages.model.mongodb.js.html +35 -35
- package/coverage/lcov-report/core/api/models/organisations.model.mongodb.js.html +3 -3
- package/coverage/lcov-report/core/api/models/tags.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/core/api/models/users.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/core/api/services/account/account.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/account/account.service.js.html +67 -67
- package/coverage/lcov-report/core/api/services/account/index.html +16 -16
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.service.js.html +141 -144
- package/coverage/lcov-report/core/api/services/authorisations/index.html +19 -19
- package/coverage/lcov-report/core/api/services/databases/databases.hooks.js.html +82 -82
- package/coverage/lcov-report/core/api/services/databases/databases.service.js.html +20 -20
- package/coverage/lcov-report/core/api/services/databases/index.html +32 -32
- package/coverage/lcov-report/core/api/services/groups/groups.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/groups/index.html +1 -1
- package/coverage/lcov-report/core/api/services/import-export/import-export.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/import-export/import-export.service.js.html +1 -1
- package/coverage/lcov-report/core/api/services/import-export/index.html +1 -1
- package/coverage/lcov-report/core/api/services/index.html +21 -21
- package/coverage/lcov-report/core/api/services/index.js.html +118 -154
- package/coverage/lcov-report/core/api/services/mailer/index.html +1 -1
- package/coverage/lcov-report/core/api/services/mailer/mailer.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/mailer/mailer.service.js.html +1 -1
- package/coverage/lcov-report/core/api/services/messages/index.html +21 -21
- package/coverage/lcov-report/core/api/services/messages/messages.hooks.js.html +89 -86
- package/coverage/lcov-report/core/api/services/organisations/index.html +1 -1
- package/coverage/lcov-report/core/api/services/organisations/organisations.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/organisations/organisations.service.js.html +23 -23
- package/coverage/lcov-report/core/api/services/push/index.html +1 -1
- package/coverage/lcov-report/core/api/services/push/push.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/push/push.service.js.html +1 -1
- package/coverage/lcov-report/core/api/services/storage/index.html +5 -5
- package/coverage/lcov-report/core/api/services/storage/storage.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/storage/storage.service.js.html +27 -27
- package/coverage/lcov-report/core/api/services/tags/index.html +1 -1
- package/coverage/lcov-report/core/api/services/tags/tags.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/users/index.html +23 -8
- package/coverage/lcov-report/core/api/services/users/users.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/users/users.service.js.html +100 -0
- package/coverage/lcov-report/core/api/utils.js.html +1 -1
- package/coverage/lcov-report/core/common/errors.js.html +1 -1
- package/coverage/lcov-report/core/common/index.html +42 -27
- package/coverage/lcov-report/core/common/index.js.html +1 -1
- package/coverage/lcov-report/core/common/permissions.js.html +195 -510
- package/coverage/lcov-report/core/common/schema.js.html +1 -1
- package/coverage/lcov-report/core/common/utils.js.html +12 -6
- package/coverage/lcov-report/core/common/utils.offline.js.html +199 -0
- package/coverage/lcov-report/index.html +142 -172
- package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +125 -29
- package/coverage/lcov-report/map/api/hooks/hooks.features.js.html +1 -1
- package/coverage/lcov-report/map/api/hooks/hooks.query.js.html +20 -44
- package/coverage/lcov-report/map/api/hooks/index.html +7 -7
- package/coverage/lcov-report/map/api/hooks/index.js.html +1 -1
- package/coverage/lcov-report/map/api/index.html +1 -1
- package/coverage/lcov-report/map/api/index.js.html +1 -1
- package/coverage/lcov-report/map/api/marshall.js.html +1 -1
- package/coverage/lcov-report/map/api/models/alerts.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/map/api/models/catalog.model.mongodb.js.html +49 -7
- package/coverage/lcov-report/map/api/models/features.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/map/api/models/index.html +22 -7
- package/coverage/lcov-report/map/api/models/projects.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/map/api/models/styles.model.mongodb.js.html +112 -0
- package/coverage/lcov-report/map/api/services/alerts/alerts.hooks.js.html +1 -1
- package/coverage/lcov-report/map/api/services/alerts/alerts.service.js.html +1 -1
- package/coverage/lcov-report/map/api/services/alerts/index.html +1 -1
- package/coverage/lcov-report/map/api/services/catalog/catalog.hooks.js.html +29 -11
- package/coverage/lcov-report/map/api/services/catalog/index.html +5 -5
- package/coverage/lcov-report/map/api/services/daptiles/daptiles.service.js.html +1 -1
- package/coverage/lcov-report/map/api/services/daptiles/index.html +1 -1
- package/coverage/lcov-report/map/api/services/features/features.hooks.js.html +78 -9
- package/coverage/lcov-report/map/api/services/features/features.service.js.html +307 -4
- package/coverage/lcov-report/map/api/services/features/index.html +7 -7
- package/coverage/lcov-report/map/api/services/index.html +5 -5
- package/coverage/lcov-report/map/api/services/index.js.html +287 -50
- package/coverage/lcov-report/map/api/services/projects/index.html +1 -1
- package/coverage/lcov-report/map/api/services/projects/projects.hooks.js.html +1 -1
- package/coverage/lcov-report/map/api/services/styles/index.html +116 -0
- package/coverage/lcov-report/map/api/services/styles/styles.hooks.js.html +196 -0
- package/coverage/lcov-report/map/common/dynamic-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/errors.js.html +1 -1
- package/coverage/lcov-report/map/common/geotiff-grid-source.js.html +8 -5
- package/coverage/lcov-report/map/common/grid.js.html +1 -1
- package/coverage/lcov-report/map/common/index.html +7 -7
- package/coverage/lcov-report/map/common/index.js.html +1 -1
- package/coverage/lcov-report/map/common/meteo-model-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/moment-utils.js.html +1 -1
- package/coverage/lcov-report/map/common/opendap-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/opendap-utils.js.html +1 -1
- package/coverage/lcov-report/map/common/permissions.js.html +10 -4
- package/coverage/lcov-report/map/common/time-based-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/tms-utils.js.html +6 -6
- package/coverage/lcov-report/map/common/wcs-grid-source.js.html +3 -3
- package/coverage/lcov-report/map/common/wcs-utils.js.html +9 -9
- package/coverage/lcov-report/map/common/weacast-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/wfs-utils.js.html +11 -11
- package/coverage/lcov-report/map/common/wms-utils.js.html +8 -8
- package/coverage/lcov-report/map/common/wmts-utils.js.html +7 -7
- package/coverage/lcov.info +2581 -3278
- package/coverage/map/api/hooks/hooks.catalog.js.html +125 -29
- package/coverage/map/api/hooks/hooks.features.js.html +1 -1
- package/coverage/map/api/hooks/hooks.query.js.html +20 -44
- package/coverage/map/api/hooks/index.html +7 -7
- package/coverage/map/api/hooks/index.js.html +1 -1
- package/coverage/map/api/index.html +1 -1
- package/coverage/map/api/index.js.html +1 -1
- package/coverage/map/api/marshall.js.html +1 -1
- package/coverage/map/api/models/alerts.model.mongodb.js.html +1 -1
- package/coverage/map/api/models/catalog.model.mongodb.js.html +49 -7
- package/coverage/map/api/models/features.model.mongodb.js.html +1 -1
- package/coverage/map/api/models/index.html +22 -7
- package/coverage/map/api/models/projects.model.mongodb.js.html +1 -1
- package/coverage/map/api/models/styles.model.mongodb.js.html +112 -0
- package/coverage/map/api/services/alerts/alerts.hooks.js.html +1 -1
- package/coverage/map/api/services/alerts/alerts.service.js.html +1 -1
- package/coverage/map/api/services/alerts/index.html +1 -1
- package/coverage/map/api/services/catalog/catalog.hooks.js.html +29 -11
- package/coverage/map/api/services/catalog/index.html +5 -5
- package/coverage/map/api/services/daptiles/daptiles.service.js.html +1 -1
- package/coverage/map/api/services/daptiles/index.html +1 -1
- package/coverage/map/api/services/features/features.hooks.js.html +78 -9
- package/coverage/map/api/services/features/features.service.js.html +307 -4
- package/coverage/map/api/services/features/index.html +7 -7
- package/coverage/map/api/services/index.html +5 -5
- package/coverage/map/api/services/index.js.html +287 -50
- package/coverage/map/api/services/projects/index.html +1 -1
- package/coverage/map/api/services/projects/projects.hooks.js.html +1 -1
- package/coverage/map/api/services/styles/index.html +116 -0
- package/coverage/map/api/services/styles/styles.hooks.js.html +196 -0
- package/coverage/map/common/dynamic-grid-source.js.html +1 -1
- package/coverage/map/common/errors.js.html +1 -1
- package/coverage/map/common/geotiff-grid-source.js.html +8 -5
- package/coverage/map/common/grid.js.html +1 -1
- package/coverage/map/common/index.html +7 -7
- package/coverage/map/common/index.js.html +1 -1
- package/coverage/map/common/meteo-model-grid-source.js.html +1 -1
- package/coverage/map/common/moment-utils.js.html +1 -1
- package/coverage/map/common/opendap-grid-source.js.html +1 -1
- package/coverage/map/common/opendap-utils.js.html +1 -1
- package/coverage/map/common/permissions.js.html +10 -4
- package/coverage/map/common/time-based-grid-source.js.html +1 -1
- package/coverage/map/common/tms-utils.js.html +6 -6
- package/coverage/map/common/wcs-grid-source.js.html +3 -3
- package/coverage/map/common/wcs-utils.js.html +9 -9
- package/coverage/map/common/weacast-grid-source.js.html +1 -1
- package/coverage/map/common/wfs-utils.js.html +11 -11
- package/coverage/map/common/wms-utils.js.html +8 -8
- package/coverage/map/common/wmts-utils.js.html +7 -7
- package/coverage/tmp/coverage-323534-1747828879483-0.json +1 -0
- package/coverage/tmp/coverage-323546-1747828879453-0.json +1 -0
- package/coverage/tmp/coverage-323557-1747828879439-0.json +1 -0
- package/coverage/tmp/coverage-323569-1747828879416-0.json +1 -0
- package/coverage/tmp/coverage-323576-1747828879390-0.json +1 -0
- package/extras/configs/helpers.js +78 -0
- package/extras/configs/panes.left.js +118 -0
- package/extras/configs/panes.top.js +222 -0
- package/extras/configs/stickies.js +57 -0
- package/extras/configs/widgets.left.js +23 -0
- package/extras/configs/widgets.top.js +73 -0
- package/extras/css/core.variables.scss +8 -0
- package/extras/images/north.svg +3 -0
- package/extras/tours/map/side-nav.js +3 -3
- package/map/api/hooks/hooks.catalog.js +56 -23
- package/map/api/hooks/hooks.query.js +16 -24
- package/map/api/models/catalog.model.mongodb.js +16 -2
- package/{core/api/models/groups.model.mongodb.js → map/api/models/styles.model.mongodb.js} +2 -1
- package/map/api/services/catalog/catalog.hooks.js +13 -7
- package/map/api/services/features/features.hooks.js +28 -5
- package/map/api/services/features/features.service.js +101 -0
- package/map/api/services/index.js +125 -46
- package/map/api/services/styles/styles.hooks.js +37 -0
- package/map/client/cesium/utils/index.js +1 -0
- package/map/client/cesium/utils/utils.cesium.js +397 -0
- package/map/client/cesium/utils/utils.features.js +8 -0
- package/map/client/cesium/utils/utils.geojson.js +59 -0
- package/map/client/cesium/utils/utils.style.js +134 -17
- package/map/client/components/KEditLayerData.vue +17 -79
- package/map/client/components/KFeatureEditor.vue +2 -7
- package/map/client/components/KFeaturesChart.vue +2 -6
- package/map/client/components/KFeaturesFilterEditor.vue +300 -0
- package/map/client/components/KFeaturesFilterManager.vue +196 -0
- package/map/client/components/KFeaturesTable.vue +0 -5
- package/map/client/components/KFilterCondition.vue +303 -0
- package/map/client/components/KLayerEditionToolbar.vue +4 -3
- package/map/client/components/KLayerEditor.vue +451 -36
- package/map/client/components/KMeasureTool.vue +36 -9
- package/map/client/components/KProjectMenu.vue +14 -8
- package/map/client/components/catalog/KAddLayer.vue +0 -4
- package/map/client/components/catalog/KBaseLayersSelector.vue +42 -46
- package/map/client/components/catalog/KConnectLayer.vue +295 -291
- package/map/client/components/catalog/KCreateLayer.vue +141 -146
- package/map/client/components/catalog/KCreateOfflineView.vue +100 -0
- package/map/client/components/catalog/KCreateView.vue +2 -8
- package/map/client/components/catalog/KFilteredLayerItem.vue +72 -25
- package/map/client/components/catalog/KImportLayer.vue +121 -129
- package/map/client/components/catalog/KLayerItem.vue +44 -32
- package/map/client/components/catalog/KLayersPanel.vue +45 -17
- package/map/client/components/catalog/KLayersSelector.vue +51 -50
- package/map/client/components/catalog/KProjectManager.vue +4 -8
- package/map/client/components/catalog/KProjectSelector.vue +33 -2
- package/map/client/components/catalog/KProjectsPanel.vue +84 -106
- package/map/client/components/catalog/KSelectLayers.vue +56 -69
- package/map/client/components/catalog/KSelectViews.vue +56 -69
- package/map/client/components/catalog/KViewSelector.vue +32 -2
- package/map/client/components/catalog/KViewsPanel.vue +178 -110
- package/map/client/components/catalog/KWeatherLayersSelector.vue +77 -85
- package/map/client/components/form/KLocationField.vue +21 -2
- package/map/client/components/form/KOwsLayerField.vue +1 -1
- package/map/client/components/form/KOwsServiceField.vue +102 -63
- package/map/client/components/form/KSelectLayersField.vue +1 -1
- package/map/client/components/form/KSelectViewsField.vue +1 -1
- package/map/client/components/form/KTimezoneField.vue +0 -1
- package/map/client/components/legend/KLegend.vue +4 -4
- package/map/client/components/location/KLocationCardSection.vue +16 -0
- package/map/client/components/location/KLocationMap.vue +3 -2
- package/map/client/components/location/KLocationSearch.vue +46 -8
- package/map/client/components/location/KLocationTimeLineCard.vue +25 -3
- package/map/client/components/location/KLocationTip.vue +57 -10
- package/map/client/components/selection/KFeaturesSelection.vue +71 -0
- package/map/client/components/selection/KSelectedLayerFeatures.vue +343 -0
- package/map/client/components/{KAttribution.vue → stickies/KAttribution.vue} +39 -33
- package/map/client/components/stickies/KLevelSlider.vue +114 -0
- package/map/client/components/stickies/KNorthArrow.vue +26 -0
- package/map/client/components/stickies/KPosition.vue +103 -0
- package/map/client/components/stickies/KTarget.vue +34 -0
- package/map/client/components/styles/KLayerStyleAction.vue +58 -0
- package/map/client/components/styles/KStyleEditor.vue +273 -0
- package/map/client/components/styles/KStyleEditorSection.vue +79 -0
- package/map/client/components/styles/KStyleManager.vue +183 -0
- package/map/client/components/styles/KStylePreview.vue +64 -0
- package/map/client/components/styles/KStylePreviewItem.vue +68 -0
- package/map/client/components/styles/KStylePropertiesGroup.vue +76 -0
- package/map/client/components/styles/KStyleProperty.vue +136 -0
- package/map/client/components/styles/KStyleTip.vue +118 -0
- package/map/client/components/tools/KGeolocateTool.vue +3 -2
- package/map/client/components/tools/KSearchTool.vue +34 -6
- package/map/client/components/widget/KMapillaryViewer.vue +1 -1
- package/map/client/components/widget/KStackableTimeSeries.vue +8 -5
- package/map/client/composables/activity.js +29 -43
- package/map/client/composables/catalog.js +1 -1
- package/map/client/composables/highlight.js +117 -57
- package/map/client/composables/location.js +33 -14
- package/map/client/composables/project.js +9 -10
- package/map/client/composables/selection.js +136 -23
- package/map/client/geocoder.js +104 -0
- package/map/client/geolocation.js +1 -1
- package/map/client/globe.js +3 -0
- package/map/client/hooks/hooks.offline.js +95 -0
- package/map/client/hooks/index.js +1 -0
- package/map/client/i18n/map_en.json +159 -94
- package/map/client/i18n/map_fr.json +186 -127
- package/map/client/index.js +3 -0
- package/map/client/init.js +44 -8
- package/map/client/leaflet/BoxSelection.js +2 -2
- package/map/client/leaflet/GradientPath.js +84 -4
- package/map/client/leaflet/WindBarb.js +323 -0
- package/map/client/leaflet/utils/index.js +1 -0
- package/map/client/leaflet/utils/utils.events.js +8 -3
- package/map/client/leaflet/utils/utils.geojson.js +221 -0
- package/map/client/leaflet/utils/utils.style.js +10 -9
- package/map/client/map.js +3 -0
- package/map/client/mixins/globe/mixin.base-globe.js +151 -19
- package/map/client/mixins/globe/mixin.geojson-layers.js +208 -86
- package/map/client/mixins/globe/mixin.popup.js +3 -2
- package/map/client/mixins/globe/mixin.style.js +3 -1
- package/map/client/mixins/globe/mixin.tooltip.js +3 -2
- package/map/client/mixins/map/index.js +1 -3
- package/map/client/mixins/map/mixin.base-map.js +267 -79
- package/map/client/mixins/map/mixin.canvas-layers.js +44 -10
- package/map/client/mixins/map/mixin.edit-layers.js +142 -57
- package/map/client/mixins/map/mixin.geojson-layers.js +127 -204
- package/map/client/mixins/map/mixin.pmtiles-layers.js +24 -11
- package/map/client/mixins/map/mixin.tiled-mesh-layers.js +1 -2
- package/map/client/mixins/map/mixin.tiled-wind-layers.js +2 -1
- package/map/client/mixins/mixin.activity.js +61 -41
- package/map/client/mixins/mixin.context.js +19 -14
- package/map/client/mixins/mixin.feature-selection.js +0 -1
- package/map/client/mixins/mixin.feature-service.js +41 -59
- package/map/client/mixins/mixin.weacast.js +1 -1
- package/map/client/navigator.js +38 -0
- package/map/client/pixi-utils.js +1 -1
- package/map/client/planets.js +1 -1
- package/map/client/readers/reader.kml.js +57 -1
- package/map/client/utils/index.js +1 -0
- package/map/client/utils/utils.capture.js +10 -7
- package/map/client/utils/utils.catalog.js +2 -2
- package/map/client/utils/utils.features.js +193 -39
- package/map/client/utils/utils.js +0 -21
- package/map/client/utils/utils.layers.js +381 -4
- package/map/client/utils/utils.location.js +39 -74
- package/map/client/utils/utils.offline.js +89 -0
- package/map/client/utils/utils.style.js +133 -80
- package/map/common/geotiff-grid-source.js +2 -1
- package/map/common/permissions.js +2 -0
- package/map/common/schemas/capture.create.json +4 -4
- package/map/common/schemas/catalog.update.json +18 -2
- package/map/common/schemas/projects.create.json +2 -2
- package/map/common/schemas/projects.update.json +2 -2
- package/map/common/tms-utils.js +5 -5
- package/map/common/wcs-grid-source.js +2 -2
- package/map/common/wcs-utils.js +8 -8
- package/map/common/wfs-utils.js +10 -10
- package/map/common/wms-utils.js +7 -7
- package/map/common/wmts-utils.js +6 -6
- package/package.json +7 -4
- package/test/api/core/account.test.js +0 -72
- package/test/api/core/authentication.test.js +184 -0
- package/test/api/core/config/default.cjs +1 -3
- package/test/api/core/index.test.js +33 -96
- package/test/api/core/offline.test.js +55 -0
- package/test/api/core/push.test.js +3 -3
- package/test/api/core/{test-log-2024-06-06.log → test-log-2025-02-05.log} +3 -3
- package/test/api/core/{test-log-2024-11-15.log → test-log-2025-05-21.log} +1 -9
- package/test/api/map/alerts.test.js +1 -1
- package/test/api/map/config/default.cjs +2 -1
- package/test/api/map/data/vigicrues.observations.Q.json +47042 -0
- package/test/api/map/index.test.js +113 -9
- package/test/api/map/style.test.js +62 -0
- package/test/client/core/layout.js +2 -2
- package/test/client/core/runner.js +1 -1
- package/test/client/core/utils.js +52 -0
- package/test/client/map/catalog.js +1 -0
- package/core/api/hooks/hooks.groups.js +0 -48
- package/core/api/hooks/hooks.organisations.js +0 -152
- package/core/api/models/organisations.model.mongodb.js +0 -3
- package/core/api/models/tags.model.mongodb.js +0 -10
- package/core/api/services/groups/groups.hooks.js +0 -31
- package/core/api/services/organisations/organisations.hooks.js +0 -31
- package/core/api/services/organisations/organisations.service.js +0 -86
- package/core/api/services/tags/tags.hooks.js +0 -31
- package/core/api/utils.js +0 -11
- package/core/client/components/KChipsPane.vue +0 -103
- package/core/client/components/document/index.js +0 -9
- package/core/client/components/team/KAddMember.vue +0 -378
- package/core/client/components/team/KAddTag.vue +0 -121
- package/core/client/components/team/KChangeRole.vue +0 -118
- package/core/client/components/team/KGroupCard.vue +0 -110
- package/core/client/components/team/KGroupsActivity.vue +0 -78
- package/core/client/components/team/KJoinGroup.vue +0 -132
- package/core/client/components/team/KMemberCard.vue +0 -328
- package/core/client/components/team/KMemberFilter.vue +0 -49
- package/core/client/components/team/KMembersActivity.vue +0 -136
- package/core/client/components/team/KOrganisationsActivity.vue +0 -51
- package/core/client/components/team/KTagCard.vue +0 -72
- package/core/client/components/team/KTagsActivity.vue +0 -73
- package/core/client/components/team/index.js +0 -9
- package/core/client/mixins/mixin.base-context.js +0 -54
- package/core/client/utils/utils.platform.js +0 -12
- package/core/common/schemas/groups.create.json +0 -28
- package/core/common/schemas/groups.update.json +0 -28
- package/core/common/schemas/organisations.create.json +0 -28
- package/core/common/schemas/organisations.update.json +0 -49
- package/core/common/schemas/tags.create.json +0 -35
- package/core/common/schemas/tags.update.json +0 -35
- package/coverage/tmp/coverage-280506-1731704745613-0.json +0 -1
- package/coverage/tmp/coverage-280518-1731704745599-0.json +0 -1
- package/coverage/tmp/coverage-280529-1731704745588-0.json +0 -1
- package/coverage/tmp/coverage-280541-1731704745574-0.json +0 -1
- package/coverage/tmp/coverage-280548-1731704745545-0.json +0 -1
- package/map/client/components/KFeaturesFilter.vue +0 -259
- package/map/client/components/KLayerStyleEditor.vue +0 -118
- package/map/client/components/KLayerStyleForm.vue +0 -740
- package/map/client/components/KLevelSlider.vue +0 -100
- package/map/client/components/KNorth.vue +0 -31
- package/map/client/components/KPositionIndicator.vue +0 -83
- package/map/client/components/catalog/KCreateProject.vue +0 -100
- package/map/client/mixins/map/mixin.forecast-layers.js +0 -81
- package/map/client/mixins/map/mixin.georaster-layers.js +0 -107
- package/test/api/core/team.test.js +0 -670
- package/test/api/core/test-log-2023-12-19.log +0 -7
- package/test/api/core/test-log-2024-01-04.log +0 -14
- package/test/api/core/test-log-2024-05-14.log +0 -6
- package/test/api/core/test-log-2024-06-26.log +0 -25
- package/test/api/core/test-log-2024-06-28.log +0 -2
- package/test/api/core/test-log-2024-07-09.log +0 -0
- package/test/api/core/test-log-2024-08-13.log +0 -69
- package/test/api/core/test-log-2024-10-28.log +0 -53
- package/test/api/core/test-log-2024-11-05.log +0 -30
- package/test/api/core/test-log-2024-11-18.log +0 -0
- package/test/api/core/test-log-2024-12-03.log +0 -30
- package/test/api/map/test-log-2023-11-24.log +0 -121
- package/test/api/map/test-log-2023-12-12.log +0 -29
- package/test/api/map/test-log-2023-12-13.log +0 -5
- package/test/api/map/test-log-2024-01-04.log +0 -2
- package/test/api/map/test-log-2024-01-11.log +0 -1
- package/test/api/map/test-log-2024-01-25.log +0 -19
- package/test/api/map/test-log-2024-06-06.log +0 -39
- package/test/api/map/test-log-2024-08-13.log +0 -13
- package/test/api/map/test-log-2024-08-20.log +0 -55
- package/test/api/map/test-log-2024-09-09.log +0 -92
- package/test/api/map/test-log-2024-10-28.log +0 -11
- /package/extras/{logos → images}/kalisio.png +0 -0
- /package/extras/{icons → images}/target.svg +0 -0
- /package/test/api/map/data/{vigicrues.observations.json → vigicrues.observations.H.json} +0 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import L from 'leaflet'
|
|
2
|
+
import _ from 'lodash'
|
|
3
|
+
import 'leaflet-realtime'
|
|
4
|
+
import { lineOffset } from '@turf/turf'
|
|
5
|
+
import { GradientPath, buildSVGOverlayFromGradientPath } from '../GradientPath.js'
|
|
6
|
+
|
|
7
|
+
// Override default remove handler for leaflet-realtime due to
|
|
8
|
+
// https://github.com/perliedman/leaflet-realtime/issues/177
|
|
9
|
+
const Realtime = L.Realtime.extend({
|
|
10
|
+
remove: function (geojson) {
|
|
11
|
+
if (typeof geojson === 'undefined') {
|
|
12
|
+
return L.Layer.prototype.remove.call(this)
|
|
13
|
+
} else {
|
|
14
|
+
return L.Realtime.prototype.remove.call(this, geojson)
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
L.realtime = function (src, options) {
|
|
19
|
+
return new Realtime(src, options)
|
|
20
|
+
}
|
|
21
|
+
// Override default Polyline simplify function to manage offset
|
|
22
|
+
const simplifyPoints = L.Polyline.prototype._simplifyPoints
|
|
23
|
+
L.Polyline.include({
|
|
24
|
+
_simplifyPoints: function () {
|
|
25
|
+
simplifyPoints.call(this)
|
|
26
|
+
// Offset simplified version
|
|
27
|
+
if (this.options.offset) {
|
|
28
|
+
// We'd like to ensure a pixel constant offset when zooming
|
|
29
|
+
// Zoom 0 resolution is 156 543 m/pixel at equator in default map tiles,
|
|
30
|
+
// we take latitude into account to account for a convergence factor
|
|
31
|
+
const latitude = this.getBounds().getCenter().lat
|
|
32
|
+
const factor = 156543 / Math.pow(2, this._map.getZoom()) / Math.cos(latitude * Math.PI / 180)
|
|
33
|
+
const offset = Math.max(1, this.options.offset * factor)
|
|
34
|
+
|
|
35
|
+
for (let i = 0; i < this._parts.length; i++) {
|
|
36
|
+
let latLngs = this._parts[i].map(point => this._map.layerPointToLatLng(point))
|
|
37
|
+
// Ensure a large enough precision for computation (defaults to 6 in Leaflet)
|
|
38
|
+
const coords = L.GeoJSON.latLngsToCoords(latLngs, 0, false, 12)
|
|
39
|
+
const feature = lineOffset({ type: 'LineString', coordinates: coords }, offset, { units: 'meters' })
|
|
40
|
+
latLngs = L.GeoJSON.coordsToLatLngs(feature.geometry.coordinates, 0)
|
|
41
|
+
this._parts[i] = latLngs.map(latlng => this._map.latLngToLayerPoint(latlng))
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
// Override default Leaflet GeoJson utility to manage some specific use cases
|
|
48
|
+
const geometryToLayer = L.GeoJSON.geometryToLayer
|
|
49
|
+
L.GeoJSON.geometryToLayer = function (geojson, options) {
|
|
50
|
+
const geometry = geojson.geometry
|
|
51
|
+
const properties = geojson.properties
|
|
52
|
+
if (geometry && properties && properties.geodesic) {
|
|
53
|
+
if (geometry.type === 'LineString') {
|
|
54
|
+
return new L.Geodesic([L.GeoJSON.coordsToLatLngs(geometry.coordinates, 0)],
|
|
55
|
+
Object.assign({ steps: 4 }, options.style(geojson)))
|
|
56
|
+
} else if (geometry.type === 'MultiLineString') {
|
|
57
|
+
const coords = geometry.coordinates.map((lineString) => L.GeoJSON.coordsToLatLngs(lineString, 0))
|
|
58
|
+
return new L.Geodesic(coords, Object.assign({ steps: 4 }, options.style(geojson)))
|
|
59
|
+
} else if (geometry.type === 'Point') {
|
|
60
|
+
const layer = new L.GeodesicCircle(L.GeoJSON.coordsToLatLng(geometry.coordinates),
|
|
61
|
+
Object.assign({ fill: true, steps: 360, radius: properties.radius }, options.style(geojson)))
|
|
62
|
+
return layer
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (geometry && properties && properties.gradient) {
|
|
66
|
+
if (geometry.type === 'LineString') {
|
|
67
|
+
const style = options.style(geojson)
|
|
68
|
+
return properties.svg ? buildSVGOverlayFromGradientPath(geojson, style) : new GradientPath(geojson, style)
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (geometry && properties && properties.mask) {
|
|
72
|
+
if (geometry.type === 'Polygon' || geometry.type === 'MultiPolygon') {
|
|
73
|
+
return new MaskLayer(geojson, options.style(geojson))
|
|
74
|
+
}
|
|
75
|
+
}// Automate Leaflet.PolylineOffset plugin use
|
|
76
|
+
if (geometry && properties && properties.offset) {
|
|
77
|
+
if (geometry.type === 'LineString') {
|
|
78
|
+
options = Object.assign({ offset: properties.offset }, options)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// As we do so this breaks leaflet-arrowheads plugin
|
|
82
|
+
const layer = geometryToLayer(geojson, options)
|
|
83
|
+
if (geometry && (options.arrowheads || (properties && properties.arrowheads))) {
|
|
84
|
+
if (layer instanceof L.Polyline) layer.arrowheads(options.arrowheads || properties.arrowheads)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return layer
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function getUpdateFeatureFunction(leafletOptions) {
|
|
91
|
+
const updateFeature = (feature, oldLayer) => {
|
|
92
|
+
// A new feature is coming, create it
|
|
93
|
+
if (!oldLayer) return
|
|
94
|
+
const oldType = _.get(oldLayer, 'feature.geometry.type')
|
|
95
|
+
const type = _.get(feature, 'geometry.type')
|
|
96
|
+
// The feature is changing its geometry type, recreate it
|
|
97
|
+
if (type !== oldType) return
|
|
98
|
+
const staticGeometry = _.get(leafletOptions, 'staticGeometry', false)
|
|
99
|
+
// Keep track of previous geometry if we don't want to update it
|
|
100
|
+
// Indeed, styling might depend on it
|
|
101
|
+
if (staticGeometry) feature.geometry = _.get(oldLayer, 'feature.geometry')
|
|
102
|
+
// Now update coordinates if not static geometry
|
|
103
|
+
if (staticGeometry) return oldLayer
|
|
104
|
+
// An existing one is found, simply update styling, properties, etc.
|
|
105
|
+
leafletOptions.onEachFeature(feature, oldLayer)
|
|
106
|
+
if (oldLayer.setStyle) {
|
|
107
|
+
// Some vector layers can be used for points, eg circleMarker,
|
|
108
|
+
// in this case we use marker styling instead of lines/polygons styling
|
|
109
|
+
if (feature.geometry.type === 'Point') {
|
|
110
|
+
// FIXME: updating style in place does not seem to work, so for now we recreate the whole marker
|
|
111
|
+
// oldLayer.setStyle(leafletOptions.pointToLayer(feature))
|
|
112
|
+
return
|
|
113
|
+
} else {
|
|
114
|
+
// Updating style in place does not seem to work when involving panes
|
|
115
|
+
if (_.get(oldLayer.feature, 'style.pane') !== _.get(feature, 'style.pane')) return
|
|
116
|
+
else oldLayer.setStyle(leafletOptions.style(feature))
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// We want to restore values that were there till now but are missing from the input feature.
|
|
120
|
+
// Deep for time and runtime that might contain objects with variables
|
|
121
|
+
_.defaultsDeep(feature, _.pick(oldLayer.feature, ['time', 'runTime']))
|
|
122
|
+
// _NOT_ deep for properties, otherwise it'll merge array and object properties between the two
|
|
123
|
+
const oldProps = _.get(oldLayer.feature, 'properties')
|
|
124
|
+
if (oldProps) {
|
|
125
|
+
if (!feature.properties) feature.properties = {}
|
|
126
|
+
_.defaults(feature.properties, oldProps)
|
|
127
|
+
}
|
|
128
|
+
if (oldLayer.setIcon) {
|
|
129
|
+
// FIXME: updating icon in place requires to recreate it anyway, so for now we recreate the whole marker
|
|
130
|
+
// oldLayer.setIcon(_.get(leafletOptions.pointToLayer(feature, oldLayer.getLatLng()), 'options.icon'))
|
|
131
|
+
return
|
|
132
|
+
}
|
|
133
|
+
const coordinates = feature.geometry.coordinates
|
|
134
|
+
// FIXME: support others geometry types ?
|
|
135
|
+
switch (type) {
|
|
136
|
+
case 'Point':
|
|
137
|
+
oldLayer.setLatLng(L.GeoJSON.coordsToLatLngs(coordinates))
|
|
138
|
+
break
|
|
139
|
+
case 'LineString':
|
|
140
|
+
case 'MultiLineString':
|
|
141
|
+
if (typeof oldLayer.setData === 'function') {
|
|
142
|
+
// Support Gradient Path
|
|
143
|
+
oldLayer.setData(feature)
|
|
144
|
+
} else if (feature.properties.geodesic) {
|
|
145
|
+
// Support geodesic line & linestrings
|
|
146
|
+
const latlngs = type === 'LineString'
|
|
147
|
+
? [L.GeoJSON.coordsToLatLngs(coordinates, 0)]
|
|
148
|
+
: coordinates.map((linestring) => L.GeoJSON.coordsToLatLngs(linestring, 0))
|
|
149
|
+
oldLayer.setLatLngs(latlngs)
|
|
150
|
+
} else {
|
|
151
|
+
oldLayer.setLatLngs(L.GeoJSON.coordsToLatLngs(coordinates, type === 'LineString' ? 0 : 1))
|
|
152
|
+
}
|
|
153
|
+
break
|
|
154
|
+
case 'Polygon':
|
|
155
|
+
case 'MultiPolygon':
|
|
156
|
+
oldLayer.setLatLngs(L.GeoJSON.coordsToLatLngs(coordinates, type === 'Polygon' ? 1 : 2))
|
|
157
|
+
break
|
|
158
|
+
}
|
|
159
|
+
return oldLayer
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return updateFeature
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export const GeoJsonLeafletLayerFilters = {
|
|
166
|
+
// Filter to identify layers that require an update at a given frequency
|
|
167
|
+
TimeUpdate: {
|
|
168
|
+
// Possible for realtime layers only
|
|
169
|
+
'leaflet.type': 'geoJson',
|
|
170
|
+
'leaflet.realtime': true,
|
|
171
|
+
$or: [ // Supported by template URL or time-based features service
|
|
172
|
+
{ 'leaflet.sourceTemplate': { $exists: true } },
|
|
173
|
+
{ service: { $exists: true } }
|
|
174
|
+
],
|
|
175
|
+
// Skip layers powered by realtime service events
|
|
176
|
+
serviceEvents: { $ne: true },
|
|
177
|
+
// Skip invisible layers
|
|
178
|
+
isVisible: true
|
|
179
|
+
},
|
|
180
|
+
// Filter to identify layers with variables affected by a unit change
|
|
181
|
+
UnitUpdate: {
|
|
182
|
+
'leaflet.type': 'geoJson',
|
|
183
|
+
'leaflet.realtime': true,
|
|
184
|
+
// Not sure why but this does not seem to work with sift
|
|
185
|
+
//'variables': { $elemMatch: { unit: { $in: units } } },
|
|
186
|
+
'variables': { $exists: true },
|
|
187
|
+
isVisible: true,
|
|
188
|
+
$or: [{
|
|
189
|
+
'leaflet.style': { $exists: true },
|
|
190
|
+
'leaflet.template': { $exists: true }
|
|
191
|
+
}, {
|
|
192
|
+
'leaflet.tooltip.template': { $exists: true }
|
|
193
|
+
}]
|
|
194
|
+
},
|
|
195
|
+
// Filter to identify layers with tooltip defining a minZoom/maxZoom
|
|
196
|
+
// thus affected by a zoom change
|
|
197
|
+
TooltipUpdate: {
|
|
198
|
+
'leaflet.type': 'geoJson',
|
|
199
|
+
'leaflet.realtime': true,
|
|
200
|
+
isVisible: true,
|
|
201
|
+
// Supported by permanent tooltips only
|
|
202
|
+
'leaflet.tooltip.options.permanent': true,
|
|
203
|
+
$or: [
|
|
204
|
+
{ 'leaflet.tooltip.minZoom': { $exists: true } },
|
|
205
|
+
{ 'leaflet.tooltip.maxZoom': { $exists: true } }
|
|
206
|
+
]
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export function hasUnitInLeafletLayerTemplate(units, layer) {
|
|
211
|
+
const unit = _.intersection(units, _.map(layer.variables, 'unit'))
|
|
212
|
+
if (_.isEmpty(unit)) return false
|
|
213
|
+
if (_.get(layer, 'leaflet.tooltip.template', '').includes('Units')) return true
|
|
214
|
+
for (const template of layer.leaflet.template) {
|
|
215
|
+
if (template.startsWith('style.')) {
|
|
216
|
+
const style = _.get(layer.leaflet, template)
|
|
217
|
+
if ((typeof style === 'string') && style.includes('Units')) return true
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return false
|
|
221
|
+
}
|
|
@@ -140,7 +140,8 @@ export function convertLineStyleToLeafletPath (style) {
|
|
|
140
140
|
export function convertPolygonStyleToLeafletPath (style) {
|
|
141
141
|
if (!style) return
|
|
142
142
|
let leafletStyle = convertStyle(style, PolygonStyleToLeafletPath)
|
|
143
|
-
Object.assign(leafletStyle, convertLineStyleToLeafletPath(style.stroke))
|
|
143
|
+
if (style.stroke) Object.assign(leafletStyle, convertLineStyleToLeafletPath(style.stroke))
|
|
144
|
+
else leafletStyle.stroke = false
|
|
144
145
|
// handle quasar/default color if needed
|
|
145
146
|
leafletStyle.fillColor = kdkCoreUtils.getHtmlColor(leafletStyle.fillColor, 'black')
|
|
146
147
|
return leafletStyle
|
|
@@ -165,8 +166,8 @@ function processStyle (style, feature, options, mappings) {
|
|
|
165
166
|
|
|
166
167
|
// visibility attribute can be used to hide individual features
|
|
167
168
|
// visibility is true by default but can also be a string when it's
|
|
168
|
-
// a result of a lodash
|
|
169
|
-
let visibility = _.get(style, 'style.visibility', true)
|
|
169
|
+
// a result of a lodash string template evaluation
|
|
170
|
+
let visibility = _.get(style, `style.${type}.visibility`, _.get(style, 'style.visibility', true))
|
|
170
171
|
if (typeof visibility === 'string') visibility = visibility === 'true'
|
|
171
172
|
// The 'kdk-hidden-features' pane is created when the leaflet map is initialized
|
|
172
173
|
if (!visibility) _.set(style, `style.${type}.pane`, 'kdk-hidden-features')
|
|
@@ -182,26 +183,26 @@ function processStyle (style, feature, options, mappings) {
|
|
|
182
183
|
export function getDefaultPointStyle (feature, options, engine, engineStylePath = 'style.point') {
|
|
183
184
|
const engineStyle = _.get(engine, engineStylePath, {})
|
|
184
185
|
const layerStyle = options ? _.get(options.leaflet || options, 'layerPointStyle') : {}
|
|
186
|
+
const templateStyle = processStyle({ style: { point: _.merge({}, engineStyle, layerStyle) } }, feature, options, PointStyleTemplateMappings)
|
|
185
187
|
const featureStyle = feature.style ? _.get(feature, 'style', {}) : convertSimpleStyleToPointStyle(feature.properties)
|
|
186
|
-
const style = _.merge({}, engineStyle, layerStyle, featureStyle)
|
|
187
|
-
processStyle({ style: { point: style } }, feature, options, PointStyleTemplateMappings)
|
|
188
|
+
const style = _.merge({}, engineStyle, layerStyle, templateStyle ? templateStyle.style.point : {}, featureStyle)
|
|
188
189
|
return style
|
|
189
190
|
}
|
|
190
191
|
|
|
191
192
|
export function getDefaultLineStyle (feature, options, engine, engineStylePath = 'style.line') {
|
|
192
193
|
const engineStyle = _.get(engine, engineStylePath, {})
|
|
193
194
|
const layerStyle = options ? _.get(options.leaflet || options, 'layerLineStyle') : {}
|
|
195
|
+
const templateStyle = processStyle({ style: { line: _.merge({}, engineStyle, layerStyle) } }, feature, options, LineStyleTemplateMappings)
|
|
194
196
|
const featureStyle = feature.style ? _.get(feature, 'style', {}) : convertSimpleStyleToLineStyle(feature.properties)
|
|
195
|
-
const style = _.merge({}, engineStyle, layerStyle, featureStyle)
|
|
196
|
-
processStyle({ style: { line: style } }, feature, options, LineStyleTemplateMappings)
|
|
197
|
+
const style = _.merge({}, engineStyle, layerStyle, templateStyle ? templateStyle.style.line : {}, featureStyle)
|
|
197
198
|
return convertLineStyleToLeafletPath(style)
|
|
198
199
|
}
|
|
199
200
|
|
|
200
201
|
export function getDefaultPolygonStyle (feature, options, engine, engineStylePath = 'style.polygon') {
|
|
201
202
|
const engineStyle = _.get(engine, engineStylePath, {})
|
|
202
203
|
const layerStyle = options ? _.get(options.leaflet || options, 'layerPolygonStyle') : {}
|
|
204
|
+
const templateStyle = processStyle({ style: { polygon: _.merge({}, engineStyle, layerStyle) } }, feature, options, PolygonStyleTemplateMappings)
|
|
203
205
|
const featureStyle = feature.style ? _.get(feature, 'style', {}) : convertSimpleStyleToPolygonStyle(feature.properties)
|
|
204
|
-
const style = _.merge({}, engineStyle, layerStyle, featureStyle)
|
|
205
|
-
processStyle({ style: { polygon: style } }, feature, options, PolygonStyleTemplateMappings)
|
|
206
|
+
const style = _.merge({}, engineStyle, layerStyle, templateStyle ? templateStyle.style.polygon : {}, featureStyle)
|
|
206
207
|
return convertPolygonStyleToLeafletPath(style)
|
|
207
208
|
}
|
package/map/client/map.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as composables from './composables/index.js'
|
|
2
2
|
import * as commonMixins from './mixins/index.js'
|
|
3
3
|
import * as mapMixins from './mixins/map/index.js'
|
|
4
|
+
import * as hooks from './hooks/index.js'
|
|
4
5
|
import * as utils from './utils.map.js'
|
|
5
6
|
import init from './init.js'
|
|
6
7
|
|
|
@@ -8,6 +9,8 @@ const mixins = Object.assign({}, commonMixins, { map: mapMixins })
|
|
|
8
9
|
|
|
9
10
|
export * from './geolocation.js'
|
|
10
11
|
export * from './planets.js'
|
|
12
|
+
export * from './navigator.js'
|
|
13
|
+
export { hooks }
|
|
11
14
|
export { utils }
|
|
12
15
|
export { composables }
|
|
13
16
|
export { mixins }
|
|
@@ -9,6 +9,8 @@ import { Ion, Viewer, Color, viewerCesiumInspectorMixin, Rectangle, ScreenSpaceE
|
|
|
9
9
|
import 'cesium/Source/Widgets/widgets.css'
|
|
10
10
|
import { Geolocation } from '../../geolocation.js'
|
|
11
11
|
import { Cesium, convertCesiumHandlerEvent, isTerrainLayer, convertEntitiesToGeoJson, createCesiumObject } from '../../utils.globe.js'
|
|
12
|
+
import { generateLayerDefinition } from '../../utils/utils.layers.js'
|
|
13
|
+
|
|
12
14
|
// The URL on our server where CesiumJS's static files are hosted
|
|
13
15
|
window.CESIUM_BASE_URL = '/Cesium/'
|
|
14
16
|
buildModuleUrl.setBaseUrl('/Cesium/')
|
|
@@ -29,23 +31,24 @@ export const baseGlobe = {
|
|
|
29
31
|
methods: {
|
|
30
32
|
refreshGlobe () {
|
|
31
33
|
},
|
|
32
|
-
setupGlobe (domEl, token, options) {
|
|
33
|
-
this.viewerOptions = options
|
|
34
|
-
//
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
34
|
+
setupGlobe (domEl, token, options = {}) {
|
|
35
|
+
this.viewerOptions = _.defaults(options, _.get(this, 'activityOptions.engine.viewer', {}), {
|
|
36
|
+
sceneMode: 3, // SceneMode.COLUMBUS_VIEW = 1, SceneMode.SCENE3D = 3,
|
|
37
|
+
sceneModePicker: false,
|
|
38
|
+
infoBox: false,
|
|
39
|
+
scene3DOnly: true,
|
|
40
|
+
homeButton: false,
|
|
41
|
+
geocoder: false,
|
|
42
|
+
navigationHelpButton: false,
|
|
43
|
+
baseLayer: false,
|
|
44
|
+
baseLayerPicker: false,
|
|
45
|
+
vrButton: false,
|
|
46
|
+
fullscreenButton: false,
|
|
47
|
+
animation: false,
|
|
48
|
+
timeline: false,
|
|
49
|
+
depthTestAgainstTerrain: false,
|
|
50
|
+
cameraMoveEventPercentage: 0.2
|
|
51
|
+
})
|
|
49
52
|
if (token) Ion.defaultAccessToken = token
|
|
50
53
|
// If we don't need ion
|
|
51
54
|
else Ion.defaultAccessToken = ''
|
|
@@ -55,6 +58,7 @@ export const baseGlobe = {
|
|
|
55
58
|
terrainProviderViewModels: []
|
|
56
59
|
})
|
|
57
60
|
this.viewer = new Viewer(domEl, this.viewerOptions)
|
|
61
|
+
this.viewer.scene.globe.depthTestAgainstTerrain = _.get(this.viewerOptions, 'depthTestAgainstTerrain', false)
|
|
58
62
|
const backgroundColor = _.get(this.viewerOptions, 'backgroundColor')
|
|
59
63
|
this.viewer.scene.backgroundColor = (backgroundColor ? createCesiumObject('Color', ...backgroundColor) : Color.BLACK)
|
|
60
64
|
if (this.viewer.scene.globe) {
|
|
@@ -63,8 +67,24 @@ export const baseGlobe = {
|
|
|
63
67
|
const undergroundColor = _.get(this.viewerOptions, 'undergroundColor')
|
|
64
68
|
this.viewer.scene.globe.undergroundColor = (undergroundColor ? createCesiumObject('Color', ...undergroundColor) : Color.BLACK)
|
|
65
69
|
}
|
|
70
|
+
|
|
71
|
+
// Cesium pre-render callback used to update moving materials (animated walls/corridors)
|
|
72
|
+
this.viewer.scene.preRender.addEventListener(() => {
|
|
73
|
+
if (!this.cesiumMaterials) return
|
|
74
|
+
_.forEach(this.cesiumMaterials, m => {
|
|
75
|
+
if (!m.material.uniforms.offset) return
|
|
76
|
+
if (!m.startTime) m.startTime = Date.now()
|
|
77
|
+
|
|
78
|
+
const elapsed = (Date.now() - m.startTime) * 0.001
|
|
79
|
+
if (m.animationSpeed) {
|
|
80
|
+
const loopDuration = (m.length / m.material.uniforms.repeat.x) / m.animationSpeed
|
|
81
|
+
m.material.uniforms.offset.x = (elapsed % loopDuration) / loopDuration
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
})
|
|
85
|
+
|
|
66
86
|
// Debug mode ?
|
|
67
|
-
//this.viewerOptions.debug = true
|
|
87
|
+
// this.viewerOptions.debug = true
|
|
68
88
|
if (this.viewerOptions.debug) this.viewer.extend(viewerCesiumInspectorMixin)
|
|
69
89
|
// Cesium always create a default provider when a globe is used
|
|
70
90
|
if (this.viewer.scene.imageryLayers) this.viewer.scene.imageryLayers.removeAll()
|
|
@@ -72,6 +92,10 @@ export const baseGlobe = {
|
|
|
72
92
|
this.registerCesiumHandler(this.getDefaultPickHandler, 'MOUSE_MOVE')
|
|
73
93
|
this.registerCesiumHandler(this.getDefaultPickHandler, 'LEFT_CLICK')
|
|
74
94
|
this.registerCesiumHandler(this.getDefaultPickHandler, 'RIGHT_CLICK')
|
|
95
|
+
this.viewer.camera.moveStart.addEventListener(this.onCameraMoveStart)
|
|
96
|
+
this.viewer.camera.moveEnd.addEventListener(this.onCameraMoveEnd)
|
|
97
|
+
this.viewer.camera.percentageChanged = this.viewerOptions.cameraMoveEventPercentage
|
|
98
|
+
this.viewer.camera.changed.addEventListener(this.onCameraChanged)
|
|
75
99
|
// Remove default Cesium handlers
|
|
76
100
|
this.viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(ScreenSpaceEventType.LEFT_CLICK)
|
|
77
101
|
this.viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(ScreenSpaceEventType.LEFT_DOUBLE_CLICK)
|
|
@@ -227,6 +251,9 @@ export const baseGlobe = {
|
|
|
227
251
|
cesiumLayer.show = true
|
|
228
252
|
if (!this.viewer.scene.primitives.contains(cesiumLayer)) this.viewer.scene.primitives.add(cesiumLayer)
|
|
229
253
|
} else { // Entity data source otherwise
|
|
254
|
+
// Handle potential custom primitives
|
|
255
|
+
for (const [id, custom] of cesiumLayer.primitives)
|
|
256
|
+
custom.primitive.show = true
|
|
230
257
|
this.viewer.dataSources.add(cesiumLayer)
|
|
231
258
|
}
|
|
232
259
|
layer.isVisible = true
|
|
@@ -253,6 +280,9 @@ export const baseGlobe = {
|
|
|
253
280
|
} else if (cesiumLayer instanceof Cesium3DTileset) {
|
|
254
281
|
cesiumLayer.show = false
|
|
255
282
|
} else { // Entity data source otherwise
|
|
283
|
+
// Hide custom primitives before removing the data source
|
|
284
|
+
for (const [id, custom] of cesiumLayer.primitives)
|
|
285
|
+
custom.primitive.show = false
|
|
256
286
|
this.viewer.dataSources.remove(cesiumLayer, true)
|
|
257
287
|
}
|
|
258
288
|
this.onLayerHidden(layer, cesiumLayer)
|
|
@@ -277,6 +307,16 @@ export const baseGlobe = {
|
|
|
277
307
|
this.$emit('layer-added', layer)
|
|
278
308
|
this.$engineEvents.emit('layer-added', layer)
|
|
279
309
|
},
|
|
310
|
+
async addGeoJsonLayer (layerSpec, geoJson) {
|
|
311
|
+
if (!generateLayerDefinition(layerSpec, geoJson)) return
|
|
312
|
+
// Create an empty layer
|
|
313
|
+
await this.addLayer(layerSpec)
|
|
314
|
+
// Update the layer with the geoJson content
|
|
315
|
+
await this.updateLayer(layerSpec.name, geoJson)
|
|
316
|
+
// Zoom to the layer
|
|
317
|
+
if (geoJson.bbox) this.zoomToBBox(geoJson.bbox)
|
|
318
|
+
else this.zoomToLayer(layerSpec.name)
|
|
319
|
+
},
|
|
280
320
|
renameLayer (previousName, newName) {
|
|
281
321
|
const layer = this.getLayerByName(previousName)
|
|
282
322
|
const cesiumLayer = this.getCesiumLayerByName(previousName)
|
|
@@ -312,6 +352,13 @@ export const baseGlobe = {
|
|
|
312
352
|
Object.keys(this.layers).forEach((layer) => this.removeLayer(layer))
|
|
313
353
|
},
|
|
314
354
|
async toGeoJson (name) {
|
|
355
|
+
if (!this.isLayerVisible(name)) {
|
|
356
|
+
// Only lookup geojson cache when layer is not visible
|
|
357
|
+
// otherwise use toGeoJSON() on the layer to get most up to date content.
|
|
358
|
+
const cachedGeojson = this.geojsonCache[name]
|
|
359
|
+
if (cachedGeojson) return cachedGeojson
|
|
360
|
+
}
|
|
361
|
+
|
|
315
362
|
const layer = this.getCesiumLayerByName(name)
|
|
316
363
|
if (!layer.entities) return
|
|
317
364
|
const geoJson = await convertEntitiesToGeoJson(layer.entities)
|
|
@@ -390,7 +437,7 @@ export const baseGlobe = {
|
|
|
390
437
|
if (this.viewerOptions.debug) {
|
|
391
438
|
const baseQuaternion = Transforms.headingPitchRollQuaternion(destination, orientation, Ellipsoid.WGS84, Transforms.eastNorthUpToFixedFrame)
|
|
392
439
|
const cameraQuaternion = Transforms.headingPitchRollQuaternion(this.viewer.camera.positionWC,
|
|
393
|
-
|
|
440
|
+
new HeadingPitchRoll(this.viewer.camera.heading, this.viewer.camera.pitch, this.viewer.camera.roll), Ellipsoid.WGS84, Transforms.eastNorthUpToFixedFrame)
|
|
394
441
|
if (this.baseFrameDebug) {
|
|
395
442
|
this.baseFrameDebug.modelMatrix = Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(baseQuaternion), destination)
|
|
396
443
|
this.finalFrameDebug.modelMatrix = Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(cameraQuaternion), this.viewer.camera.positionWC)
|
|
@@ -434,6 +481,17 @@ export const baseGlobe = {
|
|
|
434
481
|
const east = CesiumMath.toDegrees(bounds.east)
|
|
435
482
|
return [[south, west], [north, east]]
|
|
436
483
|
},
|
|
484
|
+
getCamera () {
|
|
485
|
+
const position = this.viewer.camera.positionCartographic
|
|
486
|
+
return {
|
|
487
|
+
longitude: CesiumMath.toDegrees(position.longitude),
|
|
488
|
+
latitude: CesiumMath.toDegrees(position.latitude),
|
|
489
|
+
altitude: position.height,
|
|
490
|
+
heading: CesiumMath.toDegrees(this.viewer.camera.heading),
|
|
491
|
+
pitch: CesiumMath.toDegrees(this.viewer.camera.pitch),
|
|
492
|
+
roll: CesiumMath.toDegrees(this.viewer.camera.roll)
|
|
493
|
+
}
|
|
494
|
+
},
|
|
437
495
|
onEntityTracked (time) {
|
|
438
496
|
if (this.viewerOptions.debug) {
|
|
439
497
|
if (this.trackedFrameDebug) {
|
|
@@ -603,11 +661,80 @@ export const baseGlobe = {
|
|
|
603
661
|
}
|
|
604
662
|
// Mimic Leaflet events
|
|
605
663
|
this.$engineEvents.emit(event.originalEvent.name, options, emittedEvent)
|
|
664
|
+
},
|
|
665
|
+
getCameraEllipsoidTarget () {
|
|
666
|
+
const windowPosition = new Cesium.Cartesian2(this.viewer.container.clientWidth / 2, this.viewer.container.clientHeight / 2)
|
|
667
|
+
const pickedPosition = this.viewer.camera.pickEllipsoid(windowPosition)
|
|
668
|
+
if (!pickedPosition) return null
|
|
669
|
+
const pickedPositionCartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(pickedPosition)
|
|
670
|
+
return {
|
|
671
|
+
longitude: CesiumMath.toDegrees(pickedPositionCartographic.longitude),
|
|
672
|
+
latitude: CesiumMath.toDegrees(pickedPositionCartographic.latitude),
|
|
673
|
+
altitude: pickedPositionCartographic.height
|
|
674
|
+
}
|
|
675
|
+
},
|
|
676
|
+
onCameraMoveStart () {
|
|
677
|
+
let target = this.getCameraEllipsoidTarget()
|
|
678
|
+
if (target) {
|
|
679
|
+
target = { latlng: { lng: target.longitude, lat: target.latitude }, altitude: target.altitude }
|
|
680
|
+
}
|
|
681
|
+
// Mimic Leaflet events
|
|
682
|
+
this.$engineEvents.emit('movestart', this.viewerOptions, target)
|
|
683
|
+
},
|
|
684
|
+
onCameraMoveEnd () {
|
|
685
|
+
let target = this.getCameraEllipsoidTarget()
|
|
686
|
+
if (target) {
|
|
687
|
+
target = { latlng: { lng: target.longitude, lat: target.latitude }, altitude: target.altitude }
|
|
688
|
+
}
|
|
689
|
+
// Mimic Leaflet events
|
|
690
|
+
this.$engineEvents.emit('moveend', this.viewerOptions, target)
|
|
691
|
+
},
|
|
692
|
+
onCameraChanged () {
|
|
693
|
+
let target = this.getCameraEllipsoidTarget()
|
|
694
|
+
if (target) {
|
|
695
|
+
target = { latlng: { lng: target.longitude, lat: target.latitude }, altitude: target.altitude }
|
|
696
|
+
}
|
|
697
|
+
// Mimic Leaflet events
|
|
698
|
+
this.$engineEvents.emit('move', this.viewerOptions, target)
|
|
699
|
+
},
|
|
700
|
+
getPostProcessStage (effect) {
|
|
701
|
+
return this.cesiumPostProcessStages[effect]
|
|
702
|
+
},
|
|
703
|
+
setupPostProcess (effect, options = { enabled: true }) {
|
|
704
|
+
let stage = this.cesiumPostProcessStages[effect]
|
|
705
|
+
if (options.enabled) {
|
|
706
|
+
if (!stage) {
|
|
707
|
+
if (effect === 'desaturation') {
|
|
708
|
+
const fs = `
|
|
709
|
+
uniform sampler2D colorTexture;
|
|
710
|
+
in vec2 v_textureCoordinates;
|
|
711
|
+
void main() {
|
|
712
|
+
vec4 color = texture(colorTexture, v_textureCoordinates);
|
|
713
|
+
if (czm_selected()) {
|
|
714
|
+
out_FragColor = color;
|
|
715
|
+
} else {
|
|
716
|
+
out_FragColor = vec4(czm_saturation(color.rgb, 0.0), color.a);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
`
|
|
720
|
+
stage = this.viewer.scene.postProcessStages.add(new Cesium.PostProcessStage({ fragmentShader: fs }))
|
|
721
|
+
stage.selected = [] // Initialize empty selected set for postprocess.
|
|
722
|
+
this.cesiumPostProcessStages[effect] = stage
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
} else {
|
|
726
|
+
if (stage) {
|
|
727
|
+
this.viewer.scene.postProcessStages.remove(stage)
|
|
728
|
+
delete this.cesiumPostProcessStages[effect]
|
|
729
|
+
}
|
|
730
|
+
}
|
|
606
731
|
}
|
|
607
732
|
},
|
|
608
733
|
created () {
|
|
609
734
|
this.cesiumLayers = {}
|
|
610
735
|
this.cesiumFactory = []
|
|
736
|
+
this.cesiumMaterials = []
|
|
737
|
+
this.cesiumPostProcessStages = {}
|
|
611
738
|
// TODO: no specific marker, just keep status
|
|
612
739
|
this.userLocation = false
|
|
613
740
|
// Internal event bus
|
|
@@ -615,6 +742,11 @@ export const baseGlobe = {
|
|
|
615
742
|
},
|
|
616
743
|
beforeUnmount () {
|
|
617
744
|
this.clearLayers()
|
|
745
|
+
this.viewer.camera.moveStart.removeEventListener(this.onCameraMoveStart)
|
|
746
|
+
this.viewer.camera.moveEnd.removeEventListener(this.onCameraMoveEnd)
|
|
747
|
+
this.unregisterCesiumHandler('MOUSE_MOVE')
|
|
748
|
+
this.unregisterCesiumHandler('LEFT_CLICK')
|
|
749
|
+
this.unregisterCesiumHandler('RIGHT_CLICK')
|
|
618
750
|
},
|
|
619
751
|
unmounted () {
|
|
620
752
|
this.viewer.destroy()
|