comparison client/src/components/map/layers.js @ 4867:5555b77b8c4e

report backenderror due to failing OL loaders
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 17 Dec 2019 14:27:44 +0100
parents 75d1126f7299
children c4d84be3a476
comparison
equal deleted inserted replaced
4866:9df7794ec969 4867:5555b77b8c4e
56 } 56 }
57 vectorSource.addFeatures(features); 57 vectorSource.addFeatures(features);
58 }) 58 })
59 .catch(() => { 59 .catch(() => {
60 vectorSource.removeLoadedExtent(extent); 60 vectorSource.removeLoadedExtent(extent);
61 store.dispatch("application/reportBackendError");
61 }); 62 });
62 }; 63 };
63 }; 64 };
64 65
65 // SHARED LAYERS: 66 // SHARED LAYERS:
350 HTTP.get(src, { 351 HTTP.get(src, {
351 headers: { 352 headers: {
352 "X-Gemma-Auth": localStorage.getItem("token") 353 "X-Gemma-Auth": localStorage.getItem("token")
353 }, 354 },
354 responseType: "blob" 355 responseType: "blob"
355 }).then(response => { 356 })
356 tile.getImage().src = URL.createObjectURL(response.data); 357 .then(response => {
357 }); 358 tile.getImage().src = URL.createObjectURL(response.data);
359 })
360 .catch(() => {
361 store.dispatch("application/reportBackendError");
362 });
358 } // TODO tile.setState(TileState.ERROR); 363 } // TODO tile.setState(TileState.ERROR);
359 }) 364 })
360 }), 365 }),
361 new TileLayer({ 366 new TileLayer({
362 id: "DIFFERENCES", 367 id: "DIFFERENCES",
376 HTTP.get(src, { 381 HTTP.get(src, {
377 headers: { 382 headers: {
378 "X-Gemma-Auth": localStorage.getItem("token") 383 "X-Gemma-Auth": localStorage.getItem("token")
379 }, 384 },
380 responseType: "blob" 385 responseType: "blob"
381 }).then(response => { 386 })
382 tile.getImage().src = URL.createObjectURL(response.data); 387 .then(response => {
383 }); 388 tile.getImage().src = URL.createObjectURL(response.data);
389 })
390 .catch(() => {
391 store.dispatch("application/reportBackendError");
392 });
384 } // TODO tile.setState(TileState.ERROR); 393 } // TODO tile.setState(TileState.ERROR);
385 }) 394 })
386 }), 395 }),
387 (function() { 396 (function() {
388 const source = new VectorSource({ strategy: bboxStrategy }); 397 const source = new VectorSource({ strategy: bboxStrategy });
472 HTTP.get(src, { 481 HTTP.get(src, {
473 headers: { 482 headers: {
474 "X-Gemma-Auth": localStorage.getItem("token") 483 "X-Gemma-Auth": localStorage.getItem("token")
475 }, 484 },
476 responseType: "blob" 485 responseType: "blob"
477 }).then(response => { 486 })
478 tile.getImage().src = URL.createObjectURL(response.data); 487 .then(response => {
479 }); 488 tile.getImage().src = URL.createObjectURL(response.data);
489 })
490 .catch(() => {
491 store.dispatch("application/reportBackendError");
492 });
480 } // TODO tile.setState(TileState.ERROR); 493 } // TODO tile.setState(TileState.ERROR);
481 }) 494 })
482 }), 495 }),
483 (function() { 496 (function() {
484 const source = new VectorSource({ strategy: bboxStrategy }); 497 const source = new VectorSource({ strategy: bboxStrategy });
599 HTTP.get(src, { 612 HTTP.get(src, {
600 headers: { 613 headers: {
601 "X-Gemma-Auth": localStorage.getItem("token") 614 "X-Gemma-Auth": localStorage.getItem("token")
602 }, 615 },
603 responseType: "blob" 616 responseType: "blob"
604 }).then(response => { 617 })
605 tile.getImage().src = URL.createObjectURL(response.data); 618 .then(response => {
606 }); 619 tile.getImage().src = URL.createObjectURL(response.data);
620 })
621 .catch(() => {
622 store.dispatch("application/reportBackendError");
623 });
607 } // TODO tile.setState(TileState.ERROR); 624 } // TODO tile.setState(TileState.ERROR);
608 }) 625 })
609 }), 626 }),
610 new ImageLayer({ 627 new ImageLayer({
611 id: "DISTANCEMARKSAXIS", 628 id: "DISTANCEMARKSAXIS",