-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #417 from geoadmin/feat_BGDIINF_SB-2958_groundwork…
…_cesium_components
- Loading branch information
Showing
19 changed files
with
172 additions
and
176 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
src/modules/infobox/FeatureElevationProfilePlotOpenLayersBridge.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<template> | ||
<slot /> | ||
</template> | ||
<script> | ||
import { LV95, WEBMERCATOR } from '@/utils/coordinateSystems' | ||
import { FeatureStyleColor, RED } from '@/utils/featureStyleUtils' | ||
import Overlay from 'ol/Overlay' | ||
import proj4 from 'proj4' | ||
export default { | ||
inject: ['getMap'], | ||
props: { | ||
coordinates: { | ||
type: Array, | ||
default: null, | ||
}, | ||
trackingPointColor: { | ||
type: FeatureStyleColor, | ||
default: RED, | ||
}, | ||
}, | ||
watch: { | ||
coordinates(newCoordinates) { | ||
if (newCoordinates) { | ||
this.currentHoverPosOverlay.setPosition( | ||
proj4(LV95.epsg, WEBMERCATOR.epsg, newCoordinates) | ||
) | ||
this.addHoverPositionOverlay() | ||
} else { | ||
this.currentHoverPosOverlay.setPosition(null) | ||
this.removeHoverPositionOverlay() | ||
} | ||
}, | ||
trackingPointColor(newColor) { | ||
this.currentHoverPosOverlay.getElement().style.backgroundColor = newColor.fill | ||
}, | ||
}, | ||
mounted() { | ||
// Overlay that shows the corresponding position on the OL map when hovering over the profile graph. | ||
this.currentHoverPosOverlay = new Overlay({ | ||
element: document.createElement('div'), | ||
positioning: 'center-center', | ||
stopEvent: false, | ||
}) | ||
// setting up a CSS class on the element so that we can style it (see below in the <style> section) | ||
this.currentHoverPosOverlay.getElement().classList.add('profile-circle-current-hover-pos') | ||
this.currentHoverPosOverlay.getElement().style.backgroundColor = | ||
this.trackingPointColor.fill | ||
if (this.coordinates) { | ||
this.currentHoverPosOverlay.setPosition( | ||
proj4(LV95.epsg, WEBMERCATOR.epsg, this.coordinates) | ||
) | ||
this.addHoverPositionOverlay() | ||
} | ||
}, | ||
unmounted() { | ||
this.removeHoverPositionOverlay() | ||
}, | ||
methods: { | ||
addHoverPositionOverlay() { | ||
this.getMap()?.addOverlay(this.currentHoverPosOverlay) | ||
}, | ||
removeHoverPositionOverlay() { | ||
this.getMap()?.removeOverlay(this.currentHoverPosOverlay) | ||
}, | ||
}, | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.