geojs 1.10.2 → 1.10.5

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,23 @@
1
1
  # GeoJS Change Log
2
2
 
3
+ ## Version 1.10.5
4
+
5
+ ### Bug Fixes
6
+
7
+ - Guard converting an empty polygon ([#1232](../../pull/1232))
8
+
9
+ ## Version 1.10.4
10
+
11
+ ### Bug Fixes
12
+
13
+ - Guard accessing a quad feature ([#1231](../../pull/1231))
14
+
15
+ ## Version 1.10.3
16
+
17
+ ### Performance improvements
18
+
19
+ - Reduce the time it takes to switch texture interpolation ([#1230](../../pull/1230))
20
+
3
21
  ## Version 1.10.2
4
22
 
5
23
  ### Improvements
package/geo.js CHANGED
@@ -209,7 +209,11 @@ var annotation = function annotation(type, args) {
209
209
  */
210
210
 
211
211
 
212
- this._exit = function () {};
212
+ this._exit = function () {
213
+ if (m_this.layer()) {
214
+ m_this.layer().geoOff(geo_event.mousemove, m_this._cursorHandleMousemove);
215
+ }
216
+ };
213
217
  /**
214
218
  * Get a unique annotation id.
215
219
  *
@@ -921,6 +925,10 @@ var annotation = function annotation(type, args) {
921
925
  this.coordinates = function (gcs) {
922
926
  var coord = m_this._coordinates() || [];
923
927
 
928
+ if (!coord.length && (!coord.outer || !coord.outer.length)) {
929
+ coord = [];
930
+ }
931
+
924
932
  if (m_this.layer()) {
925
933
  var map = m_this.layer().map();
926
934
  gcs = gcs === null ? map.gcs() : gcs === undefined ? map.ingcs() : gcs;
@@ -2892,7 +2900,7 @@ var polygonAnnotation = function polygonAnnotation(args) {
2892
2900
  return result;
2893
2901
  }
2894
2902
 
2895
- if (coord.length < 3) {
2903
+ if (coord.length < 3 || !coord.map) {
2896
2904
  return [];
2897
2905
  }
2898
2906
 
@@ -8555,7 +8563,10 @@ var canvas_tileLayer = function canvas_tileLayer() {
8555
8563
 
8556
8564
  this._update = function (request) {
8557
8565
  s_update.call(m_this, request);
8558
- m_quadFeature.nearestPixel(m_this.nearestPixel());
8566
+
8567
+ if (m_quadFeature && m_quadFeature.nearestPixel) {
8568
+ m_quadFeature.nearestPixel(m_this.nearestPixel());
8569
+ }
8559
8570
 
8560
8571
  m_this._addBaseQuadToTiles(m_quadFeature, m_tiles);
8561
8572
 
@@ -23320,6 +23331,16 @@ var object = function object() {
23320
23331
 
23321
23332
  return m_this;
23322
23333
  };
23334
+ /**
23335
+ * Report the current event handlers.
23336
+ *
23337
+ * @returns {object} An object with all of the event handlers.
23338
+ */
23339
+
23340
+
23341
+ this._eventHandlers = function () {
23342
+ return m_eventHandlers;
23343
+ };
23323
23344
  /**
23324
23345
  * Free all resources and destroy the object.
23325
23346
  */
@@ -27866,7 +27887,7 @@ module.exports = sceneObject;
27866
27887
  * @constant
27867
27888
  * @type {string}
27868
27889
  */
27869
- module.exports = "8a83afdb7516115b52119da8bfe845e7def699dd";
27890
+ module.exports = "7f57d37e7c28f7be33fbb0081cbd16304d8dffd5";
27870
27891
 
27871
27892
  /***/ }),
27872
27893
 
@@ -41026,7 +41047,7 @@ module.exports = vectorFeature;
41026
41047
  * @constant
41027
41048
  * @type {string}
41028
41049
  */
41029
- module.exports = "1.10.2";
41050
+ module.exports = "1.10.5";
41030
41051
 
41031
41052
  /***/ }),
41032
41053
 
@@ -44076,7 +44097,10 @@ var webgl_pixelmapFeature = function webgl_pixelmapFeature(arg) {
44076
44097
 
44077
44098
  if (arg.quadFeature) {
44078
44099
  m_quadFeature = arg.quadFeature;
44079
- m_quadFeature.nearestPixel(true);
44100
+
44101
+ if (m_quadFeature.nearestPixel) {
44102
+ m_quadFeature.nearestPixel(true);
44103
+ }
44080
44104
  }
44081
44105
 
44082
44106
  this._init(arg);
@@ -45695,7 +45719,21 @@ var webgl_quadFeature = function webgl_quadFeature(arg) {
45695
45719
 
45696
45720
  m_quads.imgQuads.forEach(function (quad) {
45697
45721
  if (quad.image && quad.texture && quad.texture.nearestPixel() !== nearestPixel) {
45722
+ /* This could just be
45723
+ * quad.texture.setNearestPixel(nearestPixel);
45724
+ * but that needlessly redecodes the image. Instead, just change the
45725
+ * the interpolation flags, then change the nearestPixel value
45726
+ * without triggering a complete re-setup. */
45727
+ renderState.m_context.bindTexture(vgl.GL.TEXTURE_2D, quad.texture.textureHandle());
45728
+ renderState.m_context.texParameteri(vgl.GL.TEXTURE_2D, vgl.GL.TEXTURE_MIN_FILTER, nearestPixel ? vgl.GL.NEAREST : vgl.GL.LINEAR);
45729
+ renderState.m_context.texParameteri(vgl.GL.TEXTURE_2D, vgl.GL.TEXTURE_MAG_FILTER, nearestPixel ? vgl.GL.NEAREST : vgl.GL.LINEAR);
45730
+ renderState.m_context.bindTexture(vgl.GL.TEXTURE_2D, null);
45731
+ var oldmod = quad.texture.modified;
45732
+
45733
+ quad.texture.modified = function () {};
45734
+
45698
45735
  quad.texture.setNearestPixel(nearestPixel);
45736
+ quad.texture.modified = oldmod;
45699
45737
  }
45700
45738
  });
45701
45739
  }
@@ -46092,7 +46130,10 @@ var webgl_tileLayer = function webgl_tileLayer() {
46092
46130
 
46093
46131
  this._update = function (request) {
46094
46132
  s_update.call(m_this, request);
46095
- m_quadFeature.nearestPixel(m_this.nearestPixel());
46133
+
46134
+ if (m_quadFeature && m_quadFeature.nearestPixel) {
46135
+ m_quadFeature.nearestPixel(m_this.nearestPixel());
46136
+ }
46096
46137
 
46097
46138
  m_this._addBaseQuadToTiles(m_quadFeature, m_tiles);
46098
46139
 
package/geo.lean.js CHANGED
@@ -209,7 +209,11 @@ var annotation = function annotation(type, args) {
209
209
  */
210
210
 
211
211
 
212
- this._exit = function () {};
212
+ this._exit = function () {
213
+ if (m_this.layer()) {
214
+ m_this.layer().geoOff(geo_event.mousemove, m_this._cursorHandleMousemove);
215
+ }
216
+ };
213
217
  /**
214
218
  * Get a unique annotation id.
215
219
  *
@@ -921,6 +925,10 @@ var annotation = function annotation(type, args) {
921
925
  this.coordinates = function (gcs) {
922
926
  var coord = m_this._coordinates() || [];
923
927
 
928
+ if (!coord.length && (!coord.outer || !coord.outer.length)) {
929
+ coord = [];
930
+ }
931
+
924
932
  if (m_this.layer()) {
925
933
  var map = m_this.layer().map();
926
934
  gcs = gcs === null ? map.gcs() : gcs === undefined ? map.ingcs() : gcs;
@@ -2892,7 +2900,7 @@ var polygonAnnotation = function polygonAnnotation(args) {
2892
2900
  return result;
2893
2901
  }
2894
2902
 
2895
- if (coord.length < 3) {
2903
+ if (coord.length < 3 || !coord.map) {
2896
2904
  return [];
2897
2905
  }
2898
2906
 
@@ -8555,7 +8563,10 @@ var canvas_tileLayer = function canvas_tileLayer() {
8555
8563
 
8556
8564
  this._update = function (request) {
8557
8565
  s_update.call(m_this, request);
8558
- m_quadFeature.nearestPixel(m_this.nearestPixel());
8566
+
8567
+ if (m_quadFeature && m_quadFeature.nearestPixel) {
8568
+ m_quadFeature.nearestPixel(m_this.nearestPixel());
8569
+ }
8559
8570
 
8560
8571
  m_this._addBaseQuadToTiles(m_quadFeature, m_tiles);
8561
8572
 
@@ -23320,6 +23331,16 @@ var object = function object() {
23320
23331
 
23321
23332
  return m_this;
23322
23333
  };
23334
+ /**
23335
+ * Report the current event handlers.
23336
+ *
23337
+ * @returns {object} An object with all of the event handlers.
23338
+ */
23339
+
23340
+
23341
+ this._eventHandlers = function () {
23342
+ return m_eventHandlers;
23343
+ };
23323
23344
  /**
23324
23345
  * Free all resources and destroy the object.
23325
23346
  */
@@ -27866,7 +27887,7 @@ module.exports = sceneObject;
27866
27887
  * @constant
27867
27888
  * @type {string}
27868
27889
  */
27869
- module.exports = "8a83afdb7516115b52119da8bfe845e7def699dd";
27890
+ module.exports = "7f57d37e7c28f7be33fbb0081cbd16304d8dffd5";
27870
27891
 
27871
27892
  /***/ }),
27872
27893
 
@@ -41026,7 +41047,7 @@ module.exports = vectorFeature;
41026
41047
  * @constant
41027
41048
  * @type {string}
41028
41049
  */
41029
- module.exports = "1.10.2";
41050
+ module.exports = "1.10.5";
41030
41051
 
41031
41052
  /***/ }),
41032
41053
 
@@ -44076,7 +44097,10 @@ var webgl_pixelmapFeature = function webgl_pixelmapFeature(arg) {
44076
44097
 
44077
44098
  if (arg.quadFeature) {
44078
44099
  m_quadFeature = arg.quadFeature;
44079
- m_quadFeature.nearestPixel(true);
44100
+
44101
+ if (m_quadFeature.nearestPixel) {
44102
+ m_quadFeature.nearestPixel(true);
44103
+ }
44080
44104
  }
44081
44105
 
44082
44106
  this._init(arg);
@@ -45695,7 +45719,21 @@ var webgl_quadFeature = function webgl_quadFeature(arg) {
45695
45719
 
45696
45720
  m_quads.imgQuads.forEach(function (quad) {
45697
45721
  if (quad.image && quad.texture && quad.texture.nearestPixel() !== nearestPixel) {
45722
+ /* This could just be
45723
+ * quad.texture.setNearestPixel(nearestPixel);
45724
+ * but that needlessly redecodes the image. Instead, just change the
45725
+ * the interpolation flags, then change the nearestPixel value
45726
+ * without triggering a complete re-setup. */
45727
+ renderState.m_context.bindTexture(vgl.GL.TEXTURE_2D, quad.texture.textureHandle());
45728
+ renderState.m_context.texParameteri(vgl.GL.TEXTURE_2D, vgl.GL.TEXTURE_MIN_FILTER, nearestPixel ? vgl.GL.NEAREST : vgl.GL.LINEAR);
45729
+ renderState.m_context.texParameteri(vgl.GL.TEXTURE_2D, vgl.GL.TEXTURE_MAG_FILTER, nearestPixel ? vgl.GL.NEAREST : vgl.GL.LINEAR);
45730
+ renderState.m_context.bindTexture(vgl.GL.TEXTURE_2D, null);
45731
+ var oldmod = quad.texture.modified;
45732
+
45733
+ quad.texture.modified = function () {};
45734
+
45698
45735
  quad.texture.setNearestPixel(nearestPixel);
45736
+ quad.texture.modified = oldmod;
45699
45737
  }
45700
45738
  });
45701
45739
  }
@@ -46092,7 +46130,10 @@ var webgl_tileLayer = function webgl_tileLayer() {
46092
46130
 
46093
46131
  this._update = function (request) {
46094
46132
  s_update.call(m_this, request);
46095
- m_quadFeature.nearestPixel(m_this.nearestPixel());
46133
+
46134
+ if (m_quadFeature && m_quadFeature.nearestPixel) {
46135
+ m_quadFeature.nearestPixel(m_this.nearestPixel());
46136
+ }
46096
46137
 
46097
46138
  m_this._addBaseQuadToTiles(m_quadFeature, m_tiles);
46098
46139