@kalisio/kdk 2.2.2 → 2.3.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/.eslintignore +1 -0
- package/.github/workflows/main.yaml +67 -0
- package/.gitmodules +3 -0
- package/README.md +1 -2
- package/core/api/hooks/hooks.query.js +15 -2
- package/core/api/marshall.js +35 -4
- package/core/client/api.js +1 -1
- package/core/client/components/KActivity.vue +73 -0
- package/core/client/components/KContent.vue +1 -1
- package/core/client/components/KSponsor.vue +2 -13
- package/core/client/components/account/KDeleteAccountManager.vue +1 -1
- package/core/client/components/account/KPasswordManager.vue +1 -1
- package/core/client/components/action/KAction.vue +294 -0
- package/core/client/components/action/KBugReportAction.vue +37 -0
- package/core/client/components/action/index.js +7 -0
- package/core/client/components/app/KAbout.vue +16 -63
- package/core/client/components/app/KPlatform.vue +1 -1
- package/core/client/components/app/KSettings.vue +14 -14
- package/core/client/components/app/KTour.vue +6 -8
- package/core/client/components/app/KWelcome.vue +1 -1
- package/core/client/components/app/index.js +4 -0
- package/core/client/components/chart/KDataTable.vue +40 -25
- package/core/client/components/chart/KTimeSeriesChart.vue +20 -12
- package/core/client/components/collection/KCard.vue +1 -1
- package/core/client/components/collection/KCardSection.vue +3 -2
- package/core/client/components/collection/KColumn.vue +1 -1
- package/core/client/components/collection/KFilter.vue +6 -1
- package/core/client/components/document/KDocument.vue +83 -0
- package/core/client/components/document/KHtml.vue +23 -0
- package/core/client/components/document/KMarkdown.vue +37 -0
- package/core/client/components/document/index.js +9 -0
- package/core/client/components/form/KForm.vue +6 -2
- package/core/client/components/form/KSelectField.vue +1 -1
- package/core/client/components/index.js +1 -4
- package/core/client/components/input/KOptionsChooser.vue +1 -1
- package/core/client/components/layout/KFab.vue +1 -1
- package/core/client/components/layout/KPage.vue +3 -2
- package/core/client/components/layout/KWindow.vue +1 -1
- package/core/client/components/media/KColorScale.vue +16 -6
- package/core/client/components/screen/KLoginScreen.vue +1 -1
- package/core/client/components/screen/KRegisterScreen.vue +1 -1
- package/core/client/components/team/KAddMember.vue +7 -7
- package/core/client/components/team/KGroupCard.vue +1 -1
- package/core/client/components/team/KMemberFilter.vue +1 -1
- package/core/client/components/team/KTagCard.vue +1 -1
- package/core/client/components/time/KRelativeTimeRanges.vue +16 -1
- package/core/client/components/time/KTimeControl.vue +1 -0
- package/core/client/components/tool/KExportTool.vue +1 -1
- package/core/client/composables/collection.js +1 -1
- package/core/client/composables/index.js +1 -0
- package/core/client/composables/layout.js +50 -0
- package/core/client/composables/session.js +6 -0
- package/core/client/filter.js +9 -6
- package/core/client/guards.js +29 -6
- package/core/client/i18n/core_en.json +4 -1
- package/core/client/i18n/core_fr.json +8 -5
- package/core/client/i18n.js +14 -0
- package/core/client/layout.js +25 -14
- package/core/client/mixins/mixin.base-activity.js +16 -0
- package/core/client/services/index.js +27 -26
- package/core/client/services/local-settings.service.js +2 -3
- package/core/client/units.js +6 -1
- package/core/client/utils/index.js +3 -0
- package/core/client/utils/utils.actions.js +93 -0
- package/core/client/utils/utils.colors.js +1 -1
- package/core/client/utils/utils.data.js +22 -0
- package/core/client/utils/utils.shapes.js +16 -6
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/core/api/application.js.html +1870 -0
- package/coverage/core/api/authentication.js.html +742 -0
- package/coverage/core/api/db.js.html +778 -0
- package/coverage/core/api/hooks/hooks.authentication.js.html +313 -0
- package/coverage/core/api/hooks/hooks.authorisations.js.html +1243 -0
- package/coverage/core/api/hooks/hooks.groups.js.html +229 -0
- package/coverage/core/api/hooks/hooks.logger.js.html +163 -0
- package/coverage/core/api/hooks/hooks.model.js.html +955 -0
- package/coverage/core/api/hooks/hooks.organisations.js.html +541 -0
- package/coverage/core/api/hooks/hooks.push.js.html +253 -0
- package/coverage/core/api/hooks/hooks.query.js.html +862 -0
- package/coverage/core/api/hooks/hooks.schemas.js.html +304 -0
- package/coverage/core/api/hooks/hooks.service.js.html +319 -0
- package/coverage/core/api/hooks/hooks.storage.js.html +193 -0
- package/coverage/core/api/hooks/hooks.users.js.html +868 -0
- package/coverage/core/api/hooks/index.html +296 -0
- package/coverage/core/api/hooks/index.js.html +121 -0
- package/coverage/core/api/index.html +191 -0
- package/coverage/core/api/index.js.html +148 -0
- package/coverage/core/api/marshall.js.html +448 -0
- package/coverage/core/api/models/groups.model.mongodb.js.html +109 -0
- package/coverage/core/api/models/index.html +161 -0
- package/coverage/core/api/models/organisations.model.mongodb.js.html +94 -0
- package/coverage/core/api/models/tags.model.mongodb.js.html +115 -0
- package/coverage/core/api/models/users.model.mongodb.js.html +115 -0
- package/coverage/core/api/services/account/account.hooks.js.html +208 -0
- package/coverage/core/api/services/account/account.service.js.html +436 -0
- package/coverage/core/api/services/account/index.html +131 -0
- package/coverage/core/api/services/authorisations/authorisations.hooks.js.html +184 -0
- package/coverage/core/api/services/authorisations/authorisations.service.js.html +502 -0
- package/coverage/core/api/services/authorisations/index.html +131 -0
- package/coverage/core/api/services/databases/databases.hooks.js.html +193 -0
- package/coverage/core/api/services/databases/databases.service.js.html +100 -0
- package/coverage/core/api/services/databases/index.html +131 -0
- package/coverage/core/api/services/groups/groups.hooks.js.html +178 -0
- package/coverage/core/api/services/groups/index.html +116 -0
- package/coverage/core/api/services/import-export/import-export.hooks.js.html +184 -0
- package/coverage/core/api/services/import-export/import-export.service.js.html +118 -0
- package/coverage/core/api/services/import-export/index.html +131 -0
- package/coverage/core/api/services/index.html +116 -0
- package/coverage/core/api/services/index.js.html +499 -0
- package/coverage/core/api/services/mailer/index.html +131 -0
- package/coverage/core/api/services/mailer/mailer.hooks.js.html +190 -0
- package/coverage/core/api/services/mailer/mailer.service.js.html +118 -0
- package/coverage/core/api/services/organisations/index.html +131 -0
- package/coverage/core/api/services/organisations/organisations.hooks.js.html +178 -0
- package/coverage/core/api/services/organisations/organisations.service.js.html +343 -0
- package/coverage/core/api/services/push/index.html +131 -0
- package/coverage/core/api/services/push/push.hooks.js.html +190 -0
- package/coverage/core/api/services/push/push.service.js.html +121 -0
- package/coverage/core/api/services/storage/index.html +131 -0
- package/coverage/core/api/services/storage/storage.hooks.js.html +190 -0
- package/coverage/core/api/services/storage/storage.service.js.html +172 -0
- package/coverage/core/api/services/tags/index.html +116 -0
- package/coverage/core/api/services/tags/tags.hooks.js.html +178 -0
- package/coverage/core/api/services/users/index.html +116 -0
- package/coverage/core/api/services/users/users.hooks.js.html +307 -0
- package/coverage/core/api/utils.js.html +118 -0
- package/coverage/core/common/errors.js.html +88 -0
- package/coverage/core/common/index.html +176 -0
- package/coverage/core/common/index.js.html +115 -0
- package/coverage/core/common/permissions.js.html +1048 -0
- package/coverage/core/common/schema.js.html +190 -0
- package/coverage/core/common/utils.js.html +220 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +491 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/core/api/application.js.html +1870 -0
- package/coverage/lcov-report/core/api/authentication.js.html +742 -0
- package/coverage/lcov-report/core/api/db.js.html +778 -0
- package/coverage/lcov-report/core/api/hooks/hooks.authentication.js.html +313 -0
- package/coverage/lcov-report/core/api/hooks/hooks.authorisations.js.html +1243 -0
- package/coverage/lcov-report/core/api/hooks/hooks.groups.js.html +229 -0
- package/coverage/lcov-report/core/api/hooks/hooks.logger.js.html +163 -0
- package/coverage/lcov-report/core/api/hooks/hooks.model.js.html +955 -0
- package/coverage/lcov-report/core/api/hooks/hooks.organisations.js.html +541 -0
- package/coverage/lcov-report/core/api/hooks/hooks.push.js.html +253 -0
- package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +862 -0
- package/coverage/lcov-report/core/api/hooks/hooks.schemas.js.html +304 -0
- package/coverage/lcov-report/core/api/hooks/hooks.service.js.html +319 -0
- package/coverage/lcov-report/core/api/hooks/hooks.storage.js.html +193 -0
- package/coverage/lcov-report/core/api/hooks/hooks.users.js.html +868 -0
- package/coverage/lcov-report/core/api/hooks/index.html +296 -0
- package/coverage/lcov-report/core/api/hooks/index.js.html +121 -0
- package/coverage/lcov-report/core/api/index.html +191 -0
- package/coverage/lcov-report/core/api/index.js.html +148 -0
- package/coverage/lcov-report/core/api/marshall.js.html +448 -0
- package/coverage/lcov-report/core/api/models/groups.model.mongodb.js.html +109 -0
- package/coverage/lcov-report/core/api/models/index.html +161 -0
- package/coverage/lcov-report/core/api/models/organisations.model.mongodb.js.html +94 -0
- package/coverage/lcov-report/core/api/models/tags.model.mongodb.js.html +115 -0
- package/coverage/lcov-report/core/api/models/users.model.mongodb.js.html +115 -0
- package/coverage/lcov-report/core/api/services/account/account.hooks.js.html +208 -0
- package/coverage/lcov-report/core/api/services/account/account.service.js.html +436 -0
- package/coverage/lcov-report/core/api/services/account/index.html +131 -0
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.hooks.js.html +184 -0
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.service.js.html +502 -0
- package/coverage/lcov-report/core/api/services/authorisations/index.html +131 -0
- package/coverage/lcov-report/core/api/services/databases/databases.hooks.js.html +193 -0
- package/coverage/lcov-report/core/api/services/databases/databases.service.js.html +100 -0
- package/coverage/lcov-report/core/api/services/databases/index.html +131 -0
- package/coverage/lcov-report/core/api/services/groups/groups.hooks.js.html +178 -0
- package/coverage/lcov-report/core/api/services/groups/index.html +116 -0
- package/coverage/lcov-report/core/api/services/import-export/import-export.hooks.js.html +184 -0
- package/coverage/lcov-report/core/api/services/import-export/import-export.service.js.html +118 -0
- package/coverage/lcov-report/core/api/services/import-export/index.html +131 -0
- package/coverage/lcov-report/core/api/services/index.html +116 -0
- package/coverage/lcov-report/core/api/services/index.js.html +499 -0
- package/coverage/lcov-report/core/api/services/mailer/index.html +131 -0
- package/coverage/lcov-report/core/api/services/mailer/mailer.hooks.js.html +190 -0
- package/coverage/lcov-report/core/api/services/mailer/mailer.service.js.html +118 -0
- package/coverage/lcov-report/core/api/services/organisations/index.html +131 -0
- package/coverage/lcov-report/core/api/services/organisations/organisations.hooks.js.html +178 -0
- package/coverage/lcov-report/core/api/services/organisations/organisations.service.js.html +343 -0
- package/coverage/lcov-report/core/api/services/push/index.html +131 -0
- package/coverage/lcov-report/core/api/services/push/push.hooks.js.html +190 -0
- package/coverage/lcov-report/core/api/services/push/push.service.js.html +121 -0
- package/coverage/lcov-report/core/api/services/storage/index.html +131 -0
- package/coverage/lcov-report/core/api/services/storage/storage.hooks.js.html +190 -0
- package/coverage/lcov-report/core/api/services/storage/storage.service.js.html +172 -0
- package/coverage/lcov-report/core/api/services/tags/index.html +116 -0
- package/coverage/lcov-report/core/api/services/tags/tags.hooks.js.html +178 -0
- package/coverage/lcov-report/core/api/services/users/index.html +116 -0
- package/coverage/lcov-report/core/api/services/users/users.hooks.js.html +307 -0
- package/coverage/lcov-report/core/api/utils.js.html +118 -0
- package/coverage/lcov-report/core/common/errors.js.html +88 -0
- package/coverage/lcov-report/core/common/index.html +176 -0
- package/coverage/lcov-report/core/common/index.js.html +115 -0
- package/coverage/lcov-report/core/common/permissions.js.html +1048 -0
- package/coverage/lcov-report/core/common/schema.js.html +190 -0
- package/coverage/lcov-report/core/common/utils.js.html +220 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +491 -0
- package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +457 -0
- package/coverage/lcov-report/map/api/hooks/hooks.features.js.html +397 -0
- package/coverage/lcov-report/map/api/hooks/hooks.query.js.html +1309 -0
- package/coverage/lcov-report/map/api/hooks/index.html +161 -0
- package/coverage/lcov-report/map/api/hooks/index.js.html +94 -0
- package/coverage/lcov-report/map/api/index.html +131 -0
- package/coverage/lcov-report/map/api/index.js.html +139 -0
- package/coverage/lcov-report/map/api/marshall.js.html +178 -0
- package/coverage/lcov-report/map/api/models/alerts.model.mongodb.js.html +106 -0
- package/coverage/lcov-report/map/api/models/catalog.model.mongodb.js.html +127 -0
- package/coverage/lcov-report/map/api/models/features.model.mongodb.js.html +196 -0
- package/coverage/lcov-report/map/api/models/index.html +161 -0
- package/coverage/lcov-report/map/api/models/projects.model.mongodb.js.html +109 -0
- package/coverage/lcov-report/map/api/services/alerts/alerts.hooks.js.html +274 -0
- package/coverage/lcov-report/map/api/services/alerts/alerts.service.js.html +610 -0
- package/coverage/lcov-report/map/api/services/alerts/index.html +131 -0
- package/coverage/lcov-report/map/api/services/catalog/catalog.hooks.js.html +316 -0
- package/coverage/lcov-report/map/api/services/catalog/index.html +116 -0
- package/coverage/lcov-report/map/api/services/daptiles/daptiles.service.js.html +1510 -0
- package/coverage/lcov-report/map/api/services/daptiles/index.html +116 -0
- package/coverage/lcov-report/map/api/services/features/features.hooks.js.html +241 -0
- package/coverage/lcov-report/map/api/services/features/features.service.js.html +241 -0
- package/coverage/lcov-report/map/api/services/features/index.html +131 -0
- package/coverage/lcov-report/map/api/services/index.html +116 -0
- package/coverage/lcov-report/map/api/services/index.js.html +817 -0
- package/coverage/lcov-report/map/api/services/projects/index.html +116 -0
- package/coverage/lcov-report/map/api/services/projects/projects.hooks.js.html +439 -0
- package/coverage/lcov-report/map/common/dynamic-grid-source.js.html +466 -0
- package/coverage/lcov-report/map/common/errors.js.html +94 -0
- package/coverage/lcov-report/map/common/geotiff-grid-source.js.html +541 -0
- package/coverage/lcov-report/map/common/grid.js.html +1612 -0
- package/coverage/lcov-report/map/common/index.html +371 -0
- package/coverage/lcov-report/map/common/index.js.html +172 -0
- package/coverage/lcov-report/map/common/meteo-model-grid-source.js.html +556 -0
- package/coverage/lcov-report/map/common/moment-utils.js.html +157 -0
- package/coverage/lcov-report/map/common/opendap-grid-source.js.html +868 -0
- package/coverage/lcov-report/map/common/opendap-utils.js.html +826 -0
- package/coverage/lcov-report/map/common/permissions.js.html +124 -0
- package/coverage/lcov-report/map/common/time-based-grid-source.js.html +418 -0
- package/coverage/lcov-report/map/common/tms-utils.js.html +274 -0
- package/coverage/lcov-report/map/common/wcs-grid-source.js.html +364 -0
- package/coverage/lcov-report/map/common/wcs-utils.js.html +586 -0
- package/coverage/lcov-report/map/common/weacast-grid-source.js.html +1033 -0
- package/coverage/lcov-report/map/common/wfs-utils.js.html +574 -0
- package/coverage/lcov-report/map/common/wms-utils.js.html +451 -0
- package/coverage/lcov-report/map/common/wmts-utils.js.html +547 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov.info +11128 -0
- package/coverage/map/api/hooks/hooks.catalog.js.html +457 -0
- package/coverage/map/api/hooks/hooks.features.js.html +397 -0
- package/coverage/map/api/hooks/hooks.query.js.html +1309 -0
- package/coverage/map/api/hooks/index.html +161 -0
- package/coverage/map/api/hooks/index.js.html +94 -0
- package/coverage/map/api/index.html +131 -0
- package/coverage/map/api/index.js.html +139 -0
- package/coverage/map/api/marshall.js.html +178 -0
- package/coverage/map/api/models/alerts.model.mongodb.js.html +106 -0
- package/coverage/map/api/models/catalog.model.mongodb.js.html +127 -0
- package/coverage/map/api/models/features.model.mongodb.js.html +196 -0
- package/coverage/map/api/models/index.html +161 -0
- package/coverage/map/api/models/projects.model.mongodb.js.html +109 -0
- package/coverage/map/api/services/alerts/alerts.hooks.js.html +274 -0
- package/coverage/map/api/services/alerts/alerts.service.js.html +610 -0
- package/coverage/map/api/services/alerts/index.html +131 -0
- package/coverage/map/api/services/catalog/catalog.hooks.js.html +316 -0
- package/coverage/map/api/services/catalog/index.html +116 -0
- package/coverage/map/api/services/daptiles/daptiles.service.js.html +1510 -0
- package/coverage/map/api/services/daptiles/index.html +116 -0
- package/coverage/map/api/services/features/features.hooks.js.html +241 -0
- package/coverage/map/api/services/features/features.service.js.html +241 -0
- package/coverage/map/api/services/features/index.html +131 -0
- package/coverage/map/api/services/index.html +116 -0
- package/coverage/map/api/services/index.js.html +817 -0
- package/coverage/map/api/services/projects/index.html +116 -0
- package/coverage/map/api/services/projects/projects.hooks.js.html +439 -0
- package/coverage/map/common/dynamic-grid-source.js.html +466 -0
- package/coverage/map/common/errors.js.html +94 -0
- package/coverage/map/common/geotiff-grid-source.js.html +541 -0
- package/coverage/map/common/grid.js.html +1612 -0
- package/coverage/map/common/index.html +371 -0
- package/coverage/map/common/index.js.html +172 -0
- package/coverage/map/common/meteo-model-grid-source.js.html +556 -0
- package/coverage/map/common/moment-utils.js.html +157 -0
- package/coverage/map/common/opendap-grid-source.js.html +868 -0
- package/coverage/map/common/opendap-utils.js.html +826 -0
- package/coverage/map/common/permissions.js.html +124 -0
- package/coverage/map/common/time-based-grid-source.js.html +418 -0
- package/coverage/map/common/tms-utils.js.html +274 -0
- package/coverage/map/common/wcs-grid-source.js.html +364 -0
- package/coverage/map/common/wcs-utils.js.html +586 -0
- package/coverage/map/common/weacast-grid-source.js.html +1033 -0
- package/coverage/map/common/wfs-utils.js.html +574 -0
- package/coverage/map/common/wms-utils.js.html +451 -0
- package/coverage/map/common/wmts-utils.js.html +547 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +196 -0
- package/coverage/tmp/coverage-137435-1719398750767-0.json +1 -0
- package/coverage/tmp/coverage-137447-1719398750752-0.json +1 -0
- package/coverage/tmp/coverage-137458-1719398750740-0.json +1 -0
- package/coverage/tmp/coverage-137470-1719398750728-0.json +1 -0
- package/coverage/tmp/coverage-137477-1719398750691-0.json +1 -0
- package/map/api/hooks/hooks.query.js +5 -2
- package/map/api/services/catalog/catalog.hooks.js +4 -5
- package/map/client/cesium/utils/index.js +2 -1
- package/map/client/cesium/utils/utils.cesium.js +8 -0
- package/map/client/cesium/utils/utils.features.js +2 -2
- package/map/client/cesium/utils/utils.style.js +19 -17
- package/map/client/components/KCompass.vue +25 -3
- package/map/client/components/KEditLayerData.vue +1 -1
- package/map/client/components/KPositionIndicator.vue +1 -1
- package/map/client/components/catalog/KConnectLayer.vue +2 -2
- package/map/client/components/catalog/KCreateView.vue +2 -2
- package/map/client/components/form/KDirectionField.vue +4 -0
- package/map/client/components/form/KOwsLayerField.vue +4 -4
- package/map/client/components/form/KOwsServiceField.vue +3 -4
- package/map/client/components/legend/KLegend.vue +13 -15
- package/map/client/components/tools/KGeolocateTool.vue +1 -1
- package/map/client/components/widget/KStackableTimeSeries.vue +3 -0
- package/map/client/composables/highlight.js +4 -1
- package/map/client/elevation-utils.js +2 -2
- package/map/client/i18n/map_en.json +3 -1
- package/map/client/i18n/map_fr.json +3 -1
- package/map/client/mixins/globe/mixin.base-globe.js +121 -80
- package/map/client/mixins/globe/mixin.file-layers.js +2 -2
- package/map/client/mixins/globe/mixin.geojson-layers.js +24 -19
- package/map/client/mixins/globe/mixin.globe-activity.js +3 -3
- package/map/client/mixins/globe/mixin.opendap-layers.js +3 -3
- package/map/client/mixins/globe/mixin.style.js +5 -5
- package/map/client/mixins/globe/mixin.tooltip.js +5 -3
- package/map/client/mixins/map/mixin.base-map.js +42 -4
- package/map/client/mixins/map/mixin.canvas-layers.js +0 -1
- package/map/client/mixins/map/mixin.geojson-layers.js +10 -5
- package/map/client/mixins/mixin.activity.js +2 -2
- package/map/client/mixins/mixin.feature-selection.js +7 -5
- package/map/client/mixins/mixin.levels.js +1 -1
- package/map/client/utils/utils.catalog.js +15 -0
- package/map/client/utils/utils.location.js +2 -1
- package/map/client/utils/utils.style.js +1 -1
- package/map/common/geotiff-grid-source.js +5 -3
- package/map/common/grid.js +2 -2
- package/map/common/meteo-model-grid-source.js +1 -1
- package/map/common/time-based-grid-source.js +1 -1
- package/map/common/wmts-utils.js +11 -11
- package/package.json +12 -8
- package/scripts/build_docs.sh +37 -0
- package/scripts/init_runner.sh +30 -0
- package/scripts/kash/.github/workflows/run_tests.yaml +33 -0
- package/scripts/kash/README.md +2 -0
- package/scripts/kash/kash.sh +1657 -0
- package/scripts/kash/scripts/run_tests.sh +151 -0
- package/scripts/run_tests.sh +48 -0
- package/scripts/setup_workspace.sh +42 -0
- package/test/api/core/hooks.test.js +31 -0
- package/test/api/core/test-log-2023-12-19.log +7 -0
- package/test/api/core/test-log-2024-01-04.log +14 -0
- package/test/api/core/test-log-2024-05-14.log +6 -0
- package/test/api/core/test-log-2024-06-06.log +23 -0
- package/test/api/core/test-log-2024-06-26.log +25 -0
- package/test/api/core/test-log-2024-06-28.log +2 -0
- package/test/api/map/grid-sources.test.js +3 -1
- package/test/api/map/hooks.test.js +58 -12
- package/test/api/map/test-log-2023-11-24.log +121 -0
- package/test/api/map/test-log-2023-12-12.log +29 -0
- package/test/api/map/test-log-2023-12-13.log +5 -0
- package/test/api/map/test-log-2024-01-04.log +2 -0
- package/test/api/map/test-log-2024-01-11.log +1 -0
- package/test/api/map/test-log-2024-01-25.log +19 -0
- package/test/api/map/test-log-2024-06-06.log +39 -0
- package/test/client/core/collection.js +2 -2
- package/test/client/core/dialogs.js +13 -0
- package/test/client/core/index.js +6 -5
- package/test/client/core/layout.js +1 -13
- package/test/client/core/runner.js +41 -20
- package/test/client/core/screens.js +6 -0
- package/test/client/core/utils.js +23 -19
- package/.travis.doc.sh +0 -8
- package/.travis.test.sh +0 -72
- package/core/client/components/KAction.vue +0 -393
- package/core/client/components/KBlock.vue +0 -67
- package/core/client/components/app/KTerms.vue +0 -41
|
@@ -3,14 +3,15 @@ import sift from 'sift'
|
|
|
3
3
|
import logger from 'loglevel'
|
|
4
4
|
import Emitter from 'tiny-emitter'
|
|
5
5
|
import { getCssVar } from 'quasar'
|
|
6
|
-
import
|
|
6
|
+
import { Ion, Viewer, Color, viewerCesiumInspectorMixin, Rectangle, ScreenSpaceEventType, ScreenSpaceEventHandler, buildModuleUrl,
|
|
7
|
+
Cesium3DTileset, ImageryLayer, Cartesian3, PinBuilder, BoundingSphere, Ellipsoid, Cartographic, Entity, EntityCollection,
|
|
8
|
+
exportKml, VerticalOrigin, Math as CesiumMath } from 'cesium'
|
|
7
9
|
import 'cesium/Source/Widgets/widgets.css'
|
|
8
|
-
import BuildModuleUrl from 'cesium/Source/Core/buildModuleUrl.js'
|
|
9
10
|
import { Geolocation } from '../../geolocation.js'
|
|
10
|
-
import { convertCesiumHandlerEvent, isTerrainLayer, convertEntitiesToGeoJson } from '../../utils.globe.js'
|
|
11
|
-
//
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
import { Cesium, convertCesiumHandlerEvent, isTerrainLayer, convertEntitiesToGeoJson, createCesiumObject } from '../../utils.globe.js'
|
|
12
|
+
// The URL on our server where CesiumJS's static files are hosted
|
|
13
|
+
window.CESIUM_BASE_URL = '/Cesium/'
|
|
14
|
+
buildModuleUrl.setBaseUrl('/Cesium/')
|
|
14
15
|
|
|
15
16
|
export const baseGlobe = {
|
|
16
17
|
emits: [
|
|
@@ -45,25 +46,35 @@ export const baseGlobe = {
|
|
|
45
46
|
animation: false,
|
|
46
47
|
timeline: false
|
|
47
48
|
})
|
|
48
|
-
if (token)
|
|
49
|
+
if (token) Ion.defaultAccessToken = token
|
|
49
50
|
// If we don't need ion
|
|
50
|
-
else
|
|
51
|
+
else Ion.defaultAccessToken = ''
|
|
51
52
|
// Initialize the globe
|
|
52
53
|
Object.assign(viewerOptions, {
|
|
53
54
|
imageryProviderViewModels: [],
|
|
54
55
|
terrainProviderViewModels: []
|
|
55
56
|
})
|
|
56
|
-
this.viewer = new
|
|
57
|
-
|
|
58
|
-
this.viewer.scene.
|
|
57
|
+
this.viewer = new Viewer(domEl, viewerOptions)
|
|
58
|
+
const backgroundColor = _.get(viewerOptions, 'backgroundColor')
|
|
59
|
+
this.viewer.scene.backgroundColor = (backgroundColor ? createCesiumObject('Color', ...backgroundColor) : Color.BLACK)
|
|
60
|
+
if (this.viewer.scene.globe) {
|
|
61
|
+
const baseColor = _.get(viewerOptions, 'baseColor')
|
|
62
|
+
this.viewer.scene.globe.baseColor = (baseColor ? createCesiumObject('Color', ...baseColor) : Color.BLACK)
|
|
63
|
+
const undergroundColor = _.get(viewerOptions, 'undergroundColor')
|
|
64
|
+
this.viewer.scene.globe.undergroundColor = (undergroundColor ? createCesiumObject('Color', ...undergroundColor) : Color.BLACK)
|
|
65
|
+
}
|
|
66
|
+
// Debug mode ?
|
|
67
|
+
if (viewerOptions.debug) this.viewer.extend(viewerCesiumInspectorMixin)
|
|
68
|
+
// Cesium always create a default provider when a globe is used
|
|
69
|
+
if (this.viewer.scene.imageryLayers) this.viewer.scene.imageryLayers.removeAll()
|
|
59
70
|
// Add defaults handler
|
|
60
71
|
this.registerCesiumHandler(this.getDefaultPickHandler, 'MOUSE_MOVE')
|
|
61
72
|
this.registerCesiumHandler(this.getDefaultPickHandler, 'LEFT_CLICK')
|
|
62
73
|
this.registerCesiumHandler(this.getDefaultPickHandler, 'RIGHT_CLICK')
|
|
63
74
|
// Remove default Cesium handlers
|
|
64
|
-
this.viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(
|
|
65
|
-
this.viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(
|
|
66
|
-
this.viewBounds = new
|
|
75
|
+
this.viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(ScreenSpaceEventType.LEFT_CLICK)
|
|
76
|
+
this.viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(ScreenSpaceEventType.LEFT_DOUBLE_CLICK)
|
|
77
|
+
this.viewBounds = new Rectangle()
|
|
67
78
|
this.onGlobeReady()
|
|
68
79
|
},
|
|
69
80
|
onGlobeReady () {
|
|
@@ -74,47 +85,68 @@ export const baseGlobe = {
|
|
|
74
85
|
// Because we update objects in place and don't want cesium internal objects to be reactive
|
|
75
86
|
const processedOptions = _.cloneDeep(options)
|
|
76
87
|
// Transform from string to actual object
|
|
77
|
-
processedOptions.cesium.iconUrl =
|
|
88
|
+
processedOptions.cesium.iconUrl = buildModuleUrl(processedOptions.iconUrl)
|
|
78
89
|
// Copy generic options
|
|
79
90
|
processedOptions.cesium.name = processedOptions.name
|
|
80
91
|
processedOptions.cesium.attribution = processedOptions.attribution
|
|
81
92
|
return processedOptions
|
|
82
93
|
},
|
|
83
|
-
createCesiumLayer (options) {
|
|
84
|
-
|
|
94
|
+
async createCesiumLayer (options) {
|
|
95
|
+
let cesiumOptions = options.cesium || options
|
|
96
|
+
// Convert required objects
|
|
97
|
+
cesiumOptions = this.convertToCesiumObjects(cesiumOptions)
|
|
98
|
+
let args = [cesiumOptions]
|
|
99
|
+
let provider, createFunction, isImageryProvider
|
|
85
100
|
if (cesiumOptions.type === '3DTileset') {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
if (
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
101
|
+
provider = createFunction = 'Cesium3DTileset.fromUrl'
|
|
102
|
+
args = [cesiumOptions.url].concat([_.omit(cesiumOptions, ['url', 'style'])])
|
|
103
|
+
} else if (isTerrainLayer(cesiumOptions)) {
|
|
104
|
+
if (cesiumOptions.type === 'Ellipsoid') {
|
|
105
|
+
provider = 'EllipsoidTerrainProvider'
|
|
106
|
+
} else if (cesiumOptions.url || cesiumOptions.assetId) {
|
|
107
|
+
provider = createFunction = (cesiumOptions.url ? 'CesiumTerrainProvider.fromUrl' : 'CesiumTerrainProvider.fromIonAssetId')
|
|
108
|
+
args = [cesiumOptions.url || cesiumOptions.assetId].concat([_.omit(cesiumOptions, ['url', 'assetId'])])
|
|
109
|
+
} else {
|
|
110
|
+
// If no url/asset id given will use default terrain creation function createWorldTerrainAsync()
|
|
111
|
+
provider = createFunction = 'createWorldTerrainAsync'
|
|
112
|
+
}
|
|
97
113
|
} else {
|
|
98
|
-
provider = cesiumOptions.type
|
|
114
|
+
provider = cesiumOptions.type
|
|
115
|
+
// Handle specific case of built-in creation functions
|
|
116
|
+
createFunction = `create${provider}Async`
|
|
117
|
+
if (_.get(Cesium, createFunction)) {
|
|
118
|
+
provider = createFunction
|
|
119
|
+
} else {
|
|
120
|
+
isImageryProvider = true
|
|
121
|
+
provider += 'ImageryProvider'
|
|
122
|
+
// Some providers also have built-in creation functions
|
|
123
|
+
createFunction = `${provider}.fromUrl`
|
|
124
|
+
if (_.get(Cesium, createFunction)) {
|
|
125
|
+
provider = createFunction
|
|
126
|
+
args = [cesiumOptions.url].concat([_.omit(cesiumOptions, ['url'])])
|
|
127
|
+
}
|
|
128
|
+
}
|
|
99
129
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
130
|
+
const Constructor = _.get(Cesium, provider)
|
|
131
|
+
if (!Constructor) return
|
|
132
|
+
// Built-in creation function or class constructor ?
|
|
133
|
+
if (provider === createFunction) provider = await Constructor(...args)
|
|
134
|
+
else provider = new Constructor(...args)
|
|
135
|
+
// Not possible to set style as constructor options for tile sets
|
|
136
|
+
if ((cesiumOptions.type === '3DTileset') && _.has(cesiumOptions, 'style')) provider.style = _.get(cesiumOptions, 'style')
|
|
137
|
+
return (isImageryProvider ? new ImageryLayer(provider) : provider)
|
|
106
138
|
},
|
|
107
139
|
registerCesiumConstructor (constructor) {
|
|
108
140
|
this.cesiumFactory.push(constructor)
|
|
109
141
|
},
|
|
110
142
|
registerCesiumHandler (handler, eventType) {
|
|
111
|
-
if (!this.cesiumHandler) this.cesiumHandler = new
|
|
143
|
+
if (!this.cesiumHandler) this.cesiumHandler = new ScreenSpaceEventHandler(this.viewer.scene.canvas)
|
|
112
144
|
const originalEvent = convertCesiumHandlerEvent(eventType)
|
|
113
145
|
this.cesiumHandler.setInputAction((event) => handler(Object.assign(event, { originalEvent })),
|
|
114
|
-
|
|
146
|
+
ScreenSpaceEventType[eventType])
|
|
115
147
|
},
|
|
116
148
|
unregisterCesiumHandler (eventType) {
|
|
117
|
-
this.
|
|
149
|
+
this.cesiumHandler.removeInputAction(ScreenSpaceEventType[eventType])
|
|
118
150
|
},
|
|
119
151
|
async createLayer (options) {
|
|
120
152
|
const processedOptions = this.processCesiumLayerOptions(options)
|
|
@@ -126,7 +158,7 @@ export const baseGlobe = {
|
|
|
126
158
|
if (layer) break
|
|
127
159
|
}
|
|
128
160
|
// Use default Cesium layer constructor if none found
|
|
129
|
-
layer = layer || this.createCesiumLayer(processedOptions)
|
|
161
|
+
layer = layer || await this.createCesiumLayer(processedOptions)
|
|
130
162
|
// Keep track of processed options
|
|
131
163
|
layer.processedOptions = processedOptions
|
|
132
164
|
return layer
|
|
@@ -140,9 +172,9 @@ export const baseGlobe = {
|
|
|
140
172
|
const cesiumLayer = this.getCesiumLayerByName(name)
|
|
141
173
|
if (isTerrainLayer(layer)) {
|
|
142
174
|
return this.viewer.terrainProvider === cesiumLayer
|
|
143
|
-
} else if (cesiumLayer instanceof
|
|
175
|
+
} else if (cesiumLayer instanceof ImageryLayer) {
|
|
144
176
|
return this.viewer.scene.imageryLayers.contains(cesiumLayer)
|
|
145
|
-
} else if (cesiumLayer instanceof
|
|
177
|
+
} else if (cesiumLayer instanceof Cesium3DTileset) {
|
|
146
178
|
return this.viewer.scene.primitives.contains(cesiumLayer) && cesiumLayer.show
|
|
147
179
|
} else { // Entity data source otherwise
|
|
148
180
|
return this.viewer.dataSources.contains(cesiumLayer)
|
|
@@ -188,9 +220,9 @@ export const baseGlobe = {
|
|
|
188
220
|
this.cesiumLayers[name] = cesiumLayer
|
|
189
221
|
if (isTerrainLayer(layer)) {
|
|
190
222
|
this.viewer.terrainProvider = cesiumLayer
|
|
191
|
-
} else if (cesiumLayer instanceof
|
|
223
|
+
} else if (cesiumLayer instanceof ImageryLayer) {
|
|
192
224
|
this.viewer.scene.imageryLayers.add(cesiumLayer)
|
|
193
|
-
} else if (cesiumLayer instanceof
|
|
225
|
+
} else if (cesiumLayer instanceof Cesium3DTileset) {
|
|
194
226
|
cesiumLayer.show = true
|
|
195
227
|
if (!this.viewer.scene.primitives.contains(cesiumLayer)) this.viewer.scene.primitives.add(cesiumLayer)
|
|
196
228
|
} else { // Entity data source otherwise
|
|
@@ -215,9 +247,9 @@ export const baseGlobe = {
|
|
|
215
247
|
delete this.cesiumLayers[name]
|
|
216
248
|
if (isTerrainLayer(layer)) {
|
|
217
249
|
this.viewer.terrainProvider = null
|
|
218
|
-
} else if (cesiumLayer instanceof
|
|
250
|
+
} else if (cesiumLayer instanceof ImageryLayer) {
|
|
219
251
|
this.viewer.scene.imageryLayers.remove(cesiumLayer, false)
|
|
220
|
-
} else if (cesiumLayer instanceof
|
|
252
|
+
} else if (cesiumLayer instanceof Cesium3DTileset) {
|
|
221
253
|
cesiumLayer.show = false
|
|
222
254
|
} else { // Entity data source otherwise
|
|
223
255
|
this.viewer.dataSources.remove(cesiumLayer, true)
|
|
@@ -263,7 +295,7 @@ export const baseGlobe = {
|
|
|
263
295
|
// If it was visible hide it first (ie remove from globe)
|
|
264
296
|
this.hideLayer(name)
|
|
265
297
|
const cesiumLayer = this.cesiumLayers[name]
|
|
266
|
-
if (cesiumLayer instanceof
|
|
298
|
+
if (cesiumLayer instanceof Cesium3DTileset) {
|
|
267
299
|
this.viewer.scene.primitives.remove(cesiumLayer)
|
|
268
300
|
}
|
|
269
301
|
// Delete the layer
|
|
@@ -284,16 +316,21 @@ export const baseGlobe = {
|
|
|
284
316
|
const geoJson = await convertEntitiesToGeoJson(layer.entities)
|
|
285
317
|
return geoJson
|
|
286
318
|
},
|
|
287
|
-
zoomToBounds (bounds) {
|
|
319
|
+
zoomToBounds (bounds, heading = 0, pitch = -90, roll = 0, duration = 0) {
|
|
288
320
|
this.viewer.camera.flyTo({
|
|
289
|
-
duration: 0,
|
|
290
321
|
destination: Array.isArray(bounds) // Assume Cesium rectangle object if not array
|
|
291
|
-
?
|
|
292
|
-
: bounds
|
|
322
|
+
? Rectangle.fromDegrees(bounds[0][1], bounds[0][0], bounds[1][1], bounds[1][0])
|
|
323
|
+
: bounds,
|
|
324
|
+
orientation: {
|
|
325
|
+
heading: CesiumMath.toRadians(heading),
|
|
326
|
+
pitch: CesiumMath.toRadians(pitch),
|
|
327
|
+
roll: CesiumMath.toRadians(roll)
|
|
328
|
+
},
|
|
329
|
+
duration
|
|
293
330
|
})
|
|
294
331
|
},
|
|
295
|
-
zoomToBBox (bbox) {
|
|
296
|
-
this.zoomToBounds([[bbox[1], bbox[0]], [bbox[3], bbox[2]]])
|
|
332
|
+
zoomToBBox (bbox, heading = 0, pitch = -90, roll = 0, duration = 0) {
|
|
333
|
+
this.zoomToBounds([[bbox[1], bbox[0]], [bbox[3], bbox[2]]], heading, pitch, roll, duration)
|
|
297
334
|
},
|
|
298
335
|
zoomToLayer (name) {
|
|
299
336
|
const layer = this.getCesiumLayerByName(name)
|
|
@@ -311,33 +348,35 @@ export const baseGlobe = {
|
|
|
311
348
|
}
|
|
312
349
|
}
|
|
313
350
|
},
|
|
314
|
-
center (longitude, latitude, altitude, heading = 0, pitch = -90, roll = 0) {
|
|
351
|
+
center (longitude, latitude, altitude, heading = 0, pitch = -90, roll = 0, options = {}) {
|
|
315
352
|
const center = this.viewer.camera.positionCartographic
|
|
353
|
+
const duration = _.get(options, 'duration', 0)
|
|
316
354
|
const target = {
|
|
317
|
-
destination:
|
|
355
|
+
destination: Cartesian3.fromDegrees(longitude, latitude, altitude || center.height),
|
|
318
356
|
orientation: {
|
|
319
|
-
heading:
|
|
320
|
-
pitch:
|
|
321
|
-
roll:
|
|
322
|
-
}
|
|
357
|
+
heading: CesiumMath.toRadians(heading),
|
|
358
|
+
pitch: CesiumMath.toRadians(pitch),
|
|
359
|
+
roll: CesiumMath.toRadians(roll)
|
|
360
|
+
},
|
|
361
|
+
duration
|
|
323
362
|
}
|
|
324
|
-
if (
|
|
363
|
+
if (duration) this.viewer.camera.flyTo(target)
|
|
325
364
|
else this.viewer.camera.setView(target)
|
|
326
365
|
},
|
|
327
366
|
getCenter () {
|
|
328
367
|
const center = this.viewer.camera.positionCartographic
|
|
329
368
|
return {
|
|
330
|
-
longitude:
|
|
331
|
-
latitude:
|
|
369
|
+
longitude: CesiumMath.toDegrees(center.longitude),
|
|
370
|
+
latitude: CesiumMath.toDegrees(center.latitude),
|
|
332
371
|
altitude: center.height
|
|
333
372
|
}
|
|
334
373
|
},
|
|
335
374
|
getBounds () {
|
|
336
375
|
const bounds = this.viewer.camera.computeViewRectangle(this.viewer.scene.globe.ellipsoid, this.viewBounds)
|
|
337
|
-
const south =
|
|
338
|
-
const west =
|
|
339
|
-
const north =
|
|
340
|
-
const east =
|
|
376
|
+
const south = CesiumMath.toDegrees(bounds.south)
|
|
377
|
+
const west = CesiumMath.toDegrees(bounds.west)
|
|
378
|
+
const north = CesiumMath.toDegrees(bounds.north)
|
|
379
|
+
const east = CesiumMath.toDegrees(bounds.east)
|
|
341
380
|
return [[south, west], [north, east]]
|
|
342
381
|
},
|
|
343
382
|
async showUserLocation () {
|
|
@@ -345,14 +384,14 @@ export const baseGlobe = {
|
|
|
345
384
|
const longitude = Geolocation.getLongitude()
|
|
346
385
|
const latitude = Geolocation.getLatitude()
|
|
347
386
|
this.center(longitude, latitude)
|
|
348
|
-
const pinBuilder = new
|
|
349
|
-
const canvas = await pinBuilder.fromMakiIconId('marker',
|
|
387
|
+
const pinBuilder = new PinBuilder()
|
|
388
|
+
const canvas = await pinBuilder.fromMakiIconId('marker', Color.fromCssColorString(getCssVar('primary')), 48)
|
|
350
389
|
this.userLocationEntity = this.viewer.entities.add({
|
|
351
390
|
name: 'user-location',
|
|
352
|
-
position:
|
|
391
|
+
position: Cartesian3.fromDegrees(longitude, latitude),
|
|
353
392
|
billboard: {
|
|
354
393
|
image: canvas.toDataURL(),
|
|
355
|
-
verticalOrigin:
|
|
394
|
+
verticalOrigin: VerticalOrigin.BOTTOM
|
|
356
395
|
}
|
|
357
396
|
})
|
|
358
397
|
this.viewer.selectedEntity = this.userLocationEntity
|
|
@@ -399,11 +438,13 @@ export const baseGlobe = {
|
|
|
399
438
|
let position = entity.position
|
|
400
439
|
if (!position) {
|
|
401
440
|
if (entity.polygon) {
|
|
402
|
-
position =
|
|
441
|
+
position = BoundingSphere.fromPoints(entity.polygon.hierarchy.getValue().positions).center
|
|
403
442
|
} else if (entity.polyline) {
|
|
404
|
-
position =
|
|
443
|
+
position = BoundingSphere.fromPoints(entity.polyline.positions.getValue()).center
|
|
444
|
+
} else if (entity.wall) {
|
|
445
|
+
position = BoundingSphere.fromPoints(entity.wall.positions.getValue()).center
|
|
405
446
|
}
|
|
406
|
-
|
|
447
|
+
if (position) Ellipsoid.WGS84.scaleToGeodeticSurface(position, position)
|
|
407
448
|
}
|
|
408
449
|
return position
|
|
409
450
|
},
|
|
@@ -414,9 +455,9 @@ export const baseGlobe = {
|
|
|
414
455
|
if (pickedPosition) {
|
|
415
456
|
// This is for 3D handlers
|
|
416
457
|
emittedEvent.pickedPosition = pickedPosition
|
|
417
|
-
pickedPosition =
|
|
418
|
-
const longitude =
|
|
419
|
-
const latitude =
|
|
458
|
+
pickedPosition = Cartographic.fromCartesian(pickedPosition)
|
|
459
|
+
const longitude = CesiumMath.toDegrees(pickedPosition.longitude)
|
|
460
|
+
const latitude = CesiumMath.toDegrees(pickedPosition.latitude)
|
|
420
461
|
// This ensure we can use similar handlers than for Leaflet
|
|
421
462
|
emittedEvent.latlng = [latitude, longitude]
|
|
422
463
|
emittedEvent.latlng.lng = longitude
|
|
@@ -425,7 +466,7 @@ export const baseGlobe = {
|
|
|
425
466
|
const pickedObject = this.viewer.scene.pick(event.endPosition || event.position)
|
|
426
467
|
if (pickedObject) {
|
|
427
468
|
emittedEvent.target = pickedObject.id || pickedObject.primitive.id
|
|
428
|
-
if (emittedEvent.target instanceof
|
|
469
|
+
if (emittedEvent.target instanceof Entity) {
|
|
429
470
|
// If feature have been lost at import try to recreate it in order to be compatible with 2D
|
|
430
471
|
// We attach it to the target entity so that we won't compute it each time the mouse move
|
|
431
472
|
// FIXME: should it be a problem with real-time updates ?
|
|
@@ -437,8 +478,8 @@ export const baseGlobe = {
|
|
|
437
478
|
type: 'Feature'
|
|
438
479
|
}
|
|
439
480
|
// Generate GeoJson feature if possible (requires Cesium 1.59)
|
|
440
|
-
if (typeof
|
|
441
|
-
const selection = new
|
|
481
|
+
if (typeof exportKml === 'function') {
|
|
482
|
+
const selection = new EntityCollection()
|
|
442
483
|
selection.add(emittedEvent.target)
|
|
443
484
|
const geoJson = await convertEntitiesToGeoJson(selection)
|
|
444
485
|
if (geoJson.features.length > 0) {
|
|
@@ -446,12 +487,12 @@ export const baseGlobe = {
|
|
|
446
487
|
}
|
|
447
488
|
}
|
|
448
489
|
if (!feature.geometry) {
|
|
449
|
-
const position =
|
|
490
|
+
const position = Cartographic.fromCartesian(emittedEvent.target.position
|
|
450
491
|
? emittedEvent.target.position.getValue(0)
|
|
451
492
|
: emittedEvent.pickedPosition)
|
|
452
493
|
feature.geometry = {
|
|
453
494
|
type: 'Point',
|
|
454
|
-
coordinates: [
|
|
495
|
+
coordinates: [CesiumMath.toDegrees(position.longitude), CesiumMath.toDegrees(position.latitude)]
|
|
455
496
|
}
|
|
456
497
|
}
|
|
457
498
|
feature.properties = (emittedEvent.target.properties ? emittedEvent.target.properties.getValue(0) : {})
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _ from 'lodash'
|
|
2
|
-
import
|
|
2
|
+
import { viewerDragDropMixin } from 'cesium'
|
|
3
3
|
import logger from 'loglevel'
|
|
4
4
|
|
|
5
5
|
export const fileLayers = {
|
|
6
6
|
mounted () {
|
|
7
7
|
this.$engineEvents.on('globe-ready', () => {
|
|
8
|
-
this.viewer.extend(
|
|
8
|
+
this.viewer.extend(viewerDragDropMixin,
|
|
9
9
|
// For activities
|
|
10
10
|
_.get(this, 'activityOptions.engine.fileLayers', {
|
|
11
11
|
clearOnDrop: false,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { GeoJsonDataSource, ColorMaterialProperty, ConstantProperty } from 'cesium'
|
|
2
2
|
import _ from 'lodash'
|
|
3
3
|
import logger from 'loglevel'
|
|
4
4
|
import sift from 'sift'
|
|
@@ -26,12 +26,15 @@ function updateGeoJsonEntity(source, destination) {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export const geojsonLayers = {
|
|
29
|
+
emits: [
|
|
30
|
+
'layer-updated'
|
|
31
|
+
],
|
|
29
32
|
methods: {
|
|
30
33
|
convertFromSimpleStyleOrDefaults (properties) {
|
|
31
34
|
let { stroke, strokeWidth, fill } = convertToCesiumFromSimpleStyle(properties)
|
|
32
|
-
if (!stroke) stroke =
|
|
33
|
-
if (!strokeWidth) strokeWidth =
|
|
34
|
-
if (!fill) fill =
|
|
35
|
+
if (!stroke) stroke = GeoJsonDataSource.stroke
|
|
36
|
+
if (!strokeWidth) strokeWidth = GeoJsonDataSource.strokeWidth
|
|
37
|
+
if (!fill) fill = GeoJsonDataSource.fill
|
|
35
38
|
return { stroke, strokeWidth, fill }
|
|
36
39
|
},
|
|
37
40
|
async loadGeoJson (dataSource, geoJson, options, updateOptions = {}) {
|
|
@@ -49,7 +52,7 @@ export const geojsonLayers = {
|
|
|
49
52
|
return
|
|
50
53
|
}
|
|
51
54
|
// We use a separated source in order to load data otherwise Cesium will replace previous ones, causing flickering
|
|
52
|
-
const loadingDataSource = new
|
|
55
|
+
const loadingDataSource = new GeoJsonDataSource()
|
|
53
56
|
loadingDataSource.notFromDrop = true
|
|
54
57
|
await loadingDataSource.load(geoJson, cesiumOptions)
|
|
55
58
|
// Now we process loaded entities to merge with existing ones if any or add new ones
|
|
@@ -91,10 +94,10 @@ export const geojsonLayers = {
|
|
|
91
94
|
ellipse: {
|
|
92
95
|
semiMinorAxis: radius,
|
|
93
96
|
semiMajorAxis: radius,
|
|
94
|
-
material: new
|
|
95
|
-
outlineColor: new
|
|
97
|
+
material: new ColorMaterialProperty(fill),
|
|
98
|
+
outlineColor: new ConstantProperty(stroke),
|
|
96
99
|
outlineWidth: strokeWidth,
|
|
97
|
-
outline: new
|
|
100
|
+
outline: new ConstantProperty(true)
|
|
98
101
|
}
|
|
99
102
|
})
|
|
100
103
|
entitiesToRemove.push(entity)
|
|
@@ -114,10 +117,10 @@ export const geojsonLayers = {
|
|
|
114
117
|
properties: entity.properties.getValue(0),
|
|
115
118
|
wall: {
|
|
116
119
|
positions: entity.polyline.positions.getValue(0),
|
|
117
|
-
material: new
|
|
118
|
-
outlineColor: new
|
|
120
|
+
material: new ColorMaterialProperty(fill),
|
|
121
|
+
outlineColor: new ConstantProperty(stroke),
|
|
119
122
|
outlineWidth: strokeWidth,
|
|
120
|
-
outline: new
|
|
123
|
+
outline: new ConstantProperty(true)
|
|
121
124
|
}
|
|
122
125
|
})
|
|
123
126
|
}
|
|
@@ -139,8 +142,8 @@ export const geojsonLayers = {
|
|
|
139
142
|
properties: entity.properties.getValue(0),
|
|
140
143
|
label: {
|
|
141
144
|
text,
|
|
142
|
-
fillColor: new
|
|
143
|
-
outlineColor: new
|
|
145
|
+
fillColor: new ConstantProperty(fill),
|
|
146
|
+
outlineColor: new ConstantProperty(stroke),
|
|
144
147
|
outlineWidth: strokeWidth
|
|
145
148
|
}
|
|
146
149
|
})
|
|
@@ -208,12 +211,9 @@ export const geojsonLayers = {
|
|
|
208
211
|
feature.id = getFeatureId(feature, options)
|
|
209
212
|
// We cannot access data outside the properties object of a feature in Cesium
|
|
210
213
|
// As a consequence we copy back any style information inside
|
|
211
|
-
const styleType = getFeatureStyleType(feature)
|
|
212
214
|
// We need to convert to simple-style spec as cesium manages this only
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
else if (styleType === 'line') simpleStyle = getLineSimpleStyle(feature, options, engine)
|
|
216
|
-
else simpleStyle = getPolygonSimpleStyle(feature, options, engine)
|
|
215
|
+
// We also need to merge all styling properties as some entities requires eg both line/polygon style (wall polylines)
|
|
216
|
+
const simpleStyle = Object.assign(getPointSimpleStyle(feature, options, engine), getLineSimpleStyle(feature, options, engine), getPolygonSimpleStyle(feature, options, engine))
|
|
217
217
|
if (!feature.properties) feature.properties = simpleStyle
|
|
218
218
|
else Object.assign(feature.properties, simpleStyle)
|
|
219
219
|
}
|
|
@@ -279,7 +279,7 @@ export const geojsonLayers = {
|
|
|
279
279
|
}
|
|
280
280
|
// If we already have a source we simply use it otherwise we create/load it
|
|
281
281
|
if (!dataSource || !dataSource.name) {
|
|
282
|
-
dataSource = new
|
|
282
|
+
dataSource = new GeoJsonDataSource()
|
|
283
283
|
dataSource.notFromDrop = true
|
|
284
284
|
// Check for realtime layers
|
|
285
285
|
if (cesiumOptions.realtime) {
|
|
@@ -322,6 +322,11 @@ export const geojsonLayers = {
|
|
|
322
322
|
if (isInMemoryLayer(baseLayer)) {
|
|
323
323
|
this.geojsonCache[name] = geoJson
|
|
324
324
|
}
|
|
325
|
+
this.onLayerUpdated(baseLayer, layer, { features: geoJson.features || [geoJson] })
|
|
326
|
+
},
|
|
327
|
+
onLayerUpdated (layer, cesiumLayer, data) {
|
|
328
|
+
this.$emit('layer-updated', layer, cesiumLayer, data)
|
|
329
|
+
this.$engineEvents.emit('layer-updated', layer, cesiumLayer, data)
|
|
325
330
|
},
|
|
326
331
|
onCurrentTimeChangedGeoJsonLayers (time) {
|
|
327
332
|
const geoJsonlayers = _.values(this.layers).filter(sift({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Fullscreen } from 'cesium'
|
|
2
2
|
|
|
3
3
|
export const activity = {
|
|
4
4
|
methods: {
|
|
@@ -28,10 +28,10 @@ export const activity = {
|
|
|
28
28
|
onToggleVr () {
|
|
29
29
|
// VR requires fullscreen mode
|
|
30
30
|
if (this.viewer.scene.useWebVR) {
|
|
31
|
-
if (
|
|
31
|
+
if (Fullscreen.fullscreen) Fullscreen.exitFullscreen()
|
|
32
32
|
this.viewer.scene.useWebVR = false
|
|
33
33
|
} else {
|
|
34
|
-
if (!
|
|
34
|
+
if (!Fullscreen.fullscreen) Fullscreen.requestFullscreen(document.body)
|
|
35
35
|
this.viewer.scene.useWebVR = true
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// import logger from 'loglevel'
|
|
2
|
-
import
|
|
2
|
+
import { Resource, Cesium3DTileset } from 'cesium'
|
|
3
3
|
|
|
4
4
|
export const opendapLayers = {
|
|
5
5
|
methods: {
|
|
@@ -10,7 +10,7 @@ export const opendapLayers = {
|
|
|
10
10
|
|
|
11
11
|
const urlPromise = async () => {
|
|
12
12
|
const accessToken = await this.$api.passport.getJWT()
|
|
13
|
-
const url = new
|
|
13
|
+
const url = new Resource({
|
|
14
14
|
url: 'http://localhost:8081/api/daptiles/tileset.json',
|
|
15
15
|
headers: {
|
|
16
16
|
Authorization: `Bearer ${accessToken}`
|
|
@@ -26,7 +26,7 @@ export const opendapLayers = {
|
|
|
26
26
|
return url
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
const tileset = new
|
|
29
|
+
const tileset = new Cesium3DTileset({
|
|
30
30
|
url: urlPromise
|
|
31
31
|
// url: 'http://127.0.0.1:3000/tileset.json?file=mf-arpege-05/2019/06/16/18/T6086_G_T_Sol_20190616180000.grib&variable=Temperature_surface&time=0',
|
|
32
32
|
// shadows: Cesium.ShadowMode.DISABLED,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Transforms, Math as CesiumMath, HeadingPitchRoll, Ellipsoid } from 'cesium'
|
|
2
2
|
import _ from 'lodash'
|
|
3
3
|
import chroma from 'chroma-js'
|
|
4
4
|
import moment from 'moment'
|
|
@@ -60,13 +60,13 @@ export const style = {
|
|
|
60
60
|
// Handle specific case of orientation
|
|
61
61
|
if ((property === 'orientation') && entity.position) {
|
|
62
62
|
const localFrameAxes = _.get(entityStyle, 'localFrameAxes', ['east', 'north'])
|
|
63
|
-
const localFrame =
|
|
63
|
+
const localFrame = Transforms.localFrameToFixedFrameGenerator(...localFrameAxes)
|
|
64
64
|
const position = entity.position.getValue(this.viewer.clock.currentTime)
|
|
65
65
|
// From heading, pitch, roll as templated string to quaternion
|
|
66
|
-
value = value.split(',').map(angle =>
|
|
67
|
-
value = new
|
|
66
|
+
value = value.split(',').map(angle => CesiumMath.toRadians(parseFloat(angle)))
|
|
67
|
+
value = new HeadingPitchRoll(...value)
|
|
68
68
|
// Then from local to position frame
|
|
69
|
-
value =
|
|
69
|
+
value = Transforms.headingPitchRollQuaternion(position, value, Ellipsoid.WGS84, localFrame)
|
|
70
70
|
}
|
|
71
71
|
_.set(entityStyle, property, value)
|
|
72
72
|
})
|
|
@@ -11,9 +11,11 @@ export const tooltip = {
|
|
|
11
11
|
if (tooltip) {
|
|
12
12
|
// Default tooltip position (can change in sticky mode)
|
|
13
13
|
const position = this.getPositionForEntity(entity)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
if (position) {
|
|
15
|
+
const tooltipEntity = this.viewer.entities.add({ parent: entity, position, label: tooltip })
|
|
16
|
+
// This option is not cesium specific so we have to manage it manually
|
|
17
|
+
if (tooltip.sticky) tooltipEntity.sticky = true
|
|
18
|
+
}
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
},
|