Mercurial > gemma
diff client/src/map/store.js @ 701:8149772c62d6
client: add bbox loading strategy to riverkilometre
* Change Maplayer.vue to offer a buildVectorLoader which can
be used to implement a loading strategy that will only load
the extents that are currently viewed.
* Change the Distance Marks, Axis layer to use this new way of loading.
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Thu, 20 Sep 2018 23:40:22 +0200 |
parents | 8c3c43595d39 |
children | aaf5dbfb9512 |
line wrap: on
line diff
--- a/client/src/map/store.js Thu Sep 20 21:50:18 2018 +0200 +++ b/client/src/map/store.js Thu Sep 20 23:40:22 2018 +0200 @@ -5,6 +5,7 @@ import OSM from "ol/source/OSM"; import { Stroke, Style, Fill, Text, Circle as CircleStyle } from "ol/style.js"; import VectorSource from "ol/source/Vector.js"; +import { bbox as bboxStrategy } from "ol/loadingstrategy"; const MapStore = { namespaced: true, @@ -93,7 +94,9 @@ { name: "Distance marks, Axis", data: new VectorLayer({ - source: new VectorSource(), + source: new VectorSource({ + strategy: bboxStrategy + }), style: function(feature, resolution) { if (resolution < 10) { var s = new Style({