Skip to content

Commit a66a50f

Browse files
authored
Merge branch 'wegue-oss:master' into master
2 parents f3fa3f7 + 0c17a54 commit a66a50f

File tree

7 files changed

+65
-16
lines changed

7 files changed

+65
-16
lines changed

app-starter/components/AppHeader.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<template v-slot:activator="{on}">
3636

3737
<v-btn icon v-on="on"
38+
class="wgu-menu-button"
3839
color="onprimary"
3940
:title="$t('wgu-toolbar-menu.title')">
4041
<v-icon medium>menu</v-icon>

src/components/geolocator/Geolocator.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
22
<span>
33
<v-btn @click="geolocateUserAndShowMarkerOnMap" icon
4+
class="wgu-action-button"
45
color="onprimary"
56
:title="$t('wgu-geolocator.title')">
67
<v-icon v-if='this.isSearchingForGeolocation'>update</v-icon>

src/components/infoclick/InfoClickWin.vue

Lines changed: 59 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
<v-card-text v-if="!this.attributeData && !this.coordsData" class="no-data">
1515
{{ $t('wgu-infoclick.mapClick') }}
1616
</v-card-text>
17+
<v-card-actions v-show="attributeData">
18+
<v-spacer class="text-overline">{{ featureIdx + 1 }}/{{ numfeats }}: {{ layerName }}</v-spacer>
19+
<v-btn v-show="numfeats > 1" x-small @click="prevFeat" ><v-icon>mdi-menu-left</v-icon></v-btn>
20+
<v-btn v-show="numfeats > 1" x-small @click="nextFeat" ><v-icon>mdi-menu-right</v-icon></v-btn>
21+
</v-card-actions>
1722

1823
<!-- feature property grid -->
1924
<wgu-property-table :properties="attributeData" />
@@ -65,6 +70,7 @@ import ModuleCard from './../modulecore/ModuleCard';
6570
import { WguEventBus } from '../../WguEventBus.js';
6671
import PropertyTable from './PropertyTable';
6772
import CoordsTable from './CoordsTable';
73+
import MapInteractionUtil from '../../util/MapInteraction';
6874
6975
export default {
7076
name: 'wgu-infoclick-win',
@@ -86,7 +92,11 @@ export default {
8692
return {
8793
moduleName: 'wgu-infoclick',
8894
attributeData: null,
89-
coordsData: null
95+
coordsData: null,
96+
featureIdx: 0,
97+
features: null,
98+
layerName: null,
99+
numfeats: null
90100
}
91101
},
92102
created () {
@@ -115,29 +125,65 @@ export default {
115125
*/
116126
onMapClick (evt) {
117127
const me = this;
118-
const featureLayer = me.map.forEachFeatureAtPixel(evt.pixel,
128+
me.features = []
129+
me.map.forEachFeatureAtPixel(evt.pixel,
119130
(feature, layer) => {
120-
return [feature, layer];
131+
me.features.push([feature, layer])
121132
});
122133
123134
// collect feature attributes --> PropertyTable
124-
if (featureLayer) {
125-
const feat = featureLayer[0];
126-
const props = feat.getProperties();
127-
// do not show geometry property
128-
delete props.geometry;
129-
130-
me.attributeData = props;
135+
if (this.features.length !== 0) {
136+
this.featureIdx = 0
137+
this.numfeats = me.features.length
138+
this.viewProps(this.featureIdx)
131139
} else {
132-
me.attributeData = null;
140+
this.attributeData = null;
133141
}
134142
135143
// collect click coordinate + projection --> CoordsTable
136-
me.coordsData = {
144+
this.coordsData = {
137145
coordinate: evt.coordinate,
138-
projection: me.map.getView().getProjection().getCode()
146+
projection: this.map.getView().getProjection().getCode()
139147
};
140148
},
149+
150+
prevFeat () {
151+
this.featureIdx -= 1
152+
if (this.featureIdx < 0) {
153+
this.featureIdx = this.features.length - 1
154+
}
155+
this.viewProps(this.featureIdx)
156+
},
157+
158+
nextFeat () {
159+
this.featureIdx += 1
160+
if (this.featureIdx > this.features.length - 1) {
161+
this.featureIdx = 0
162+
}
163+
this.viewProps(this.featureIdx)
164+
},
165+
166+
viewProps (idx) {
167+
const infofeat = this.features[idx][0];
168+
const props = infofeat.getProperties();
169+
// do not show geometry property
170+
delete props.geometry;
171+
this.attributeData = props;
172+
this.layerName = this.features[idx][1].get('name')
173+
const lid = this.features[idx][1].get('lid')
174+
175+
const correspondingInteraction = MapInteractionUtil.getSelectInteraction(this.map, lid);
176+
177+
// we can only select layers that have a select interaction
178+
if (!correspondingInteraction) {
179+
return;
180+
}
181+
182+
// add to map selection
183+
correspondingInteraction.getFeatures().clear();
184+
correspondingInteraction.getFeatures().push(infofeat);
185+
},
186+
141187
/**
142188
* (Un-)Register map interactions when the visibility of the module changes.
143189
*

src/components/localeswitcher/LocaleSwitcher.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
color="onprimary"
1010
background-color="transparent"
1111
:title="$t('wgu-localeswitcher.title')"
12-
class="ma-2"
12+
class="ma-2 wgu-menu-button"
1313
icon
1414
v-on="on"
1515
v-bind="attrs"

src/components/maxextentbutton/ZoomToMaxExtentButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<v-btn icon color="onprimary" @click="onClick"
2+
<v-btn icon color="onprimary" @click="onClick" class="wgu-action-button"
33
:title="$t('wgu-zoomtomaxextent.title')">
44
<v-icon medium>{{icon}}</v-icon>
55
</v-btn>

src/components/modulecore/ToggleButton.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
dense
55
color="onprimary"
66
background-color="transparent"
7+
class="wgu-toggle-button"
78
:title="$t(moduleName + '.title')"
89
v-model="show">
910
<v-btn icon :value="true" color="onprimary" @click="toggleUi">

tests/unit/specs/components/infoclick/InfoClickWin.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ describe('infoclick/InfoClickWin.vue', () => {
8686
layers: [layer]
8787
});
8888
map.forEachFeatureAtPixel = () => {
89-
return [feat, layer];
89+
vm.features.push([feat, layer]);
9090
};
9191
vm.map = map;
9292
vm.onMapClick(mockEvt);

0 commit comments

Comments
 (0)