editor: add holes to new polygons

This commit is contained in:
Laura Klünder 2016-12-12 12:51:48 +01:00
parent 1664458dd9
commit 52958ec5fc

View file

@ -462,7 +462,7 @@ editor = {
_click_editing_layer: function(e) {
// click callback for a currently edited layer. create a hole on ctrl+click.
if ((e.originalEvent.ctrlKey || e.originalEvent.metaKey)) {
if (e.target.feature.geometry.type == 'Polygon') {
if (e.target instanceof L.Polygon) {
this.editor.newHole(e.latlng);
}
}