geojs 1.12.8 → 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/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;
@@ -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
 
@@ -28059,7 +28095,7 @@ module.exports = _sceneObject;
28059
28095
  * @constant
28060
28096
  * @type {string}
28061
28097
  */
28062
- module.exports = "af985cb0e0d8b7d7e3d98fff530ca23ae24cbcb8";
28098
+ module.exports = "540466ba3aa5e442250a9eb78abbf8f62e824a51";
28063
28099
 
28064
28100
  /***/ }),
28065
28101
 
@@ -37984,15 +38020,15 @@ var util = {
37984
38020
  }
37985
38021
  var copy = source[key];
37986
38022
  if (copy && _typeof(copy) === 'object' && (copy.constructor === Object || Array.isArray(copy))) {
37987
- var src = target[key];
38023
+ var value = target[key];
37988
38024
  if (!Array.isArray(copy)) {
37989
- if (_typeof(src) !== 'object' || Array.isArray(src)) {
37990
- src = {};
38025
+ if (_typeof(value) !== 'object' || Array.isArray(value)) {
38026
+ value = {};
37991
38027
  }
37992
- } else if (!Array.isArray(src)) {
37993
- src = [];
38028
+ } else if (!Array.isArray(value)) {
38029
+ value = [];
37994
38030
  }
37995
- target[key] = util.deepMerge(src, copy);
38031
+ target[key] = util.deepMerge(value, copy);
37996
38032
  } else if (copy !== undefined) {
37997
38033
  target[key] = copy;
37998
38034
  }
@@ -39932,7 +39968,7 @@ module.exports = _vectorFeature;
39932
39968
  * @constant
39933
39969
  * @type {string}
39934
39970
  */
39935
- module.exports = "1.12.8";
39971
+ module.exports = "1.12.9";
39936
39972
 
39937
39973
  /***/ }),
39938
39974
 
@@ -67367,7 +67403,7 @@ __webpack_require__.d(__webpack_exports__, {
67367
67403
  defs('EPSG:4269', "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees");
67368
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");
67369
67405
  // UTM WGS84
67370
- for (var i = 0; i <= 60; ++i) {
67406
+ for (var i = 1; i <= 60; ++i) {
67371
67407
  defs('EPSG:' + (32600 + i), "+proj=utm +zone=" + i + " +datum=WGS84 +units=m");
67372
67408
  defs('EPSG:' + (32700 + i), "+proj=utm +zone=" + i + " +south +datum=WGS84 +units=m");
67373
67409
  }
@@ -68642,7 +68678,7 @@ var datums = {
68642
68678
  ellipse: "bessel",
68643
68679
  datumName: "Hermannskogel"
68644
68680
  },
68645
- militargeographische_institut: {
68681
+ mgi: {
68646
68682
  towgs84: "577.326,90.129,463.919,5.137,1.474,5.297,2.4232",
68647
68683
  ellipse: "bessel",
68648
68684
  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.apply(null, Array(m_this.options('vertices').length)).map(function () {
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.apply(null, Array(m_this.options('vertices').length)).map(function () {
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
- args = util.deepMerge({}, this.constructor.defaults, {
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.apply(null, Array((coord.outer || coord).length)).map(function () {
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.x;
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 m_this = this,
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
- m_this.geoTrigger(geo_event.annotation.add_before, {
3883
- annotation: 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
- annotation: annotation
3931
+ annotations: added
3899
3932
  });
3900
3933
  }
3901
3934
  return m_this;
@@ -8840,20 +8873,23 @@ geo_event.camera.viewport = 'geo_camera_viewport';
8840
8873
  geo_event.annotation = {};
8841
8874
 
8842
8875
  /**
8843
- * Triggered when an annotation has been added.
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 an annotation is about to be added.
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
 
@@ -25058,7 +25094,7 @@ module.exports = _sceneObject;
25058
25094
  * @constant
25059
25095
  * @type {string}
25060
25096
  */
25061
- module.exports = "af985cb0e0d8b7d7e3d98fff530ca23ae24cbcb8";
25097
+ module.exports = "540466ba3aa5e442250a9eb78abbf8f62e824a51";
25062
25098
 
25063
25099
  /***/ }),
25064
25100
 
@@ -34983,15 +35019,15 @@ var util = {
34983
35019
  }
34984
35020
  var copy = source[key];
34985
35021
  if (copy && _typeof(copy) === 'object' && (copy.constructor === Object || Array.isArray(copy))) {
34986
- var src = target[key];
35022
+ var value = target[key];
34987
35023
  if (!Array.isArray(copy)) {
34988
- if (_typeof(src) !== 'object' || Array.isArray(src)) {
34989
- src = {};
35024
+ if (_typeof(value) !== 'object' || Array.isArray(value)) {
35025
+ value = {};
34990
35026
  }
34991
- } else if (!Array.isArray(src)) {
34992
- src = [];
35027
+ } else if (!Array.isArray(value)) {
35028
+ value = [];
34993
35029
  }
34994
- target[key] = util.deepMerge(src, copy);
35030
+ target[key] = util.deepMerge(value, copy);
34995
35031
  } else if (copy !== undefined) {
34996
35032
  target[key] = copy;
34997
35033
  }
@@ -36931,7 +36967,7 @@ module.exports = _vectorFeature;
36931
36967
  * @constant
36932
36968
  * @type {string}
36933
36969
  */
36934
- module.exports = "1.12.8";
36970
+ module.exports = "1.12.9";
36935
36971
 
36936
36972
  /***/ }),
36937
36973
 
@@ -64366,7 +64402,7 @@ __webpack_require__.d(__webpack_exports__, {
64366
64402
  defs('EPSG:4269', "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees");
64367
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");
64368
64404
  // UTM WGS84
64369
- for (var i = 0; i <= 60; ++i) {
64405
+ for (var i = 1; i <= 60; ++i) {
64370
64406
  defs('EPSG:' + (32600 + i), "+proj=utm +zone=" + i + " +datum=WGS84 +units=m");
64371
64407
  defs('EPSG:' + (32700 + i), "+proj=utm +zone=" + i + " +south +datum=WGS84 +units=m");
64372
64408
  }
@@ -65641,7 +65677,7 @@ var datums = {
65641
65677
  ellipse: "bessel",
65642
65678
  datumName: "Hermannskogel"
65643
65679
  },
65644
- militargeographische_institut: {
65680
+ mgi: {
65645
65681
  towgs84: "577.326,90.129,463.919,5.137,1.474,5.297,2.4232",
65646
65682
  ellipse: "bessel",
65647
65683
  datumName: "Militar-Geographische Institut",