Mercurial > gemma
annotate client/src/components/Map.jsx @ 158:992e17912405
feat: Improve login against real db
In order to log into our real db, we need to consume
the new JSON document consuming experies, username, roles, etc.
Token is stored securly in browser session.
Other data is stored in vue store.
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Tue, 03 Jul 2018 16:18:29 +0200 |
parents | dc2a5920b731 |
children | 78f96f168b59 |
rev | line source |
---|---|
117
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
1 /*eslint no-unused-vars: ["error", { "args": "none" }]*/ |
123
92e0c636e67c
Upgraded to current Version of OpenLayers
Thomas Junk <thomas.junk@intevation.de>
parents:
117
diff
changeset
|
2 import "ol/ol.css"; |
92e0c636e67c
Upgraded to current Version of OpenLayers
Thomas Junk <thomas.junk@intevation.de>
parents:
117
diff
changeset
|
3 import { Map, View } from "ol"; |
92e0c636e67c
Upgraded to current Version of OpenLayers
Thomas Junk <thomas.junk@intevation.de>
parents:
117
diff
changeset
|
4 import TileLayer from "ol/layer/Tile"; |
92e0c636e67c
Upgraded to current Version of OpenLayers
Thomas Junk <thomas.junk@intevation.de>
parents:
117
diff
changeset
|
5 import OSM from "ol/source/OSM"; |
117
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
6 |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
7 export default { |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
8 render(h) { |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
9 return <div id="map" />; |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
10 }, |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
11 data() { |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
12 return { |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
13 lat: 52.278889, |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
14 long: 8.043056, |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
15 zoom: 12, |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
16 projection: "EPSG:4326" |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
17 }; |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
18 }, |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
19 mounted() { |
123
92e0c636e67c
Upgraded to current Version of OpenLayers
Thomas Junk <thomas.junk@intevation.de>
parents:
117
diff
changeset
|
20 new Map({ |
117
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
21 layers: [ |
123
92e0c636e67c
Upgraded to current Version of OpenLayers
Thomas Junk <thomas.junk@intevation.de>
parents:
117
diff
changeset
|
22 new TileLayer({ |
92e0c636e67c
Upgraded to current Version of OpenLayers
Thomas Junk <thomas.junk@intevation.de>
parents:
117
diff
changeset
|
23 source: new OSM() |
117
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
24 }) |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
25 ], |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
26 target: "map", |
123
92e0c636e67c
Upgraded to current Version of OpenLayers
Thomas Junk <thomas.junk@intevation.de>
parents:
117
diff
changeset
|
27 view: new View({ |
117
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
28 center: [this.long, this.lat], |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
29 zoom: this.zoom, |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
30 projection: this.projection |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
31 }) |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
32 }); |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
33 } |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
34 }; |