annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
1 /*eslint no-unused-vars: ["error", { "args": "none" }]*/
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
2 import ol_Map from "ol/map";
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
3 import ol_layer_Tile from "ol/layer/tile";
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
4 import ol_source_OSM from "ol/source/osm";
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
5 import ol_View from "ol/view";
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
6
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
7 export default {
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
8 render(h) {
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
9 return <div id="map" />;
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
10 },
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
11 data() {
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
12 return {
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
13 lat: 52.278889,
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
14 long: 8.043056,
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
15 zoom: 12,
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
16 projection: "EPSG:4326"
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
17 };
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
18 },
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
19 mounted() {
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
20 console.log(this.centerX);
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
21 new ol_Map({
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
22 layers: [
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
23 new ol_layer_Tile({
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
24 source: new ol_source_OSM()
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
25 })
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
26 ],
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
27 target: "map",
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
28 view: new ol_View({
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
29 center: [this.long, this.lat],
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
30 zoom: this.zoom,
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
31 projection: this.projection
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
32 })
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
33 });
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
34 }
7ba0a77fd679 ol component added
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
35 };