Skip to content

Commit

Permalink
Merge pull request ngageoint#899 in WV/opensphere from ~SALANKEYJ/ope…
Browse files Browse the repository at this point in the history
…nsphere:THIN-14237 to master

* commit '5825ef15b34d4c09939a0a8d0fbc8c95c0983c52':
  fix(draw): fixes issues with draw interaction selections
  • Loading branch information
jsalankey committed Sep 4, 2019
2 parents 2442b35 + 5825ef1 commit 3141442
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/os/ui/draw/basedrawcontrols.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,24 @@ os.ui.draw.BaseDrawControlsCtrl.prototype.setFeature = function(f) {
* @protected
*/
os.ui.draw.BaseDrawControlsCtrl.prototype.setSelectedControl = function(type) {
this.interaction = null;
if (this.interaction) {
this.interaction.setActive(false);
this.interaction = null;
}

var map = this.getMap();
if (map) {
var interactions = map.getInteractions().getArray();
for (var i = 0, n = interactions.length; i < n; i++) {
var interaction = /** @type {os.ui.ol.interaction.AbstractDraw} */ (interactions[i]);
if (interaction instanceof os.ui.ol.interaction.AbstractDraw) {
if (interaction instanceof os.ui.ol.interaction.AbstractDraw &&
!(interaction instanceof os.interaction.DragZoom)) {
var active = interaction.isType(type);
interaction.setActive(active);

if (active) {
this.interaction = interaction;
break;
}
}
}
Expand Down

0 comments on commit 3141442

Please sign in to comment.