3
0
Fork 0
mirror of https://github.com/farmOS/farmOS.git synced 2024-02-23 11:37:38 +01:00

Add the measure behavior to WKT layers.

This commit is contained in:
Michael Stenta 2020-01-30 13:40:26 -05:00
parent 8baceff31f
commit a9a712952b

View file

@ -15,14 +15,17 @@
opts.wkt = wkt;
}
var layer = instance.addLayer(type, opts);
instance.addBehavior('measure', { layer: layer });
}
// If edit is true, enable drawing controls.
if (Drupal.settings.farm_map.behaviors.wkt.edit) {
if (layer !== undefined) {
instance.addBehavior('edit', { layer: layer });
instance.addBehavior('measure', { layer: layer });
} else {
instance.addBehavior('edit');
instance.addBehavior('measure', { layer: instance.edit.layer });
}
}