Skip to content

Commit

Permalink
chore: more configuration options for dropped files in globe
Browse files Browse the repository at this point in the history
  • Loading branch information
claustres committed Sep 10, 2024
1 parent ad5b8fc commit dbd0b78
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions map/client/mixins/globe/mixin.file-layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ import { viewerDragDropMixin } from 'cesium'
export const fileLayers = {
mounted () {
this.$engineEvents.on('globe-ready', () => {
this.viewer.extend(viewerDragDropMixin,
// For activities
_.get(this, 'activityOptions.engine.fileLayers', {
clearOnDrop: false,
flyToOnDrop: true,
clampToGround: true
})
)
const fileLayersOptions = _.defaults(_.get(this, 'activityOptions.engine.fileLayers', {}), {
clearOnDrop: false,
flyToOnDrop: true,
clampToGround: true
})
this.viewer.extend(viewerDragDropMixin, fileLayersOptions)
this.viewer.dropError.addEventListener((viewerArg, source, error) => {
logger.error(error)
})
Expand All @@ -31,7 +29,8 @@ export const fileLayers = {
cesium: {
type: 'geoJson',
isVisible: true,
cluster: { pixelRange: 50 },
cluster: _.get(fileLayersOptions, 'cluster', { pixelRange: 50 }),
entityStyle: _.get(fileLayersOptions, 'entityStyle'),
source: source.name // Set the data source name instead of URL in this case
}
})
Expand Down

0 comments on commit dbd0b78

Please sign in to comment.