diff --git a/package.json b/package.json index f2d6a3fe..c9eae193 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "deploy": "npm run build && gh-pages --dist build/openlayers-workshop" }, "dependencies": { - "openlayers": "3.9.0" + "openlayers": "3.13.1" }, "devDependencies": { "gh-pages": "^0.4.0", diff --git a/src/controls/draw.md b/src/controls/draw.md index 43cc0641..8b9e21e5 100644 --- a/src/controls/draw.md +++ b/src/controls/draw.md @@ -79,3 +79,15 @@ New features can be drawn by using an `ol.interaction.Draw`. A draw interaction ### Bonus Tasks 1. Create a listener which gets the new feature's X and Y after it is drawn. + +### Solutions + +Here is a solution for the first bonus task. In it we register an event listener for the `drawend` event of the `ol.interaction.Draw`. This method logs the feature's X and Y to the developer console: + +```js +draw.on('drawend', function(evt){ + var feature = evt.feature; + var p = feature.getGeometry(); + console.log(p.getCoordinates()); +}); +``` diff --git a/src/layers/proprietary1.png b/src/layers/proprietary1.png index cb673544..5516f78e 100644 Binary files a/src/layers/proprietary1.png and b/src/layers/proprietary1.png differ diff --git a/src/layers/wms1.png b/src/layers/wms1.png index 030ce908..1d5bf266 100644 Binary files a/src/layers/wms1.png and b/src/layers/wms1.png differ diff --git a/src/package.json b/src/package.json index b3d6c90f..46330ac7 100644 --- a/src/package.json +++ b/src/package.json @@ -16,6 +16,6 @@ "start": "node serve.js" }, "dependencies": { - "openlayers": "3.9.0" + "openlayers": "3.13.1" } }