geojs 1.12.2 → 1.12.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geojs",
3
- "version": "1.12.2",
3
+ "version": "1.12.4",
4
4
  "description": "JavaScript Geo Visualization and Analysis Library",
5
5
  "homepage": "https://github.com/OpenGeoscience/geojs",
6
6
  "license": "Apache-2.0",
@@ -12,9 +12,10 @@
12
12
  "url": "https://github.com/OpenGeoscience/geojs"
13
13
  },
14
14
  "dependencies": {
15
+ "canvas": "^2.11.2",
15
16
  "color-name": "^2.0.0",
16
17
  "docdash": "^2.0.1",
17
- "earcut": "^2.2.3",
18
+ "earcut": "^3.0.0",
18
19
  "gl-mat3": "^2.0.0",
19
20
  "gl-mat4": "^1.2.0",
20
21
  "gl-vec3": "^1.1.3",
@@ -37,23 +38,23 @@
37
38
  "@babel/preset-env": "^7.16.5",
38
39
  "@jsdevtools/coverage-istanbul-loader": "^3.0.5",
39
40
  "babel-loader": "^9.0.1",
40
- "babel-plugin-istanbul": "^6.1.1",
41
+ "babel-plugin-istanbul": "^7.0.0",
41
42
  "bootstrap": "^3.4.1",
42
43
  "bootswatch": "^3.4.1",
43
44
  "codemirror": "^5.65.0",
44
45
  "colorbrewer": "^1.5.1",
45
- "css-loader": "^6.6.0",
46
+ "css-loader": "^7.1.0",
46
47
  "docco": "^0.9.1",
47
- "eslint": "^8.20.0",
48
+ "eslint": "^8.57.1",
48
49
  "eslint-config-semistandard": "^17.0.0",
49
50
  "eslint-config-standard": "^17.0.0",
50
51
  "eslint-plugin-import": "^2.25.3",
51
- "eslint-plugin-n": "^15.2.4",
52
- "eslint-plugin-promise": "^6.0.0",
52
+ "eslint-plugin-n": "^15.7.0",
53
+ "eslint-plugin-promise": "^6.6.0",
53
54
  "expose-loader": "^5.0.0",
54
55
  "express": "^4.17.2",
55
56
  "fs-extra": "^11.0.0",
56
- "glob": "^10.1.0",
57
+ "glob": "^11.0.0",
57
58
  "imports-loader": "^5.0.0",
58
59
  "jasmine-core": "^5.0.0",
59
60
  "js-yaml": "^4.1.0",
@@ -77,23 +78,23 @@
77
78
  "pug": "^3.0.2",
78
79
  "pug-lint": "^2.6.0",
79
80
  "pug-load": "^3.0.0",
80
- "raw-body": "^2.4.2",
81
+ "raw-body": "^3.0.0",
81
82
  "resemblejs": "^5.0.0",
82
83
  "serve-index": "^1.9.1",
83
84
  "shader-loader": "git+https://github.com/Makio64/shader-loader",
84
- "sinon": "^17.0.0",
85
- "style-loader": "^3.3.1",
85
+ "sinon": "^19.0.2",
86
+ "style-loader": "^4.0.0",
86
87
  "stylelint": "<16.3.0 || >16.3.0",
87
88
  "stylelint-stylus": "^1.0.0",
88
- "stylus": "^0.62.0",
89
+ "stylus": "^0.64.0",
89
90
  "stylus-loader": "^8.0.0",
90
- "tar": "^6.1.13",
91
+ "tar": "^7.4.3",
91
92
  "terser-webpack-plugin": "^5.3.1",
92
93
  "touch-emulator": "^1.0.0",
93
94
  "typeface-lato": "^1.1.13",
94
95
  "webpack": "^5.68.0",
95
96
  "webpack-cli": "^5.0.0",
96
- "webpack-merge": "^5.8.0",
97
+ "webpack-merge": "^6.0.1",
97
98
  "webpack-string-replacer": "^0.0.20"
98
99
  },
