geojs 1.12.6 → 1.12.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geojs",
3
- "version": "1.12.6",
3
+ "version": "1.12.7",
4
4
  "description": "JavaScript Geo Visualization and Analysis Library",
5
5
  "homepage": "https://github.com/OpenGeoscience/geojs",
6
6
  "license": "Apache-2.0",
@@ -97,6 +97,11 @@
97
97
  "webpack-merge": "^6.0.1",
98
98
  "webpack-string-replacer": "^0.0.20"
99
99
  },
100
+ "overrides": {
101
+ "npm-run-all": {
102
+ "cross-spawn": "^7.0.5"
103
+ }
104
+ },
100
105
  "release": {
101
106
  "plugins": [
102
107
  "@semantic-release/commit-analyzer",
@@ -496,8 +496,7 @@ var annotationLayer = function (arg) {
496
496
  * @fires geo.event.annotation.add
497
497
  */
498
498
  this.addAnnotation = function (annotation, gcs, update) {
499
- var pos = $.inArray(annotation, m_annotations);
500
- if (pos < 0) {
499
+ if (m_annotationIds[annotation.id()] === undefined) {
501
500
  while (m_this.annotationById(annotation.id())) {
502
501
  annotation.newId();
503
502
  }
@@ -530,12 +529,14 @@ var annotationLayer = function (arg) {
530
529
  * @param {geo.annotation} annotation The annotation to remove.
531
530
  * @param {boolean} [update] If `false`, don't update the layer after removing
532
531
  * the annotation.
532
+ * @param {int} [pos] The posiiton of the annotation in the annotation list,
533
+ * if known. This speeds up the process.
533
534
  * @returns {boolean} `true` if an annotation was removed.
534
535
  * @fires geo.event.annotation.remove
535
536
  */
536
- this.removeAnnotation = function (annotation, update) {
537
- var pos = $.inArray(annotation, m_annotations);
538
- if (pos >= 0) {
537
+ this.removeAnnotation = function (annotation, update, pos) {
538
+ if (annotation.id && m_annotationIds[annotation.id()] !== undefined) {
539
+ pos = $.inArray(annotation, m_annotations);
539
540
  if (annotation === m_this.currentAnnotation) {
540
541
  m_this.currentAnnotation = null;
541
542
  }
@@ -551,8 +552,9 @@ var annotationLayer = function (arg) {
551
552
  m_this.geoTrigger(geo_event.annotation.remove, {
552
553
  annotation: annotation
553
554
  });
555
+ return true;
554
556
  }
555
- return pos >= 0;
557
+ return false;
556
558
  };
557
559
 
558
560
  /**
@@ -565,14 +567,13 @@ var annotationLayer = function (arg) {
565
567
  * @returns {number} The number of annotations that were removed.
566
568
  */
567
569
  this.removeAllAnnotations = function (skipCreating, update) {
568
- var removed = 0, annotation, pos = 0;
569
- while (pos < m_annotations.length) {
570
+ var removed = 0, annotation;
571
+ for (let pos = m_annotations.length - 1; pos >= 0; pos -= 1) {
570
572
  annotation = m_annotations[pos];
571
573
  if (skipCreating && annotation.state() === geo_annotation.state.create) {
572
- pos += 1;
573
574
  continue;
574
575
  }
575
- m_this.removeAnnotation(annotation, false);
576
+ m_this.removeAnnotation(annotation, false, pos);
576
577
  removed += 1;
577
578
  }
578
579
  if (removed && update !== false) {
@@ -33,7 +33,7 @@ var pointFeature = require('./pointFeature');
33
33
  * @property {number|function} [strokeOffset=-1] The position of the stroke
34
34
  * compared to the radius. This can only be -1, 0, or 1 (the sign of the
35
35
  * value is used).
36
- * @property {boolean|function} [radiusIncludeStroke=true] If truthy or
36
+ * @property {boolean|function} [radiusIncludesStroke=true] If truthy or
37
37
  * undefined, the `radius` includes the `strokeWidth` based on the
38
38
  * `strokeOffset`. If defined and falsy, the radius does not include the
39
39
  * `strokeWidth`.