Mercurial > gemma
comparison client/src/views/Map.jsx @ 30:7ba0a77fd679
ol component added
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Mon, 25 Jun 2018 18:05:50 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
27:c3e2cd7fa46f | 30:7ba0a77fd679 |
---|---|
1 /*eslint no-unused-vars: ["error", { "args": "none" }]*/ | |
2 import ol_Map from "ol/map"; | |
3 import ol_layer_Tile from "ol/layer/tile"; | |
4 import ol_source_OSM from "ol/source/osm"; | |
5 import ol_View from "ol/view"; | |
6 | |
7 export default { | |
8 render(h) { | |
9 return <div id="map" />; | |
10 }, | |
11 data() { | |
12 return { | |
13 lat: 52.278889, | |
14 long: 8.043056, | |
15 zoom: 12, | |
16 projection: "EPSG:4326" | |
17 }; | |
18 }, | |
19 mounted() { | |
20 console.log(this.centerX); | |
21 new ol_Map({ | |
22 layers: [ | |
23 new ol_layer_Tile({ | |
24 source: new ol_source_OSM() | |
25 }) | |
26 ], | |
27 target: "map", | |
28 view: new ol_View({ | |
29 center: [this.long, this.lat], | |
30 zoom: this.zoom, | |
31 projection: this.projection | |
32 }) | |
33 }); | |
34 } | |
35 }; |