Skip to content

Commit

Permalink
DDF-2687 Update vendored DrawHelper to not remove overlapping points (#…
Browse files Browse the repository at this point in the history
…1534)

- See leforthomas/cesium-drawhelper#13 for details.
 - At lower zooms, points were being erroneously removed from drawings.
  • Loading branch information
andrewkfiedler authored Jan 16, 2017
1 parent 64b9d68 commit 2f009e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -933,12 +933,8 @@ var DrawHelper = (function() {
if (cartesian) {
_self.stopDrawing();
if(typeof options.callback == 'function') {
// remove overlapping ones
var index = positions.length - 1;
// TODO - calculate some epsilon based on the zoom level
var epsilon = Cesium.Math.EPSILON3;
for(; index > 0 && positions[index].equalsEpsilon(positions[index - 1], epsilon); index--) {}
options.callback(positions.splice(0, index + 1));
//https://github.com/leforthomas/cesium-drawhelper/issues/13
options.callback(positions);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -933,12 +933,8 @@ var DrawHelper = (function() {
if (cartesian) {
_self.stopDrawing();
if(typeof options.callback == 'function') {
// remove overlapping ones
var index = positions.length - 1;
// TODO - calculate some epsilon based on the zoom level
var epsilon = Cesium.Math.EPSILON3;
for(; index > 0 && positions[index].equalsEpsilon(positions[index - 1], epsilon); index--) {}
options.callback(positions.splice(0, index + 1));
//https://github.com/leforthomas/cesium-drawhelper/issues/13
options.callback(positions);
}
}
}
Expand Down

0 comments on commit 2f009e6

Please sign in to comment.