Mercurial > gemma
annotate client/src/components/Map.jsx @ 117:5e95c62a7e74
Move component. Re-add Css.
Move components to separate folders.
Re-adding login css to appropriate component
(=undoing ae6535d44563) according to vue style.
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Tue, 26 Jun 2018 17:26:34 +0200 |
parents | |
children | 92e0c636e67c |
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" }]*/ |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
2 import ol_Map from "ol/map"; |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
3 import ol_layer_Tile from "ol/layer/tile"; |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
4 import ol_source_OSM from "ol/source/osm"; |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
5 import ol_View from "ol/view"; |
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() { |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
20 console.log(this.centerX); |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
21 new ol_Map({ |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
22 layers: [ |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
23 new ol_layer_Tile({ |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
24 source: new ol_source_OSM() |
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 ], |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
27 target: "map", |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
28 view: new ol_View({ |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
29 center: [this.long, this.lat], |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
30 zoom: this.zoom, |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
31 projection: this.projection |
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 } |
5e95c62a7e74
Move component. Re-add Css.
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
35 }; |