geojs 1.12.7 → 1.12.9
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/.github/workflows/main.yml +1 -1
- package/CHANGELOG.md +42 -0
- package/geo.js +82 -47
- package/geo.lean.js +82 -47
- 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 +46 -7
- package/src/event.js +7 -4
- package/src/fetchQueue.js +3 -3
- package/src/mapInteractor.js +1 -2
- package/src/quadFeature.js +4 -4
- package/src/registry.js +1 -2
- package/src/util/common.js +8 -8
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 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;
|
|
@@ -3914,7 +3947,7 @@ var _annotationLayer = function annotationLayer(arg) {
|
|
|
3914
3947
|
*/
|
|
3915
3948
|
this.removeAnnotation = function (annotation, update, pos) {
|
|
3916
3949
|
if (annotation.id && m_annotationIds[annotation.id()] !== undefined) {
|
|
3917
|
-
pos =
|
|
3950
|
+
pos = m_annotations.indexOf(annotation);
|
|
3918
3951
|
if (annotation === m_this.currentAnnotation) {
|
|
3919
3952
|
m_this.currentAnnotation = null;
|
|
3920
3953
|
}
|
|
@@ -4199,7 +4232,7 @@ var _annotationLayer = function annotationLayer(arg) {
|
|
|
4199
4232
|
datagcs,
|
|
4200
4233
|
i,
|
|
4201
4234
|
existing;
|
|
4202
|
-
if (
|
|
4235
|
+
if (!annotationList.includes(type)) {
|
|
4203
4236
|
return;
|
|
4204
4237
|
}
|
|
4205
4238
|
options.style = options.style || {};
|
|
@@ -8840,20 +8873,23 @@ geo_event.camera.viewport = 'geo_camera_viewport';
|
|
|
8840
8873
|
geo_event.annotation = {};
|
|
8841
8874
|
|
|
8842
8875
|
/**
|
|
8843
|
-
* Triggered when
|
|
8876
|
+
* Triggered when or more multiple annotations have been added.
|
|
8844
8877
|
*
|
|
8845
8878
|
* @event geo.event.annotation.add
|
|
8846
8879
|
* @type {geo.event.base}
|
|
8847
|
-
* @property {geo.annotation} annotation The annotation that was added.
|
|
8880
|
+
* @property {geo.annotation} [annotation] The annotation that was added.
|
|
8881
|
+
* @property {geo.annotation} [annotations] The annotations that were added.
|
|
8848
8882
|
*/
|
|
8849
8883
|
geo_event.annotation.add = 'geo_annotation_add';
|
|
8850
8884
|
|
|
8851
8885
|
/**
|
|
8852
|
-
* Triggered when
|
|
8886
|
+
* Triggered when one or multiple annotations are about to be added.
|
|
8853
8887
|
*
|
|
8854
8888
|
* @event geo.event.annotation.add_before
|
|
8855
8889
|
* @type {geo.event.base}
|
|
8856
|
-
* @property {geo.annotation} annotation The annotation that will be added.
|
|
8890
|
+
* @property {geo.annotation} [annotation] The annotation that will be added.
|
|
8891
|
+
* @property {geo.annotation[]} [annotations] The annotations that will be
|
|
8892
|
+
* added.
|
|
8857
8893
|
*/
|
|
8858
8894
|
geo_event.annotation.add_before = 'geo_annotation_add_before';
|
|
8859
8895
|
|
|
@@ -10549,7 +10585,7 @@ var _fetchQueue = function fetchQueue(options) {
|
|
|
10549
10585
|
*/
|
|
10550
10586
|
this.add = function (defer, callback, atEnd) {
|
|
10551
10587
|
if (defer.__fetchQueue) {
|
|
10552
|
-
var pos =
|
|
10588
|
+
var pos = m_this._queue.indexOf(defer);
|
|
10553
10589
|
if (pos >= 0) {
|
|
10554
10590
|
// m_this._queue.splice(pos, 1);
|
|
10555
10591
|
m_this._addToQueue(defer, atEnd, pos);
|
|
@@ -10620,7 +10656,7 @@ var _fetchQueue = function fetchQueue(options) {
|
|
|
10620
10656
|
* @returns {number} -1 if not in the queue, or the position in the queue.
|
|
10621
10657
|
*/
|
|
10622
10658
|
this.get = function (defer) {
|
|
10623
|
-
return
|
|
10659
|
+
return m_this._queue.indexOf(defer);
|
|
10624
10660
|
};
|
|
10625
10661
|
|
|
10626
10662
|
/**
|
|
@@ -10630,7 +10666,7 @@ var _fetchQueue = function fetchQueue(options) {
|
|
|
10630
10666
|
* @returns {boolean} `true` if the object was removed.
|
|
10631
10667
|
*/
|
|
10632
10668
|
this.remove = function (defer) {
|
|
10633
|
-
var pos =
|
|
10669
|
+
var pos = m_this._queue.indexOf(defer);
|
|
10634
10670
|
if (pos >= 0) {
|
|
10635
10671
|
m_this._queue.splice(pos, 1);
|
|
10636
10672
|
return true;
|
|
@@ -18865,7 +18901,7 @@ var _mapInteractor = function mapInteractor(args) {
|
|
|
18865
18901
|
clearState();
|
|
18866
18902
|
|
|
18867
18903
|
// if momentum is enabled, start the action here
|
|
18868
|
-
if (m_options.momentum.enabled &&
|
|
18904
|
+
if (m_options.momentum.enabled && m_options.momentum.actions.includes(oldAction)) {
|
|
18869
18905
|
var t = new Date().valueOf();
|
|
18870
18906
|
var dt = t - m_mouse.time + m_mouse.deltaTime;
|
|
18871
18907
|
if (t - m_mouse.time < m_options.momentum.stopTime) {
|
|
@@ -23875,8 +23911,8 @@ var _quadFeature = function quadFeature(arg) {
|
|
|
23875
23911
|
prev_onload = image.onload;
|
|
23876
23912
|
image.onload = function () {
|
|
23877
23913
|
if (previewColor !== undefined) {
|
|
23878
|
-
if (
|
|
23879
|
-
clrQuads.splice(
|
|
23914
|
+
if (clrQuads.includes(quad)) {
|
|
23915
|
+
clrQuads.splice(clrQuads.indexOf(quad), 1);
|
|
23880
23916
|
}
|
|
23881
23917
|
delete quadinfo.clrquad;
|
|
23882
23918
|
}
|
|
@@ -23952,8 +23988,8 @@ var _quadFeature = function quadFeature(arg) {
|
|
|
23952
23988
|
prev_onload = video.onloadeddata;
|
|
23953
23989
|
video.onloadeddata = function () {
|
|
23954
23990
|
if (previewColor !== undefined) {
|
|
23955
|
-
if (
|
|
23956
|
-
clrQuads.splice(
|
|
23991
|
+
if (clrQuads.includes(quad)) {
|
|
23992
|
+
clrQuads.splice(clrQuads.indexOf(quad), 1);
|
|
23957
23993
|
}
|
|
23958
23994
|
delete quadinfo.clrquad;
|
|
23959
23995
|
}
|
|
@@ -24184,7 +24220,6 @@ module.exports = _quadFeature;
|
|
|
24184
24220
|
/***/ 1098:
|
|
24185
24221
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
24186
24222
|
|
|
24187
|
-
var $ = __webpack_require__(5616);
|
|
24188
24223
|
var geo_action = __webpack_require__(8695);
|
|
24189
24224
|
var util = __webpack_require__(1949);
|
|
24190
24225
|
var widgets = {
|
|
@@ -24640,7 +24675,7 @@ registry.featuresForAnnotations = function (annotationList) {
|
|
|
24640
24675
|
features.push(feature);
|
|
24641
24676
|
} else {
|
|
24642
24677
|
annotationList[ann].forEach(function (state) {
|
|
24643
|
-
if (
|
|
24678
|
+
if (annotations[ann].features[feature].includes(state)) {
|
|
24644
24679
|
features.push(feature);
|
|
24645
24680
|
}
|
|
24646
24681
|
});
|
|
@@ -25059,7 +25094,7 @@ module.exports = _sceneObject;
|
|
|
25059
25094
|
* @constant
|
|
25060
25095
|
* @type {string}
|
|
25061
25096
|
*/
|
|
25062
|
-
module.exports = "
|
|
25097
|
+
module.exports = "540466ba3aa5e442250a9eb78abbf8f62e824a51";
|
|
25063
25098
|
|
|
25064
25099
|
/***/ }),
|
|
25065
25100
|
|
|
@@ -34435,7 +34470,7 @@ var util = {
|
|
|
34435
34470
|
do {
|
|
34436
34471
|
found = util.hasAction(actions, action, name, owner);
|
|
34437
34472
|
if (found) {
|
|
34438
|
-
actions.splice(
|
|
34473
|
+
actions.splice(actions.indexOf(found), 1);
|
|
34439
34474
|
removed += 1;
|
|
34440
34475
|
}
|
|
34441
34476
|
} while (found);
|
|
@@ -34983,16 +35018,16 @@ var util = {
|
|
|
34983
35018
|
continue;
|
|
34984
35019
|
}
|
|
34985
35020
|
var copy = source[key];
|
|
34986
|
-
if (copy && _typeof(copy) === 'object' &&
|
|
34987
|
-
var
|
|
35021
|
+
if (copy && _typeof(copy) === 'object' && (copy.constructor === Object || Array.isArray(copy))) {
|
|
35022
|
+
var value = target[key];
|
|
34988
35023
|
if (!Array.isArray(copy)) {
|
|
34989
|
-
if (_typeof(
|
|
34990
|
-
|
|
35024
|
+
if (_typeof(value) !== 'object' || Array.isArray(value)) {
|
|
35025
|
+
value = {};
|
|
34991
35026
|
}
|
|
34992
|
-
} else if (!Array.isArray(
|
|
34993
|
-
|
|
35027
|
+
} else if (!Array.isArray(value)) {
|
|
35028
|
+
value = [];
|
|
34994
35029
|
}
|
|
34995
|
-
target[key] = util.deepMerge(
|
|
35030
|
+
target[key] = util.deepMerge(value, copy);
|
|
34996
35031
|
} else if (copy !== undefined) {
|
|
34997
35032
|
target[key] = copy;
|
|
34998
35033
|
}
|
|
@@ -36932,7 +36967,7 @@ module.exports = _vectorFeature;
|
|
|
36932
36967
|
* @constant
|
|
36933
36968
|
* @type {string}
|
|
36934
36969
|
*/
|
|
36935
|
-
module.exports = "1.12.
|
|
36970
|
+
module.exports = "1.12.9";
|
|
36936
36971
|
|
|
36937
36972
|
/***/ }),
|
|
36938
36973
|
|
|
@@ -64367,7 +64402,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
64367
64402
|
defs('EPSG:4269', "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees");
|
|
64368
64403
|
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");
|
|
64369
64404
|
// UTM WGS84
|
|
64370
|
-
for (var i =
|
|
64405
|
+
for (var i = 1; i <= 60; ++i) {
|
|
64371
64406
|
defs('EPSG:' + (32600 + i), "+proj=utm +zone=" + i + " +datum=WGS84 +units=m");
|
|
64372
64407
|
defs('EPSG:' + (32700 + i), "+proj=utm +zone=" + i + " +south +datum=WGS84 +units=m");
|
|
64373
64408
|
}
|
|
@@ -65642,7 +65677,7 @@ var datums = {
|
|
|
65642
65677
|
ellipse: "bessel",
|
|
65643
65678
|
datumName: "Hermannskogel"
|
|
65644
65679
|
},
|
|
65645
|
-
|
|
65680
|
+
mgi: {
|
|
65646
65681
|
towgs84: "577.326,90.129,463.919,5.137,1.474,5.297,2.4232",
|
|
65647
65682
|
ellipse: "bessel",
|
|
65648
65683
|
datumName: "Militar-Geographische Institut",
|