I am trying to delete all graphics within a polygon, but the following code only removes the first graphic. Any suggestions?
fieldGeom is a valid polygon. It removes one point graphic, but then exits loop and does not remove a second point graphic.
Thanks!
| | this.pointGraphics.graphics.forEach(function (g) { |
| | for (var x = 0; x < fieldIds.length; x++) { |
| | fieldGeom = that.getFieldGeometry(fieldIds); |
| | if (fieldGeom.contains(g.geometry) === true) { |
| | that.pointGraphics.remove(g); |
| | } |
| | } |
| | }); |