Skip to content

Commit

Permalink
Merge pull request #635 from Deltares/611-remove-transparency-from-lo…
Browse files Browse the repository at this point in the history
…cation-circles

Set higher opacity for the location circles
  • Loading branch information
vanmeeuwen authored and hvangeffen committed Jan 18, 2024
2 parents cc14820 + dafe916 commit 79c459f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
19 changes: 14 additions & 5 deletions src/components/spatialdisplay/SpatialDisplay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@location-click="onLocationClick"
></SpatialDisplayComponent>
</div>
<div v-if="props.locationId" class="child-container">
<div v-if="hasTimeSeries" class="child-container">
<router-view
@close="closeTimeSeriesDisplay"
:filterIds="props.filterIds"
Expand All @@ -30,6 +30,8 @@ interface Props {
layerName?: string
locationId?: string
filterIds?: string[]
latitude?: number
longitude?: number
}
const props = withDefaults(defineProps<Props>(), {
Expand All @@ -44,12 +46,15 @@ const { mobile } = useDisplay()
const currentLocationId = ref<string>('')
onMounted(() => {
currentLocationId.value === props.locationId
if (!props.locationId) return
currentLocationId.value = props.locationId
})
const hideMap = computed(() => {
return mobile.value && props.locationId
})
const hideMap = computed(() => mobile.value && hasTimeSeries.value)
const hasTimeSeries = computed(
() => props.locationId || (props.latitude && props.longitude),
)
function onLocationClick(event: MapLayerMouseEvent | MapLayerTouchEvent): void {
if (!event.features) return
Expand Down Expand Up @@ -118,4 +123,8 @@ watch(
height: 100%;
width: 100%;
}
.child-container.hidden {
display: none !important;
}
</style>
9 changes: 1 addition & 8 deletions src/components/wms/LocationsLayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const defaultLocationsLayerOptions: CircleLayer = {
paint: {
'circle-radius': 5,
'circle-color': '#dfdfdf',
'circle-opacity': 0.5,
'circle-opacity': 0.75,
'circle-stroke-color': 'black',
'circle-stroke-width': 1.5,
},
Expand Down Expand Up @@ -134,13 +134,6 @@ function highlightSelectedLocationOnMap() {
7, // radius for selected location
5, // default radius
]),
map.value.setPaintProperty(locationsLayerSourceId, 'circle-opacity', [
'match',
['get', 'locationId'],
locationId,
0.8,
0.5,
]),
map.value.setLayoutProperty(locationsLayerSourceId, 'circle-sort-key', [
'match',
['get', 'locationId'],
Expand Down

0 comments on commit 79c459f

Please sign in to comment.