diff client/src/components/Map.jsx @ 123:92e0c636e67c

Upgraded to current Version of OpenLayers As of v5.0.0 OpenLayers has adapted common conventions from the JS ecosystem. As the changes fit our current use case better, an upgrade to v5.0.0 is a good idea. For more details see upstream: https://github.com/openlayers/openlayers/releases/tag/v5.0.0
author Thomas Junk <thomas.junk@intevation.de>
date Wed, 27 Jun 2018 12:59:06 +0200
parents 5e95c62a7e74
children dc2a5920b731
line wrap: on
line diff
--- a/client/src/components/Map.jsx	Wed Jun 27 12:24:13 2018 +0200
+++ b/client/src/components/Map.jsx	Wed Jun 27 12:59:06 2018 +0200
@@ -1,8 +1,8 @@
 /*eslint no-unused-vars: ["error", { "args": "none" }]*/
-import ol_Map from "ol/map";
-import ol_layer_Tile from "ol/layer/tile";
-import ol_source_OSM from "ol/source/osm";
-import ol_View from "ol/view";
+import "ol/ol.css";
+import { Map, View } from "ol";
+import TileLayer from "ol/layer/Tile";
+import OSM from "ol/source/OSM";
 
 export default {
   render(h) {
@@ -18,14 +18,14 @@
   },
   mounted() {
     console.log(this.centerX);
-    new ol_Map({
+    new Map({
       layers: [
-        new ol_layer_Tile({
-          source: new ol_source_OSM()
+        new TileLayer({
+          source: new OSM()
         })
       ],
       target: "map",
-      view: new ol_View({
+      view: new View({
         center: [this.long, this.lat],
         zoom: this.zoom,
         projection: this.projection