Mercurial > gemma
comparison client/src/components/map/layers.js @ 3081:9107c959bb3b
client: Changed distance marks ashore to WMS layer.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 18 Apr 2019 13:26:02 +0200 |
parents | 3cf7189fa93e |
children | a9c7825303b3 |
comparison
equal
deleted
inserted
replaced
3080:22857a12ed9e | 3081:9107c959bb3b |
---|---|
330 zIndex: 1, | 330 zIndex: 1, |
331 style: styles.bottleneckStatus, | 331 style: styles.bottleneckStatus, |
332 source | 332 source |
333 }); | 333 }); |
334 })(), | 334 })(), |
335 (function() { | 335 new ImageLayer({ |
336 const source = new VectorSource({ strategy: bboxStrategy }); | 336 id: "DISTANCEMARKS", |
337 source.setLoader( | 337 label: "Distance Marks", |
338 buildVectorLoader( | 338 maxResolution: 10, |
339 { | 339 minResolution: 0, |
340 featureTypes: ["distance_marks_ashore_geoserver"], | 340 source: new ImageSource({ |
341 geometryName: "geom" | 341 url: window.location.origin + "/api/internal/wms", |
342 }, | 342 params: { |
343 source | 343 LAYERS: "distance_marks_ashore_geoserver", |
344 ) | 344 VERSION: "1.1.1", |
345 ); | 345 TILED: true |
346 return new VectorLayer({ | 346 }, |
347 id: "DISTANCEMARKS", | 347 imageLoadFunction: function(tile, src) { |
348 label: "Distance marks", | 348 HTTP.get(src, { |
349 forLegendStyle: { point: true, resolution: 8 }, | 349 headers: { |
350 visible: false, | 350 "X-Gemma-Auth": localStorage.getItem("token") |
351 source | 351 }, |
352 }); | 352 responseType: "blob" |
353 })(), | 353 }).then(response => { |
354 tile.getImage().src = URL.createObjectURL(response.data); | |
355 }); | |
356 } // TODO tile.setState(TileState.ERROR); | |
357 }) | |
358 }), | |
354 new ImageLayer({ | 359 new ImageLayer({ |
355 id: "DISTANCEMARKSAXIS", | 360 id: "DISTANCEMARKSAXIS", |
356 label: "Distance Marks, Axis", | 361 label: "Distance Marks, Axis", |
357 source: new ImageSource({ | 362 source: new ImageSource({ |
358 url: window.location.origin + "/api/internal/wms", | 363 url: window.location.origin + "/api/internal/wms", |