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

@@ -54,7 +54,7 @@ var typeSelect = document.getElementById('type');
function addInteractions() {
draw = new ol.interaction.Draw({
source: source,
type: /** @type {ol.geom.GeometryType} */ (typeSelect.value)
type: typeSelect.value
});
map.addInteraction(draw);
snap = new ol.interaction.Snap({source: source});