comparison client/src/components/layers/layers.js @ 5159:e688e79a51e8

Use ImageLayer instead of TileLayer for FairwayMarks Improves performance when using time slider.
author Raimund Renkert <raimund@renkert.org>
date Thu, 02 Apr 2020 16:12:24 +0200
parents 2584fedb2e99
children a17c2a0b8e44
comparison
equal deleted inserted replaced
5158:c8d36d585f6f 5159:e688e79a51e8
740 maxResolution: 100, 740 maxResolution: 100,
741 minResolution: 0, 741 minResolution: 0,
742 source 742 source
743 }); 743 });
744 })(), 744 })(),
745 new TileLayer({ 745 new ImageLayer({
746 id: "FAIRWAYMARKS", 746 id: "FAIRWAYMARKS",
747 label: "Fairway marks", 747 label: "Fairway marks",
748 visible: true, 748 visible: true,
749 source: new TileWMS({ 749 source: new ImageSource({
750 preload: 0, 750 preload: 0,
751 projection: "EPSG:3857", 751 projection: "EPSG:3857",
752 url: window.location.origin + "/api/internal/wms", 752 url: window.location.origin + "/api/internal/wms",
753 params: { 753 params: {
754 LAYERS: "fairway_marks", 754 LAYERS: "fairway_marks",
755 VERSION: "1.1.1", 755 VERSION: "1.1.1",
756 TILED: true, 756 TILED: true,
757 TIME: store.state.application.refreshLayersTime.toISOString() 757 TIME: store.state.application.refreshLayersTime.toISOString()
758 }, 758 },
759 tileLoadFunction: function(tile, src) { 759 imageLoadFunction: function(tile, src) {
760 HTTP.get(src, { 760 HTTP.get(src, {
761 headers: { 761 headers: {
762 "X-Gemma-Auth": localStorage.getItem("token") 762 "X-Gemma-Auth": localStorage.getItem("token")
763 }, 763 },
764 responseType: "blob" 764 responseType: "blob"