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/geo.js +14 -14
- package/geo.lean.js +14 -14
- package/geo.lean.min.js +2 -2
- package/geo.min.js +2 -2
- package/package.json +6 -1
- package/src/annotationLayer.js +11 -10
- package/src/markerFeature.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "geojs",
|
|
3
|
-
"version": "1.12.
|
|
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",
|
package/src/annotationLayer.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
538
|
-
|
|
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
|
|
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
|
|
569
|
-
|
|
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) {
|
package/src/markerFeature.js
CHANGED
|
@@ -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} [
|
|
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`.
|