Skip to content

Commit

Permalink
Merge pull request #45 from openlayers/upgrade-ol-3.13.1
Browse files Browse the repository at this point in the history
Upgrade to use v3.13.1 of OpenLayers
  • Loading branch information
marcjansen committed Feb 18, 2016
2 parents 4c181d1 + 7f1c6f1 commit b941d0a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 12 additions & 0 deletions src/controls/draw.md
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
```
Binary file modified src/layers/proprietary1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/layers/wms1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"start": "node serve.js"
},
"dependencies": {
"openlayers": "3.9.0"
"openlayers": "3.13.1"
}
}

0 comments on commit b941d0a

Please sign in to comment.