Allow string to be passed as ol.interaction.Draw type

This commit is contained in:
Frederic Junod
2017-11-21 09:55:52 +01:00
parent ae6ba195f7
commit c0d57ad005
10 changed files with 14 additions and 14 deletions

View File

@@ -86,19 +86,19 @@ var Draw = {
},
Point: new ol.interaction.Draw({
source: vector.getSource(),
type: /** @type {ol.geom.GeometryType} */ ('Point')
type: 'Point'
}),
LineString: new ol.interaction.Draw({
source: vector.getSource(),
type: /** @type {ol.geom.GeometryType} */ ('LineString')
type: 'LineString'
}),
Polygon: new ol.interaction.Draw({
source: vector.getSource(),
type: /** @type {ol.geom.GeometryType} */ ('Polygon')
type: 'Polygon'
}),
Circle: new ol.interaction.Draw({
source: vector.getSource(),
type: /** @type {ol.geom.GeometryType} */ ('Circle')
type: 'Circle'
}),
getActive: function() {
return this.activeType ? this[this.activeType].getActive() : false;