Mercurial > gemma
comparison client/src/store/map.js @ 1927:5a37ee321651
client: make isolines legend graphic internally availableo
* Add isolines legend graphic to vuex store. Rename it to reflect
it being a dataURL now.
* License header: for store/map.js add 2019 and author BER.
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Mon, 21 Jan 2019 10:56:14 +0100 |
parents | 9a2fbeaabd52 |
children | 52a6e63d5dcc |
comparison
equal
deleted
inserted
replaced
1926:1220cfe96efd | 1927:5a37ee321651 |
---|---|
2 * without warranty, see README.md and license for details. | 2 * without warranty, see README.md and license for details. |
3 * | 3 * |
4 * SPDX-License-Identifier: AGPL-3.0-or-later | 4 * SPDX-License-Identifier: AGPL-3.0-or-later |
5 * License-Filename: LICENSES/AGPL-3.0.txt | 5 * License-Filename: LICENSES/AGPL-3.0.txt |
6 * | 6 * |
7 * Copyright (C) 2018 by via donau | 7 * Copyright (C) 2018, 2019 by via donau |
8 * – Österreichische Wasserstraßen-Gesellschaft mbH | 8 * – Österreichische Wasserstraßen-Gesellschaft mbH |
9 * Software engineering by Intevation GmbH | 9 * Software engineering by Intevation GmbH |
10 * | 10 * |
11 * Author(s): | 11 * Author(s): |
12 * Markus Kottländer <markus@intevation.de> | 12 * * Bernhard Reiter <bernhard.reiter@intevation.de> |
13 * Thomas Junk <thomas.junk@intevation.de> | 13 * * Markus Kottländer <markus@intevation.de> |
14 * * Thomas Junk <thomas.junk@intevation.de> | |
14 */ | 15 */ |
15 | 16 |
16 //import { HTTP } from "../lib/http"; | 17 //import { HTTP } from "../lib/http"; |
17 | 18 |
18 import TileWMS from "ol/source/TileWMS.js"; | 19 import TileWMS from "ol/source/TileWMS.js"; |
43 identifiedFeatures: [], // map features identified by clicking on the map | 44 identifiedFeatures: [], // map features identified by clicking on the map |
44 currentMeasurement: null, // distance or area from line-/polygon-/cutTool | 45 currentMeasurement: null, // distance or area from line-/polygon-/cutTool |
45 lineTool: null, // open layers interaction object (Draw) | 46 lineTool: null, // open layers interaction object (Draw) |
46 polygonTool: null, // open layers interaction object (Draw) | 47 polygonTool: null, // open layers interaction object (Draw) |
47 cutTool: null, // open layers interaction object (Draw) | 48 cutTool: null, // open layers interaction object (Draw) |
49 isolinesLegendImgDataURL: "", | |
48 layers: [ | 50 layers: [ |
49 { | 51 { |
50 name: "Open Streetmap", | 52 name: "Open Streetmap", |
51 data: new TileLayer({ | 53 data: new TileLayer({ |
52 source: new OSM() | 54 source: new OSM() |
391 view.animate({ | 393 view.animate({ |
392 zoom: preventZoomOut ? Math.max(zoom, currentZoom) : zoom, | 394 zoom: preventZoomOut ? Math.max(zoom, currentZoom) : zoom, |
393 center: fromLonLat(coordinates, view.getProjection()), | 395 center: fromLonLat(coordinates, view.getProjection()), |
394 duration: 700 | 396 duration: 700 |
395 }); | 397 }); |
398 }, | |
399 isolinesLegendImgDataURL: (state, isolinesLegendImgDataURL) => { | |
400 state.isolinesLegendImgDataURL = isolinesLegendImgDataURL; | |
396 } | 401 } |
397 }, | 402 }, |
398 actions: { | 403 actions: { |
399 openLayersMap({ commit, dispatch, getters }, map) { | 404 openLayersMap({ commit, dispatch, getters }, map) { |
400 const drawVectorSrc = getters.getVSourceByName("Draw Tool"); | 405 const drawVectorSrc = getters.getVSourceByName("Draw Tool"); |