99
100
  "release": {
@@ -96,6 +96,7 @@ var annotationLayer = function (arg) {
96
96
  m_options,
97
97
  m_mode = null,
98
98
  m_annotations = [],
99
+ m_annotationIds = {},
99
100
  m_features = [],
100
101
  m_labelFeature,
101
102
  m_labelLayer,
@@ -504,6 +505,7 @@ var annotationLayer = function (arg) {
504
505
  annotation: annotation
505
506
  });
506
507
  m_annotations.push(annotation);
508
+ m_annotationIds[annotation.id()] = annotation;
507
509
  annotation.layer(m_this);
508
510
  var map = m_this.map();
509
511
  gcs = (gcs === null ? map.gcs() : (
@@ -537,6 +539,9 @@ var annotationLayer = function (arg) {
537
539
  if (annotation === m_this.currentAnnotation) {
538
540
  m_this.currentAnnotation = null;
539
541
  }
542
+ if (m_annotationIds[annotation.id()] !== undefined) {
543
+ delete m_annotationIds[annotation.id()];
544
+ }
540
545
  annotation._exit();
541
546
  m_annotations.splice(pos, 1);
542
547
  if (update !== false) {
@@ -597,12 +602,7 @@ var annotationLayer = function (arg) {
597
602
  if (id !== undefined && id !== null) {
598
603
  id = +id; /* Cast to int */
599
604
  }
600
- var annotations = m_annotations.filter(function (annotation) {
601
- return annotation.id() === id;
602
- });
603
- if (annotations.length) {
604
- return annotations[0];
605
- }
605
+ return m_annotationIds[id];
606
606
  };
607
607
 
608
608
  /* A list of special modes */
@@ -1434,6 +1434,7 @@ var annotationLayer = function (arg) {
1434
1434
  // Call super class exit
1435
1435
  s_exit.call(m_this);
1436
1436
  m_annotations = [];
1437
+ m_annotationIds = {};
1437
1438
  m_features = [];
1438
1439
  return m_this;
1439
1440
  };
package/src/map.js CHANGED
@@ -1594,10 +1594,10 @@ var map = function (arg) {
1594
1594
  this.layers = this.children;
1595
1595
 
1596
1596
  /**
1597
- * Comapare two layers by zIndex. If the zIndex is the same, the order in
1598
- * the parent element is used. If the two layers don't have the same parent
1599
- * (for instance, one layer isn't attached to the map), layers in the map
1600
- * are sorted below detached layers.
1597
+ * Compare two layers by zIndex. If the zIndex is the same, the order in the
1598
+ * parent element is used. If the two layers don't have the same parent (for
1599
+ * instance, one layer isn't attached to the map), layers in the map are
1600
+ * sorted below detached layers.
1601
1601
  *
1602
1602
  * @param {geo.layer} a First layer to compare.
1603
1603
  * @param {geo.layer} b Second layer to compare.
@@ -45,7 +45,7 @@ var Mousetrap = require('mousetrap');
45
45
  * @property {boolean} [keyboard.focusHighlight=true] If truthy, when the map
46
46
  * gains focus, a highlight style is shown around it. This gives an
47
47
  * indicator that keyboard events will affect the map, but may not be
48
- * visuallly desirabel.
48
+ * visually desirable.
49
49
  * @property {boolean} [alwaysTouch=false] If true, add touch support even if
50
50
  * the browser doesn't apepar to be touch-aware.
51
51
  * @property {number} [wheelScaleX=1] A scale multiplier for horizontal wheel
@@ -156,7 +156,7 @@ var pointFeature = function (arg) {
156
156
  m_allData.forEach(function (d, i) {
157
157
 
158
158
  // for each point in the data set normalize the coordinate
159
- // representation and add the point to the cluster treee
159
+ // representation and add the point to the cluster tree
160
160
  var pt = util.normalizeCoordinates(position(d, i));
161
161
  pt.index = i;
162
162
  m_clusterTree.addPoint(pt);
@@ -639,7 +639,7 @@ var polygonFeature = function (arg) {
639
639
  return data;
640
640
  }
641
641
 
642
- /* Set the reduced polgons as the data and use simple accessors. */
642
+ /* Set the reduced polygons as the data and use simple accessors. */
643
643
  m_this.style('position', util.identityFunction);
644
644
  m_this.style('polygon', util.identityFunction);
645
645
  m_this.data(data);
@@ -49,7 +49,7 @@ require('./scaleWidget.styl');
49
49
  * that determine what round values are displayed.
50
50
  * @property {number} multiples.multiple The value that is selected for display.
51
51
  * @property {number} multiples.digit The number of significant digits in
52
- * `mutliple`.
52
+ * `multiple`.
53
53
  */
54
54
 
55
55
  /**
@@ -971,11 +971,22 @@ var util = {
971
971
  * @memberof geo.util
972
972
  */
973
973
  escapeUnicodeHTML: function (text) {
974
- return text.replace(/./g, function (k) {
974
+ return text.replace(/[^- 0-9A-Za-z~`!@#$%^&*()_+={}|[\]\\:";'<>?,./]/g, function (k, pos) {
975
975
  var code = k.charCodeAt(0);
976
976
  if (code < 127) {
977
977
  return k;
978
978
  }
979
+ /* decode utf016 surrogate pairs */
980
+ if (code >= 0xD800 && code <= 0xE000) {
981
+ if (code < 0xDC00 || pos) {
982
+ return '';
983
+ }
984
+ var code0 = text.charCodeAt(pos - 1);
985
+ if (code0 < 0xD800 || code0 >= 0xDC00) {
986
+ return '';
987
+ }
988
+ code = (code0 - 0xD800) * 0x400 + (code - 0xDC00);
989
+ }
979
990
  return '&#' + code.toString(10) + ';';
980
991
  });
981
992
  },
@@ -105,7 +105,7 @@ var vtkjsRenderer = function (arg) {
105
105
  /* If we are already scheduled to render, don't schedule again. Rather,
106
106
  * mark that we should render after other animation frame requests occur.
107
107
  * It would be nice if we could just reschedule the call by removing and
108
- * readding the animation frame request, but this doesn't work for if the
108
+ * re-adding the animation frame request, but this doesn't work for if the
109
109
  * reschedule occurs during another animation frame callback (it then waits
110
110
  * until a subsequent frame). */
111
111
  m_this.layer().map().scheduleAnimationFrame(m_this._renderFrame, true);
@@ -21,6 +21,7 @@ var webgl_polygonFeature = function (arg) {
21
21
 
22
22
  var vgl = require('../vgl');
23
23
  var earcut = require('earcut');
24
+ earcut = earcut.__esModule ? earcut.default : earcut;
24
25
  var transform = require('../transform');
25
26
  var util = require('../util');
26
27
  var object = require('./object');