geojs 1.12.8 → 1.12.10
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/CHANGELOG.md +48 -0
- package/geo.js +79 -39
- package/geo.lean.js +79 -39
- package/geo.lean.min.js +3 -3
- package/geo.min.js +3 -3
- package/package.json +1 -1
- package/src/annotation/lineAnnotation.js +2 -4
- package/src/annotation/polygonAnnotation.js +7 -7
- package/src/annotationLayer.js +54 -11
- package/src/event.js +7 -4
- package/src/util/common.js +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# GeoJS Change Log
|
|
2
2
|
|
|
3
|
+
## Version 1.12.10
|
|
4
|
+
|
|
5
|
+
### Performance Improvements
|
|
6
|
+
|
|
7
|
+
- Allow skipping event triggers on removeAnnotation and removeAllAnnotations ([#13521](../../pull/13521))
|
|
8
|
+
|
|
9
|
+
## Version 1.12.9
|
|
10
|
+
|
|
11
|
+
### Performance Improvements
|
|
12
|
+
|
|
13
|
+
- Add addMultipleAnnotations method ([#1351](../../pull/1351))
|
|
14
|
+
|
|
15
|
+
## Version 1.12.8
|
|
16
|
+
|
|
17
|
+
### Performance Improvements
|
|
18
|
+
|
|
19
|
+
- Switch to more native functions ([#1345](../../pull/1345))
|
|
20
|
+
|
|
21
|
+
## Version 1.12.7
|
|
22
|
+
|
|
23
|
+
### Performance Improvements
|
|
24
|
+
|
|
25
|
+
- Make adding and removing annotations somewhat more efficient ([#1343](../../pull/1343))
|
|
26
|
+
|
|
27
|
+
## Version 1.12.6
|
|
28
|
+
|
|
29
|
+
### Performance Improvements
|
|
30
|
+
|
|
31
|
+
- Stop using jquery extend ([#1342](../../pull/1342))
|
|
32
|
+
|
|
33
|
+
## Version 1.12.5
|
|
34
|
+
|
|
35
|
+
### Bug Fixes
|
|
36
|
+
|
|
37
|
+
- Change how webpack builds some libraries ([#1341](../../pull/1341))
|
|
38
|
+
|
|
39
|
+
## Version 1.12.4
|
|
40
|
+
|
|
41
|
+
### Performance Improvements
|
|
42
|
+
|
|
43
|
+
- Speed up adding annotations ([#1340](../../pull/1340))
|
|
44
|
+
|
|
45
|
+
## Version 1.12.3
|
|
46
|
+
|
|
47
|
+
### Bug Fixes
|
|
48
|
+
|
|
49
|
+
- Improve encoding html for screenshots ([#1334](../../pull/1334))
|
|
50
|
+
|
|
3
51
|
## Version 1.12.2
|
|
4
52
|
|
|
5
53
|
### Improvements
|
package/geo.js
CHANGED
|
@@ -4847,9 +4847,7 @@ var _lineAnnotation = function lineAnnotation(args) {
|
|
|
4847
4847
|
line: function line(d) {
|
|
4848
4848
|
/* Return an array that has the same number of items as we have
|
|
4849
4849
|
* vertices. */
|
|
4850
|
-
return Array
|
|
4851
|
-
return d;
|
|
4852
|
-
});
|
|
4850
|
+
return Array(m_this.options('vertices').length).fill(d);
|
|
4853
4851
|
},
|
|
4854
4852
|
position: function position(d, i) {
|
|
4855
4853
|
return m_this.options('vertices')[i];
|
|
@@ -4859,9 +4857,7 @@ var _lineAnnotation = function lineAnnotation(args) {
|
|
|
4859
4857
|
line: function line(d) {
|
|
4860
4858
|
/* Return an array that has the same number of items as we have
|
|
4861
4859
|
* vertices. */
|
|
4862
|
-
return Array
|
|
4863
|
-
return d;
|
|
4864
|
-
});
|
|
4860
|
+
return Array(m_this.options('vertices').length).fill(d);
|
|
4865
4861
|
},
|
|
4866
4862
|
position: function position(d, i) {
|
|
4867
4863
|
return m_this.options('vertices')[i];
|
|
@@ -5442,7 +5438,8 @@ var _polygonAnnotation = function polygonAnnotation(args) {
|
|
|
5442
5438
|
if (!(this instanceof _polygonAnnotation)) {
|
|
5443
5439
|
return new _polygonAnnotation(args);
|
|
5444
5440
|
}
|
|
5445
|
-
|
|
5441
|
+
var m_this = this;
|
|
5442
|
+
args = util.deepMerge({
|
|
5446
5443
|
style: {
|
|
5447
5444
|
polygon: function polygon(d) {
|
|
5448
5445
|
return d.polygon;
|
|
@@ -5453,13 +5450,11 @@ var _polygonAnnotation = function polygonAnnotation(args) {
|
|
|
5453
5450
|
var coord = m_this._coordinates();
|
|
5454
5451
|
/* Return an array that has the same number of items as we have
|
|
5455
5452
|
* vertices. */
|
|
5456
|
-
return Array
|
|
5457
|
-
return d;
|
|
5458
|
-
});
|
|
5453
|
+
return Array((coord.outer || coord).length).fill(d);
|
|
5459
5454
|
},
|
|
5460
5455
|
position: function position(d, i) {
|
|
5461
5456
|
if (d.x !== undefined) {
|
|
5462
|
-
return d
|
|
5457
|
+
return d;
|
|
5463
5458
|
}
|
|
5464
5459
|
return m_this.options('vertices')[i];
|
|
5465
5460
|
}
|
|
@@ -5467,12 +5462,11 @@ var _polygonAnnotation = function polygonAnnotation(args) {
|
|
|
5467
5462
|
cursorStyle: {
|
|
5468
5463
|
position: util.identityFunction
|
|
5469
5464
|
}
|
|
5470
|
-
}, args);
|
|
5465
|
+
}, this.constructor.defaults, args);
|
|
5471
5466
|
args.vertices = args.vertices || args.coordinates || [];
|
|
5472
5467
|
delete args.coordinates;
|
|
5473
5468
|
annotation.call(this, 'polygon', args);
|
|
5474
|
-
var
|
|
5475
|
-
s_actions = this.actions,
|
|
5469
|
+
var s_actions = this.actions,
|
|
5476
5470
|
s_state = this.state;
|
|
5477
5471
|
|
|
5478
5472
|
/**
|
|
@@ -6871,18 +6865,22 @@ var _annotationLayer = function annotationLayer(arg) {
|
|
|
6871
6865
|
* gcs, `null` to use the map gcs, or any other transform.
|
|
6872
6866
|
* @param {boolean} [update] If `false`, don't update the layer after adding
|
|
6873
6867
|
* the annotation.
|
|
6868
|
+
* @param {boolean} [trigger] If `false`, do not trigger add_before and add
|
|
6869
|
+
* events.
|
|
6874
6870
|
* @returns {this} The current layer.
|
|
6875
6871
|
* @fires geo.event.annotation.add_before
|
|
6876
6872
|
* @fires geo.event.annotation.add
|
|
6877
6873
|
*/
|
|
6878
|
-
this.addAnnotation = function (annotation, gcs, update) {
|
|
6874
|
+
this.addAnnotation = function (annotation, gcs, update, trigger) {
|
|
6879
6875
|
if (m_annotationIds[annotation.id()] === undefined) {
|
|
6880
6876
|
while (m_this.annotationById(annotation.id())) {
|
|
6881
6877
|
annotation.newId();
|
|
6882
6878
|
}
|
|
6883
|
-
|
|
6884
|
-
annotation
|
|
6885
|
-
|
|
6879
|
+
if (trigger !== false) {
|
|
6880
|
+
m_this.geoTrigger(geo_event.annotation.add_before, {
|
|
6881
|
+
annotation: annotation
|
|
6882
|
+
});
|
|
6883
|
+
}
|
|
6886
6884
|
m_annotations.push(annotation);
|
|
6887
6885
|
m_annotationIds[annotation.id()] = annotation;
|
|
6888
6886
|
annotation.layer(m_this);
|
|
@@ -6895,8 +6893,43 @@ var _annotationLayer = function annotationLayer(arg) {
|
|
|
6895
6893
|
m_this.modified();
|
|
6896
6894
|
m_this.draw();
|
|
6897
6895
|
}
|
|
6896
|
+
if (trigger !== false) {
|
|
6897
|
+
m_this.geoTrigger(geo_event.annotation.add, {
|
|
6898
|
+
annotation: annotation
|
|
6899
|
+
});
|
|
6900
|
+
}
|
|
6901
|
+
}
|
|
6902
|
+
return m_this;
|
|
6903
|
+
};
|
|
6904
|
+
|
|
6905
|
+
/**
|
|
6906
|
+
* Add multiple annotations to the layer. The annotations could be in any
|
|
6907
|
+
* state.
|
|
6908
|
+
*
|
|
6909
|
+
* @param {geo.annotation[]} annotations The annotations to add.
|
|
6910
|
+
* @param {string|geo.transform|null} [gcs] `undefined` to use the interface
|
|
6911
|
+
* gcs, `null` to use the map gcs, or any other transform.
|
|
6912
|
+
* @param {boolean} [update] If `false`, don't update the layer after adding
|
|
6913
|
+
* the annotation.
|
|
6914
|
+
* @returns {this} The current layer.
|
|
6915
|
+
* @fires geo.event.annotation.add_before
|
|
6916
|
+
* @fires geo.event.annotation.add
|
|
6917
|
+
*/
|
|
6918
|
+
this.addMultipleAnnotations = function (annotations, gcs, update) {
|
|
6919
|
+
var added = [];
|
|
6920
|
+
m_this.geoTrigger(geo_event.annotation.add_before, {
|
|
6921
|
+
annotations: annotations
|
|
6922
|
+
});
|
|
6923
|
+
for (var i = 0; i < annotations.length; i += 1) {
|
|
6924
|
+
var annotation = annotations[i];
|
|
6925
|
+
if (m_annotationIds[annotation.id()] === undefined) {
|
|
6926
|
+
this.addAnnotation(annotation, gcs, update, false);
|
|
6927
|
+
added.push(annotation);
|
|
6928
|
+
}
|
|
6929
|
+
}
|
|
6930
|
+
if (added.length) {
|
|
6898
6931
|
m_this.geoTrigger(geo_event.annotation.add, {
|
|
6899
|
-
|
|
6932
|
+
annotations: added
|
|
6900
6933
|
});
|
|
6901
6934
|
}
|
|
6902
6935
|
return m_this;
|
|
@@ -6910,10 +6943,11 @@ var _annotationLayer = function annotationLayer(arg) {
|
|
|
6910
6943
|
* the annotation.
|
|
6911
6944
|
* @param {int} [pos] The posiiton of the annotation in the annotation list,
|
|
6912
6945
|
* if known. This speeds up the process.
|
|
6946
|
+
* @param {boolean} [trigger] If `false`, do not trigger remove event.
|
|
6913
6947
|
* @returns {boolean} `true` if an annotation was removed.
|
|
6914
6948
|
* @fires geo.event.annotation.remove
|
|
6915
6949
|
*/
|
|
6916
|
-
this.removeAnnotation = function (annotation, update, pos) {
|
|
6950
|
+
this.removeAnnotation = function (annotation, update, pos, trigger) {
|
|
6917
6951
|
if (annotation.id && m_annotationIds[annotation.id()] !== undefined) {
|
|
6918
6952
|
pos = m_annotations.indexOf(annotation);
|
|
6919
6953
|
if (annotation === m_this.currentAnnotation) {
|
|
@@ -6928,9 +6962,11 @@ var _annotationLayer = function annotationLayer(arg) {
|
|
|
6928
6962
|
m_this.modified();
|
|
6929
6963
|
m_this.draw();
|
|
6930
6964
|
}
|
|
6931
|
-
|
|
6932
|
-
annotation
|
|
6933
|
-
|
|
6965
|
+
if (trigger !== false) {
|
|
6966
|
+
m_this.geoTrigger(geo_event.annotation.remove, {
|
|
6967
|
+
annotation: annotation
|
|
6968
|
+
});
|
|
6969
|
+
}
|
|
6934
6970
|
return true;
|
|
6935
6971
|
}
|
|
6936
6972
|
return false;
|
|
@@ -6943,9 +6979,10 @@ var _annotationLayer = function annotationLayer(arg) {
|
|
|
6943
6979
|
* are in the create state.
|
|
6944
6980
|
* @param {boolean} [update] If `false`, don't update the layer after
|
|
6945
6981
|
* removing the annotation.
|
|
6982
|
+
* @param {boolean} [trigger] If `false`, do not trigger remove events.
|
|
6946
6983
|
* @returns {number} The number of annotations that were removed.
|
|
6947
6984
|
*/
|
|
6948
|
-
this.removeAllAnnotations = function (skipCreating, update) {
|
|
6985
|
+
this.removeAllAnnotations = function (skipCreating, update, trigger) {
|
|
6949
6986
|
var removed = 0,
|
|
6950
6987
|
annotation;
|
|
6951
6988
|
for (var pos = m_annotations.length - 1; pos >= 0; pos -= 1) {
|
|
@@ -6953,7 +6990,7 @@ var _annotationLayer = function annotationLayer(arg) {
|
|
|
6953
6990
|
if (skipCreating && annotation.state() === geo_annotation.state.create) {
|
|
6954
6991
|
continue;
|
|
6955
6992
|
}
|
|
6956
|
-
m_this.removeAnnotation(annotation, false, pos);
|
|
6993
|
+
m_this.removeAnnotation(annotation, false, pos, trigger);
|
|
6957
6994
|
removed += 1;
|
|
6958
6995
|
}
|
|
6959
6996
|
if (removed && update !== false) {
|
|
@@ -11841,20 +11878,23 @@ geo_event.camera.viewport = 'geo_camera_viewport';
|
|
|
11841
11878
|
geo_event.annotation = {};
|
|
11842
11879
|
|
|
11843
11880
|
/**
|
|
11844
|
-
* Triggered when
|
|
11881
|
+
* Triggered when or more multiple annotations have been added.
|
|
11845
11882
|
*
|
|
11846
11883
|
* @event geo.event.annotation.add
|
|
11847
11884
|
* @type {geo.event.base}
|
|
11848
|
-
* @property {geo.annotation} annotation The annotation that was added.
|
|
11885
|
+
* @property {geo.annotation} [annotation] The annotation that was added.
|
|
11886
|
+
* @property {geo.annotation} [annotations] The annotations that were added.
|
|
11849
11887
|
*/
|
|
11850
11888
|
geo_event.annotation.add = 'geo_annotation_add';
|
|
11851
11889
|
|
|
11852
11890
|
/**
|
|
11853
|
-
* Triggered when
|
|
11891
|
+
* Triggered when one or multiple annotations are about to be added.
|
|
11854
11892
|
*
|
|
11855
11893
|
* @event geo.event.annotation.add_before
|
|
11856
11894
|
* @type {geo.event.base}
|
|
11857
|
-
* @property {geo.annotation} annotation The annotation that will be added.
|
|
11895
|
+
* @property {geo.annotation} [annotation] The annotation that will be added.
|
|
11896
|
+
* @property {geo.annotation[]} [annotations] The annotations that will be
|
|
11897
|
+
* added.
|
|
11858
11898
|
*/
|
|
11859
11899
|
geo_event.annotation.add_before = 'geo_annotation_add_before';
|
|
11860
11900
|
|
|
@@ -28059,7 +28099,7 @@ module.exports = _sceneObject;
|
|
|
28059
28099
|
* @constant
|
|
28060
28100
|
* @type {string}
|
|
28061
28101
|
*/
|
|
28062
|
-
module.exports = "
|
|
28102
|
+
module.exports = "4353a25de740301aeb481c62d29e493abbbe7b9e";
|
|
28063
28103
|
|
|
28064
28104
|
/***/ }),
|
|
28065
28105
|
|
|
@@ -37984,15 +38024,15 @@ var util = {
|
|
|
37984
38024
|
}
|
|
37985
38025
|
var copy = source[key];
|
|
37986
38026
|
if (copy && _typeof(copy) === 'object' && (copy.constructor === Object || Array.isArray(copy))) {
|
|
37987
|
-
var
|
|
38027
|
+
var value = target[key];
|
|
37988
38028
|
if (!Array.isArray(copy)) {
|
|
37989
|
-
if (_typeof(
|
|
37990
|
-
|
|
38029
|
+
if (_typeof(value) !== 'object' || Array.isArray(value)) {
|
|
38030
|
+
value = {};
|
|
37991
38031
|
}
|
|
37992
|
-
} else if (!Array.isArray(
|
|
37993
|
-
|
|
38032
|
+
} else if (!Array.isArray(value)) {
|
|
38033
|
+
value = [];
|
|
37994
38034
|
}
|
|
37995
|
-
target[key] = util.deepMerge(
|
|
38035
|
+
target[key] = util.deepMerge(value, copy);
|
|
37996
38036
|
} else if (copy !== undefined) {
|
|
37997
38037
|
target[key] = copy;
|
|
37998
38038
|
}
|
|
@@ -39932,7 +39972,7 @@ module.exports = _vectorFeature;
|
|
|
39932
39972
|
* @constant
|
|
39933
39973
|
* @type {string}
|
|
39934
39974
|
*/
|
|
39935
|
-
module.exports = "1.12.
|
|
39975
|
+
module.exports = "1.12.10";
|
|
39936
39976
|
|
|
39937
39977
|
/***/ }),
|
|
39938
39978
|
|
|
@@ -67367,7 +67407,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
67367
67407
|
defs('EPSG:4269', "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees");
|
|
67368
67408
|
defs('EPSG:3857', "+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");
|
|
67369
67409
|
// UTM WGS84
|
|
67370
|
-
for (var i =
|
|
67410
|
+
for (var i = 1; i <= 60; ++i) {
|
|
67371
67411
|
defs('EPSG:' + (32600 + i), "+proj=utm +zone=" + i + " +datum=WGS84 +units=m");
|
|
67372
67412
|
defs('EPSG:' + (32700 + i), "+proj=utm +zone=" + i + " +south +datum=WGS84 +units=m");
|
|
67373
67413
|
}
|
|
@@ -68642,7 +68682,7 @@ var datums = {
|
|
|
68642
68682
|
ellipse: "bessel",
|
|
68643
68683
|
datumName: "Hermannskogel"
|
|
68644
68684
|
},
|
|
68645
|
-
|
|
68685
|
+
mgi: {
|
|
68646
68686
|
towgs84: "577.326,90.129,463.919,5.137,1.474,5.297,2.4232",
|
|
68647
68687
|
ellipse: "bessel",
|
|
68648
68688
|
datumName: "Militar-Geographische Institut",
|
package/geo.lean.js
CHANGED
|
@@ -1846,9 +1846,7 @@ var _lineAnnotation = function lineAnnotation(args) {
|
|
|
1846
1846
|
line: function line(d) {
|
|
1847
1847
|
/* Return an array that has the same number of items as we have
|
|
1848
1848
|
* vertices. */
|
|
1849
|
-
return Array
|
|
1850
|
-
return d;
|
|
1851
|
-
});
|
|
1849
|
+
return Array(m_this.options('vertices').length).fill(d);
|
|
1852
1850
|
},
|
|
1853
1851
|
position: function position(d, i) {
|
|
1854
1852
|
return m_this.options('vertices')[i];
|
|
@@ -1858,9 +1856,7 @@ var _lineAnnotation = function lineAnnotation(args) {
|
|
|
1858
1856
|
line: function line(d) {
|
|
1859
1857
|
/* Return an array that has the same number of items as we have
|
|
1860
1858
|
* vertices. */
|
|
1861
|
-
return Array
|
|
1862
|
-
return d;
|
|
1863
|
-
});
|
|
1859
|
+
return Array(m_this.options('vertices').length).fill(d);
|
|
1864
1860
|
},
|
|
1865
1861
|
position: function position(d, i) {
|
|
1866
1862
|
return m_this.options('vertices')[i];
|
|
@@ -2441,7 +2437,8 @@ var _polygonAnnotation = function polygonAnnotation(args) {
|
|
|
2441
2437
|
if (!(this instanceof _polygonAnnotation)) {
|
|
2442
2438
|
return new _polygonAnnotation(args);
|
|
2443
2439
|
}
|
|
2444
|
-
|
|
2440
|
+
var m_this = this;
|
|
2441
|
+
args = util.deepMerge({
|
|
2445
2442
|
style: {
|
|
2446
2443
|
polygon: function polygon(d) {
|
|
2447
2444
|
return d.polygon;
|
|
@@ -2452,13 +2449,11 @@ var _polygonAnnotation = function polygonAnnotation(args) {
|
|
|
2452
2449
|
var coord = m_this._coordinates();
|
|
2453
2450
|
/* Return an array that has the same number of items as we have
|
|
2454
2451
|
* vertices. */
|
|
2455
|
-
return Array
|
|
2456
|
-
return d;
|
|
2457
|
-
});
|
|
2452
|
+
return Array((coord.outer || coord).length).fill(d);
|
|
2458
2453
|
},
|
|
2459
2454
|
position: function position(d, i) {
|
|
2460
2455
|
if (d.x !== undefined) {
|
|
2461
|
-
return d
|
|
2456
|
+
return d;
|
|
2462
2457
|
}
|
|
2463
2458
|
return m_this.options('vertices')[i];
|
|
2464
2459
|
}
|
|
@@ -2466,12 +2461,11 @@ var _polygonAnnotation = function polygonAnnotation(args) {
|
|
|
2466
2461
|
cursorStyle: {
|
|
2467
2462
|
position: util.identityFunction
|
|
2468
2463
|
}
|
|
2469
|
-
}, args);
|
|
2464
|
+
}, this.constructor.defaults, args);
|
|
2470
2465
|
args.vertices = args.vertices || args.coordinates || [];
|
|
2471
2466
|
delete args.coordinates;
|
|
2472
2467
|
annotation.call(this, 'polygon', args);
|
|
2473
|
-
var
|
|
2474
|
-
s_actions = this.actions,
|
|
2468
|
+
var s_actions = this.actions,
|
|
2475
2469
|
s_state = this.state;
|
|
2476
2470
|
|
|
2477
2471
|
/**
|
|
@@ -3870,18 +3864,22 @@ var _annotationLayer = function annotationLayer(arg) {
|
|
|
3870
3864
|
* gcs, `null` to use the map gcs, or any other transform.
|
|
3871
3865
|
* @param {boolean} [update] If `false`, don't update the layer after adding
|
|
3872
3866
|
* the annotation.
|
|
3867
|
+
* @param {boolean} [trigger] If `false`, do not trigger add_before and add
|
|
3868
|
+
* events.
|
|
3873
3869
|
* @returns {this} The current layer.
|
|
3874
3870
|
* @fires geo.event.annotation.add_before
|
|
3875
3871
|
* @fires geo.event.annotation.add
|
|
3876
3872
|
*/
|
|
3877
|
-
this.addAnnotation = function (annotation, gcs, update) {
|
|
3873
|
+
this.addAnnotation = function (annotation, gcs, update, trigger) {
|
|
3878
3874
|
if (m_annotationIds[annotation.id()] === undefined) {
|
|
3879
3875
|
while (m_this.annotationById(annotation.id())) {
|
|
3880
3876
|
annotation.newId();
|
|
3881
3877
|
}
|
|
3882
|
-
|
|
3883
|
-
annotation
|
|
3884
|
-
|
|
3878
|
+
if (trigger !== false) {
|
|
3879
|
+
m_this.geoTrigger(geo_event.annotation.add_before, {
|
|
3880
|
+
annotation: annotation
|
|
3881
|
+
});
|
|
3882
|
+
}
|
|
3885
3883
|
m_annotations.push(annotation);
|
|
3886
3884
|
m_annotationIds[annotation.id()] = annotation;
|
|
3887
3885
|
annotation.layer(m_this);
|
|
@@ -3894,8 +3892,43 @@ var _annotationLayer = function annotationLayer(arg) {
|
|
|
3894
3892
|
m_this.modified();
|
|
3895
3893
|
m_this.draw();
|
|
3896
3894
|
}
|
|
3895
|
+
if (trigger !== false) {
|
|
3896
|
+
m_this.geoTrigger(geo_event.annotation.add, {
|
|
3897
|
+
annotation: annotation
|
|
3898
|
+
});
|
|
3899
|
+
}
|
|
3900
|
+
}
|
|
3901
|
+
return m_this;
|
|
3902
|
+
};
|
|
3903
|
+
|
|
3904
|
+
/**
|
|
3905
|
+
* Add multiple annotations to the layer. The annotations could be in any
|
|
3906
|
+
* state.
|
|
3907
|
+
*
|
|
3908
|
+
* @param {geo.annotation[]} annotations The annotations to add.
|
|
3909
|
+
* @param {string|geo.transform|null} [gcs] `undefined` to use the interface
|
|
3910
|
+
* gcs, `null` to use the map gcs, or any other transform.
|
|
3911
|
+
* @param {boolean} [update] If `false`, don't update the layer after adding
|
|
3912
|
+
* the annotation.
|
|
3913
|
+
* @returns {this} The current layer.
|
|
3914
|
+
* @fires geo.event.annotation.add_before
|
|
3915
|
+
* @fires geo.event.annotation.add
|
|
3916
|
+
*/
|
|
3917
|
+
this.addMultipleAnnotations = function (annotations, gcs, update) {
|
|
3918
|
+
var added = [];
|
|
3919
|
+
m_this.geoTrigger(geo_event.annotation.add_before, {
|
|
3920
|
+
annotations: annotations
|
|
3921
|
+
});
|
|
3922
|
+
for (var i = 0; i < annotations.length; i += 1) {
|
|
3923
|
+
var annotation = annotations[i];
|
|
3924
|
+
if (m_annotationIds[annotation.id()] === undefined) {
|
|
3925
|
+
this.addAnnotation(annotation, gcs, update, false);
|
|
3926
|
+
added.push(annotation);
|
|
3927
|
+
}
|
|
3928
|
+
}
|
|
3929
|
+
if (added.length) {
|
|
3897
3930
|
m_this.geoTrigger(geo_event.annotation.add, {
|
|
3898
|
-
|
|
3931
|
+
annotations: added
|
|
3899
3932
|
});
|
|
3900
3933
|
}
|
|
3901
3934
|
return m_this;
|
|
@@ -3909,10 +3942,11 @@ var _annotationLayer = function annotationLayer(arg) {
|
|
|
3909
3942
|
* the annotation.
|
|
3910
3943
|
* @param {int} [pos] The posiiton of the annotation in the annotation list,
|
|
3911
3944
|
* if known. This speeds up the process.
|
|
3945
|
+
* @param {boolean} [trigger] If `false`, do not trigger remove event.
|
|
3912
3946
|
* @returns {boolean} `true` if an annotation was removed.
|
|
3913
3947
|
* @fires geo.event.annotation.remove
|
|
3914
3948
|
*/
|
|
3915
|
-
this.removeAnnotation = function (annotation, update, pos) {
|
|
3949
|
+
this.removeAnnotation = function (annotation, update, pos, trigger) {
|
|
3916
3950
|
if (annotation.id && m_annotationIds[annotation.id()] !== undefined) {
|
|
3917
3951
|
pos = m_annotations.indexOf(annotation);
|
|
3918
3952
|
if (annotation === m_this.currentAnnotation) {
|
|
@@ -3927,9 +3961,11 @@ var _annotationLayer = function annotationLayer(arg) {
|
|
|
3927
3961
|
m_this.modified();
|
|
3928
3962
|
m_this.draw();
|
|
3929
3963
|
}
|
|
3930
|
-
|
|
3931
|
-
annotation
|
|
3932
|
-
|
|
3964
|
+
if (trigger !== false) {
|
|
3965
|
+
m_this.geoTrigger(geo_event.annotation.remove, {
|
|
3966
|
+
annotation: annotation
|
|
3967
|
+
});
|
|
3968
|
+
}
|
|
3933
3969
|
return true;
|
|
3934
3970
|
}
|
|
3935
3971
|
return false;
|
|
@@ -3942,9 +3978,10 @@ var _annotationLayer = function annotationLayer(arg) {
|
|
|
3942
3978
|
* are in the create state.
|
|
3943
3979
|
* @param {boolean} [update] If `false`, don't update the layer after
|
|
3944
3980
|
* removing the annotation.
|
|
3981
|
+
* @param {boolean} [trigger] If `false`, do not trigger remove events.
|
|
3945
3982
|
* @returns {number} The number of annotations that were removed.
|
|
3946
3983
|
*/
|
|
3947
|
-
this.removeAllAnnotations = function (skipCreating, update) {
|
|
3984
|
+
this.removeAllAnnotations = function (skipCreating, update, trigger) {
|
|
3948
3985
|
var removed = 0,
|
|
3949
3986
|
annotation;
|
|
3950
3987
|
for (var pos = m_annotations.length - 1; pos >= 0; pos -= 1) {
|
|
@@ -3952,7 +3989,7 @@ var _annotationLayer = function annotationLayer(arg) {
|
|
|
3952
3989
|
if (skipCreating && annotation.state() === geo_annotation.state.create) {
|
|
3953
3990
|
continue;
|
|
3954
3991
|
}
|
|
3955
|
-
m_this.removeAnnotation(annotation, false, pos);
|
|
3992
|
+
m_this.removeAnnotation(annotation, false, pos, trigger);
|
|
3956
3993
|
removed += 1;
|
|
3957
3994
|
}
|
|
3958
3995
|
if (removed && update !== false) {
|
|
@@ -8840,20 +8877,23 @@ geo_event.camera.viewport = 'geo_camera_viewport';
|
|
|
8840
8877
|
geo_event.annotation = {};
|
|
8841
8878
|
|
|
8842
8879
|
/**
|
|
8843
|
-
* Triggered when
|
|
8880
|
+
* Triggered when or more multiple annotations have been added.
|
|
8844
8881
|
*
|
|
8845
8882
|
* @event geo.event.annotation.add
|
|
8846
8883
|
* @type {geo.event.base}
|
|
8847
|
-
* @property {geo.annotation} annotation The annotation that was added.
|
|
8884
|
+
* @property {geo.annotation} [annotation] The annotation that was added.
|
|
8885
|
+
* @property {geo.annotation} [annotations] The annotations that were added.
|
|
8848
8886
|
*/
|
|
8849
8887
|
geo_event.annotation.add = 'geo_annotation_add';
|
|
8850
8888
|
|
|
8851
8889
|
/**
|
|
8852
|
-
* Triggered when
|
|
8890
|
+
* Triggered when one or multiple annotations are about to be added.
|
|
8853
8891
|
*
|
|
8854
8892
|
* @event geo.event.annotation.add_before
|
|
8855
8893
|
* @type {geo.event.base}
|
|
8856
|
-
* @property {geo.annotation} annotation The annotation that will be added.
|
|
8894
|
+
* @property {geo.annotation} [annotation] The annotation that will be added.
|
|
8895
|
+
* @property {geo.annotation[]} [annotations] The annotations that will be
|
|
8896
|
+
* added.
|
|
8857
8897
|
*/
|
|
8858
8898
|
geo_event.annotation.add_before = 'geo_annotation_add_before';
|
|
8859
8899
|
|
|
@@ -25058,7 +25098,7 @@ module.exports = _sceneObject;
|
|
|
25058
25098
|
* @constant
|
|
25059
25099
|
* @type {string}
|
|
25060
25100
|
*/
|
|
25061
|
-
module.exports = "
|
|
25101
|
+
module.exports = "4353a25de740301aeb481c62d29e493abbbe7b9e";
|
|
25062
25102
|
|
|
25063
25103
|
/***/ }),
|
|
25064
25104
|
|
|
@@ -34983,15 +35023,15 @@ var util = {
|
|
|
34983
35023
|
}
|
|
34984
35024
|
var copy = source[key];
|
|
34985
35025
|
if (copy && _typeof(copy) === 'object' && (copy.constructor === Object || Array.isArray(copy))) {
|
|
34986
|
-
var
|
|
35026
|
+
var value = target[key];
|
|
34987
35027
|
if (!Array.isArray(copy)) {
|
|
34988
|
-
if (_typeof(
|
|
34989
|
-
|
|
35028
|
+
if (_typeof(value) !== 'object' || Array.isArray(value)) {
|
|
35029
|
+
value = {};
|
|
34990
35030
|
}
|
|
34991
|
-
} else if (!Array.isArray(
|
|
34992
|
-
|
|
35031
|
+
} else if (!Array.isArray(value)) {
|
|
35032
|
+
value = [];
|
|
34993
35033
|
}
|
|
34994
|
-
target[key] = util.deepMerge(
|
|
35034
|
+
target[key] = util.deepMerge(value, copy);
|
|
34995
35035
|
} else if (copy !== undefined) {
|
|
34996
35036
|
target[key] = copy;
|
|
34997
35037
|
}
|
|
@@ -36931,7 +36971,7 @@ module.exports = _vectorFeature;
|
|
|
36931
36971
|
* @constant
|
|
36932
36972
|
* @type {string}
|
|
36933
36973
|
*/
|
|
36934
|
-
module.exports = "1.12.
|
|
36974
|
+
module.exports = "1.12.10";
|
|
36935
36975
|
|
|
36936
36976
|
/***/ }),
|
|
36937
36977
|
|
|
@@ -64366,7 +64406,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
64366
64406
|
defs('EPSG:4269', "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees");
|
|
64367
64407
|
defs('EPSG:3857', "+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");
|
|
64368
64408
|
// UTM WGS84
|
|
64369
|
-
for (var i =
|
|
64409
|
+
for (var i = 1; i <= 60; ++i) {
|
|
64370
64410
|
defs('EPSG:' + (32600 + i), "+proj=utm +zone=" + i + " +datum=WGS84 +units=m");
|
|
64371
64411
|
defs('EPSG:' + (32700 + i), "+proj=utm +zone=" + i + " +south +datum=WGS84 +units=m");
|
|
64372
64412
|
}
|
|
@@ -65641,7 +65681,7 @@ var datums = {
|
|
|
65641
65681
|
ellipse: "bessel",
|
|
65642
65682
|
datumName: "Hermannskogel"
|
|
65643
65683
|
},
|
|
65644
|
-
|
|
65684
|
+
mgi: {
|
|
65645
65685
|
towgs84: "577.326,90.129,463.919,5.137,1.474,5.297,2.4232",
|
|
65646
65686
|
ellipse: "bessel",
|
|
65647
65687
|
datumName: "Militar-Geographische Institut",
|