From a64102f09766b26e418489525291ddc81c5ec983 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Fri, 7 Jan 2022 13:39:46 -0700 Subject: [PATCH] Update modify features example --- examples/modify-features.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/examples/modify-features.js b/examples/modify-features.js index 488508fe35..ad2891ec09 100644 --- a/examples/modify-features.js +++ b/examples/modify-features.js @@ -1,21 +1,19 @@ import GeoJSON from '../src/ol/format/GeoJSON.js'; import Map from '../src/ol/Map.js'; +import VectorLayer from '../src/ol/layer/Vector.js'; +import VectorSource from '../src/ol/source/Vector.js'; import View from '../src/ol/View.js'; import { Modify, Select, defaults as defaultInteractions, } from '../src/ol/interaction.js'; -import {OSM, Vector as VectorSource} from '../src/ol/source.js'; -import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js'; - -const raster = new TileLayer({ - source: new OSM(), -}); +import {fromLonLat} from '../src/ol/proj.js'; const vector = new VectorLayer({ + background: 'white', source: new VectorSource({ - url: 'data/geojson/countries.geojson', + url: 'https://openlayers.org/data/vector/us-states.json', format: new GeoJSON(), wrapX: false, }), @@ -31,10 +29,10 @@ const modify = new Modify({ const map = new Map({ interactions: defaultInteractions().extend([select, modify]), - layers: [raster, vector], + layers: [vector], target: 'map', view: new View({ - center: [0, 0], - zoom: 2, + center: fromLonLat([-100, 38.5]), + zoom: 4, }), });