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.
@@ -31,7 +31,7 @@ jobs:
31
31
  - run: npm run setup-website
32
32
  - run: npm run ci-xvfb
33
33
  - run: npm run ci-build-website
34
- - uses: codecov/codecov-action@v4
34
+ - uses: codecov/codecov-action@v5
35
35
  with:
36
36
  fail_ci_if_error: false
37
37
  verbose: true
package/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # GeoJS Change Log
2
2
 
3
+ ## Version 1.12.9
4
+
5
+ ### Performance Improvements
6
+
7
+ - Add addMultipleAnnotations method ([#1351](../../pull/1351))
8
+
9
+ ## Version 1.12.8
10
+
11
+ ### Performance Improvements
12
+
13
+ - Switch to more native functions ([#1345](../../pull/1345))
14
+
15
+ ## Version 1.12.7
16
+
17
+ ### Performance Improvements
18
+
19
+ - Make adding and removing annotations somewhat more efficient ([#1343](../../pull/1343))
20
+
21
+ ## Version 1.12.6
22
+
23
+ ### Performance Improvements
24
+
25
+ - Stop using jquery extend ([#1342](../../pull/1342))
26
+
27
+ ## Version 1.12.5
28
+
29
+ ### Bug Fixes
30
+
31
+ - Change how webpack builds some libraries ([#1341](../../pull/1341))
32
+
33
+ ## Version 1.12.4
34
+
35
+ ### Performance Improvements
36
+
37
+ - Speed up adding annotations ([#1340](../../pull/1340))
38
+
39
+ ## Version 1.12.3
40
+
41
+ ### Bug Fixes
42
+
43
+ - Improve encoding html for screenshots ([#1334](../../pull/1334))
44
+
3
45
  ## Version 1.12.2
4
46
 
5
47
  ### 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.apply(null, Array(m_this.options('vertices').length)).map(function () {
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.apply(null, Array(m_this.options('vertices').length)).map(function () {
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
- args = util.deepMerge({}, this.constructor.defaults, {
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.apply(null, Array((coord.outer || coord).length)).map(function () {
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.x;
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 m_this = this,
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 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
- m_this.geoTrigger(geo_event.annotation.add_before, {
6884
- annotation: 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
- annotation: annotation
6932
+ annotations: added
6900
6933
  });
6901
6934
  }
6902
6935
  return m_this;
@@ -6915,7 +6948,7 @@ var _annotationLayer = function annotationLayer(arg) {
6915
6948
  */
6916
6949
  this.removeAnnotation = function (annotation, update, pos) {
6917
6950
  if (annotation.id && m_annotationIds[annotation.id()] !== undefined) {
6918
- pos = $.inArray(annotation, m_annotations);
6951
+ pos = m_annotations.indexOf(annotation);
6919
6952
  if (annotation === m_this.currentAnnotation) {
6920
6953
  m_this.currentAnnotation = null;
6921
6954
  }
@@ -7200,7 +7233,7 @@ var _annotationLayer = function annotationLayer(arg) {
7200
7233
  datagcs,
7201
7234
  i,
7202
7235
  existing;
7203
- if ($.inArray(type, annotationList) < 0) {
7236
+ if (!annotationList.includes(type)) {
7204
7237
  return;
7205
7238
  }
7206
7239
  options.style = options.style || {};
@@ -11841,20 +11874,23 @@ geo_event.camera.viewport = 'geo_camera_viewport';
11841
11874
  geo_event.annotation = {};
11842
11875
 
11843
11876
  /**
11844
- * Triggered when an annotation has been added.
11877
+ * Triggered when or more multiple annotations have been added.
11845
11878
  *
11846
11879
  * @event geo.event.annotation.add
11847
11880
  * @type {geo.event.base}
11848
- * @property {geo.annotation} annotation The annotation that was added.
11881
+ * @property {geo.annotation} [annotation] The annotation that was added.
11882
+ * @property {geo.annotation} [annotations] The annotations that were added.
11849
11883
  */
11850
11884
  geo_event.annotation.add = 'geo_annotation_add';
11851
11885
 
11852
11886
  /**
11853
- * Triggered when an annotation is about to be added.
11887
+ * Triggered when one or multiple annotations are about to be added.
11854
11888
  *
11855
11889
  * @event geo.event.annotation.add_before
11856
11890
  * @type {geo.event.base}
11857
- * @property {geo.annotation} annotation The annotation that will be added.
11891
+ * @property {geo.annotation} [annotation] The annotation that will be added.
11892
+ * @property {geo.annotation[]} [annotations] The annotations that will be
11893
+ * added.
11858
11894
  */
11859
11895
  geo_event.annotation.add_before = 'geo_annotation_add_before';
11860
11896
 
@@ -13550,7 +13586,7 @@ var _fetchQueue = function fetchQueue(options) {
13550
13586
  */
13551
13587
  this.add = function (defer, callback, atEnd) {
13552
13588
  if (defer.__fetchQueue) {
13553
- var pos = $.inArray(defer, m_this._queue);
13589
+ var pos = m_this._queue.indexOf(defer);
13554
13590
  if (pos >= 0) {
13555
13591
  // m_this._queue.splice(pos, 1);
13556
13592
  m_this._addToQueue(defer, atEnd, pos);
@@ -13621,7 +13657,7 @@ var _fetchQueue = function fetchQueue(options) {
13621
13657
  * @returns {number} -1 if not in the queue, or the position in the queue.
13622
13658
  */
13623
13659
  this.get = function (defer) {
13624
- return $.inArray(defer, m_this._queue);
13660
+ return m_this._queue.indexOf(defer);
13625
13661
  };
13626
13662
 
13627
13663
  /**
@@ -13631,7 +13667,7 @@ var _fetchQueue = function fetchQueue(options) {
13631
13667
  * @returns {boolean} `true` if the object was removed.
13632
13668
  */
13633
13669
  this.remove = function (defer) {
13634
- var pos = $.inArray(defer, m_this._queue);
13670
+ var pos = m_this._queue.indexOf(defer);
13635
13671
  if (pos >= 0) {
13636
13672
  m_this._queue.splice(pos, 1);
13637
13673
  return true;
@@ -21866,7 +21902,7 @@ var _mapInteractor = function mapInteractor(args) {
21866
21902
  clearState();
21867
21903
 
21868
21904
  // if momentum is enabled, start the action here
21869
- if (m_options.momentum.enabled && $.inArray(oldAction, m_options.momentum.actions) >= 0) {
21905
+ if (m_options.momentum.enabled && m_options.momentum.actions.includes(oldAction)) {
21870
21906
  var t = new Date().valueOf();
21871
21907
  var dt = t - m_mouse.time + m_mouse.deltaTime;
21872
21908
  if (t - m_mouse.time < m_options.momentum.stopTime) {
@@ -26876,8 +26912,8 @@ var _quadFeature = function quadFeature(arg) {
26876
26912
  prev_onload = image.onload;
26877
26913
  image.onload = function () {
26878
26914
  if (previewColor !== undefined) {
26879
- if ($.inArray(quad, clrQuads) >= 0) {
26880
- clrQuads.splice($.inArray(quad, clrQuads), 1);
26915
+ if (clrQuads.includes(quad)) {
26916
+ clrQuads.splice(clrQuads.indexOf(quad), 1);
26881
26917
  }
26882
26918
  delete quadinfo.clrquad;
26883
26919
  }
@@ -26953,8 +26989,8 @@ var _quadFeature = function quadFeature(arg) {
26953
26989
  prev_onload = video.onloadeddata;
26954
26990
  video.onloadeddata = function () {
26955
26991
  if (previewColor !== undefined) {
26956
- if ($.inArray(quad, clrQuads) >= 0) {
26957
- clrQuads.splice($.inArray(quad, clrQuads), 1);
26992
+ if (clrQuads.includes(quad)) {
26993
+ clrQuads.splice(clrQuads.indexOf(quad), 1);
26958
26994
  }
26959
26995
  delete quadinfo.clrquad;
26960
26996
  }
@@ -27185,7 +27221,6 @@ module.exports = _quadFeature;
27185
27221
  /***/ 1098:
27186
27222
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
27187
27223
 
27188
- var $ = __webpack_require__(5616);
27189
27224
  var geo_action = __webpack_require__(8695);
27190
27225
  var util = __webpack_require__(1949);
27191
27226
  var widgets = {
@@ -27641,7 +27676,7 @@ registry.featuresForAnnotations = function (annotationList) {
27641
27676
  features.push(feature);
27642
27677
  } else {
27643
27678
  annotationList[ann].forEach(function (state) {
27644
- if ($.inArray(state, annotations[ann].features[feature]) >= 0) {
27679
+ if (annotations[ann].features[feature].includes(state)) {
27645
27680
  features.push(feature);
27646
27681
  }
27647
27682
  });
@@ -28060,7 +28095,7 @@ module.exports = _sceneObject;
28060
28095
  * @constant
28061
28096
  * @type {string}
28062
28097
  */
28063
- module.exports = "62002290dca8a13aae8b6efc44341c14b02b427e";
28098
+ module.exports = "540466ba3aa5e442250a9eb78abbf8f62e824a51";
28064
28099
 
28065
28100
  /***/ }),
28066
28101
 
@@ -37436,7 +37471,7 @@ var util = {
37436
37471
  do {
37437
37472
  found = util.hasAction(actions, action, name, owner);
37438
37473
  if (found) {
37439
- actions.splice($.inArray(found, actions), 1);
37474
+ actions.splice(actions.indexOf(found), 1);
37440
37475
  removed += 1;
37441
37476
  }
37442
37477
  } while (found);
@@ -37984,16 +38019,16 @@ var util = {
37984
38019
  continue;
37985
38020
  }
37986
38021
  var copy = source[key];
37987
- if (copy && _typeof(copy) === 'object' && copy && (copy.constructor === undefined || copy.constructor === Object || Array.isArray(copy))) {
37988
- var src = target[key];
38022
+ if (copy && _typeof(copy) === 'object' && (copy.constructor === Object || Array.isArray(copy))) {
38023
+ var value = target[key];
37989
38024
  if (!Array.isArray(copy)) {
37990
- if (_typeof(src) !== 'object' || Array.isArray(src)) {
37991
- src = {};
38025
+ if (_typeof(value) !== 'object' || Array.isArray(value)) {
38026
+ value = {};
37992
38027
  }
37993
- } else if (!Array.isArray(src)) {
37994
- src = [];
38028
+ } else if (!Array.isArray(value)) {
38029
+ value = [];
37995
38030
  }
37996
- target[key] = util.deepMerge(src, copy);
38031
+ target[key] = util.deepMerge(value, copy);
37997
38032
  } else if (copy !== undefined) {
37998
38033
  target[key] = copy;
37999
38034
  }
@@ -39933,7 +39968,7 @@ module.exports = _vectorFeature;
39933
39968
  * @constant
39934
39969
  * @type {string}
39935
39970
  */
39936
- module.exports = "1.12.7";
39971
+ module.exports = "1.12.9";
39937
39972
 
39938
39973
  /***/ }),
39939
39974
 
@@ -67368,7 +67403,7 @@ __webpack_require__.d(__webpack_exports__, {
67368
67403
  defs('EPSG:4269', "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees");
67369
67404
  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");
67370
67405
  // UTM WGS84
67371
- for (var i = 0; i <= 60; ++i) {
67406
+ for (var i = 1; i <= 60; ++i) {
67372
67407
  defs('EPSG:' + (32600 + i), "+proj=utm +zone=" + i + " +datum=WGS84 +units=m");
67373
67408
  defs('EPSG:' + (32700 + i), "+proj=utm +zone=" + i + " +south +datum=WGS84 +units=m");
67374
67409
  }
@@ -68643,7 +68678,7 @@ var datums = {
68643
68678
  ellipse: "bessel",
68644
68679
  datumName: "Hermannskogel"
68645
68680
  },
68646
- militargeographische_institut: {
68681
+ mgi: {
68647
68682
  towgs84: "577.326,90.129,463.919,5.137,1.474,5.297,2.4232",
68648
68683
  ellipse: "bessel",
68649
68684
  datumName: "Militar-Geographische Institut",