comparison client/src/components/map/layers.js @ 4378:09406e3b052c

layers: only load fairwaydimensions with staging_done on map
author Thomas Junk <thomas.junk@intevation.de>
date Wed, 11 Sep 2019 16:30:25 +0200
parents ad2bf9580696
children 69166db6ba8a
comparison
equal deleted inserted replaced
4377:4707fa47284a 4378:09406e3b052c
9 import { ImageWMS as ImageSource } from "ol/source"; 9 import { ImageWMS as ImageSource } from "ol/source";
10 import Point from "ol/geom/Point"; 10 import Point from "ol/geom/Point";
11 import { bbox as bboxStrategy } from "ol/loadingstrategy"; 11 import { bbox as bboxStrategy } from "ol/loadingstrategy";
12 import { WFS, GeoJSON } from "ol/format"; 12 import { WFS, GeoJSON } from "ol/format";
13 import OSM from "ol/source/OSM"; 13 import OSM from "ol/source/OSM";
14 import { equalTo } from "ol/format/filter"; 14 import { equalTo, and as andFilter } from "ol/format/filter";
15 import { HTTP } from "@/lib/http"; 15 import { HTTP } from "@/lib/http";
16 import { styleFactory } from "./styles"; 16 import { styleFactory } from "./styles";
17 import store from "@/store/index"; 17 import store from "@/store/index";
18 18
19 export const buildVectorLoader = ( 19 export const buildVectorLoader = (
329 source.setLoader( 329 source.setLoader(
330 buildVectorLoader( 330 buildVectorLoader(
331 { 331 {
332 geometryName: "area", 332 geometryName: "area",
333 featureTypes: ["fairway_dimensions"], 333 featureTypes: ["fairway_dimensions"],
334 filter: equalTo("level_of_service", 1) 334 filter: andFilter(
335 equalTo("level_of_service", 1),
336 equalTo("staging_done", true)
337 )
335 }, 338 },
336 source, 339 source,
337 false 340 false
338 ) 341 )
339 ); 342 );
352 source.setLoader( 355 source.setLoader(
353 buildVectorLoader( 356 buildVectorLoader(
354 { 357 {
355 geometryName: "area", 358 geometryName: "area",
356 featureTypes: ["fairway_dimensions"], 359 featureTypes: ["fairway_dimensions"],
357 filter: equalTo("level_of_service", 2) 360 filter: andFilter(
361 equalTo("level_of_service", 2),
362 equalTo("staging_done", true)
363 )
358 }, 364 },
359 source, 365 source,
360 false 366 false
361 ) 367 )
362 ); 368 );
375 source.setLoader( 381 source.setLoader(
376 buildVectorLoader( 382 buildVectorLoader(
377 { 383 {
378 geometryName: "area", 384 geometryName: "area",
379 featureTypes: ["fairway_dimensions"], 385 featureTypes: ["fairway_dimensions"],
380 filter: equalTo("level_of_service", 3) 386 filter: andFilter(
387 equalTo("level_of_service", 3),
388 equalTo("staging_done", true)
389 )
381 }, 390 },
382 source, 391 source,
383 false 392 false
384 ) 393 )
385 ); 394 );