Skip to content

Commit

Permalink
Merge pull request leforthomas#5 from Aviture/remove-markers-safely
Browse files Browse the repository at this point in the history
Add check to safely remove markers
  • Loading branch information
Jed Fong committed Jan 27, 2016
2 parents 0fd2e69 + 409ad09 commit 216546d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions DrawHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,9 @@ var DrawHelper = (function() {

this.startDrawing(
function() {
markers.remove();
if (markers != null) {
markers.remove();
}
mouseHandler.destroy();
tooltip.setVisible(false);
}
Expand Down Expand Up @@ -857,7 +859,9 @@ var DrawHelper = (function() {
this.startDrawing(
function() {
primitives.remove(poly);
markers.remove();
if (markers != null) {
markers.remove();
}
mouseHandler.destroy();
tooltip.setVisible(false);
}
Expand Down Expand Up @@ -968,7 +972,9 @@ var DrawHelper = (function() {
if(extent != null) {
primitives.remove(extent);
}
markers.remove();
if (markers != null) {
markers.remove();
}
mouseHandler.destroy();
tooltip.setVisible(false);
}
Expand Down Expand Up @@ -1050,7 +1056,9 @@ var DrawHelper = (function() {
if(circle != null) {
primitives.remove(circle);
}
markers.remove();
if (markers != null) {
markers.remove();
}
mouseHandler.destroy();
tooltip.setVisible(false);
}
Expand Down

0 comments on commit 216546d

Please sign in to comment.