Skip to content

Commit 08552ca

Browse files
committed
Unify geoserver anomaly and value layers.
1 parent af48bce commit 08552ca

File tree

3 files changed

+24
-16
lines changed

3 files changed

+24
-16
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "metrics",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "Mosquito Alert metrics",
55
"productName": "Metrics | Mosquito Alert",
66
"author": "Guillermo Sanz <[email protected]>",

src/components/BiteIndexMap/index.vue

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -220,24 +220,32 @@ watch(
220220
/**
221221
* WMS Layers (Metric Value and Anomaly)
222222
*/
223-
const getWmsSource = (styleName: string) =>
224-
new TileWMS({
225-
// crossOrigin: 'anonymous',
226-
projection: mapStore.projection,
227-
url: process.env.GEOSERVER_URL,
228-
params: {
229-
LAYERS: `mosquitoalert:${styleName}`,
230-
SRS: mapStore.projection,
231-
viewparams: 'date:' + mapStore.lastDate,
232-
},
233-
});
234-
const valueSource = getWmsSource('metric');
223+
const valueSource = new TileWMS({
224+
// crossOrigin: 'anonymous',
225+
projection: mapStore.projection,
226+
url: process.env.GEOSERVER_URL,
227+
params: {
228+
LAYERS: 'mosquitoalert:metric',
229+
SRS: mapStore.projection,
230+
viewparams: 'date:' + mapStore.lastDate,
231+
},
232+
});
235233
const valueLayer = new TileLayer({
236234
className: 'wms-layer',
237235
zIndex: 3,
238236
source: valueSource,
239237
});
240-
const anomalySource = getWmsSource('metric-anomaly');
238+
const anomalySource = new TileWMS({
239+
// crossOrigin: 'anonymous',
240+
projection: mapStore.projection,
241+
url: process.env.GEOSERVER_URL,
242+
params: {
243+
LAYERS: 'mosquitoalert:metric',
244+
SRS: mapStore.projection,
245+
viewparams: 'date:' + mapStore.lastDate,
246+
STYLES: 'anomalystyle',
247+
},
248+
});
241249
const anomalyLayer = new TileLayer({
242250
className: 'anomaly-layer',
243251
zIndex: 4,

0 commit comments

Comments
 (0)