geojs 1.10.1 → 1.10.2

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,17 @@
1
1
  # GeoJS Change Log
2
2
 
3
+ ## Version 1.10.2
4
+
5
+ ### Improvements
6
+
7
+ - Directly support nearest pixel or bicubic on quad interpolation ([#1229](../../pull/1229))
8
+
9
+ ## Version 1.10.1
10
+
11
+ ### Improvements
12
+
13
+ - Make clamping at the end of a map transition optional ([#1226](../../pull/1226))
14
+
3
15
  ## Version 1.10.0
4
16
 
5
17
  ### Features
package/geo.js CHANGED
@@ -8017,6 +8017,17 @@ var canvas_quadFeature = function canvas_quadFeature(arg) {
8017
8017
 
8018
8018
  var oldAlpha = context2d.globalAlpha;
8019
8019
  var opacity = oldAlpha;
8020
+ var nearestPixel = m_this.nearestPixel();
8021
+
8022
+ if (nearestPixel !== undefined) {
8023
+ if (nearestPixel !== true && util.isNonNullFinite(nearestPixel)) {
8024
+ var curZoom = m_this.layer().map().zoom();
8025
+ nearestPixel = curZoom >= nearestPixel;
8026
+ }
8027
+
8028
+ context2d.imageSmoothingEnabled = !nearestPixel;
8029
+ }
8030
+
8020
8031
  $.each([m_quads.imgQuads, m_quads.vidQuads], function (listidx, quadlist) {
8021
8032
  if (!quadlist) {
8022
8033
  return;
@@ -8086,6 +8097,7 @@ var canvas_quadFeature = function canvas_quadFeature(arg) {
8086
8097
  }
8087
8098
 
8088
8099
  context2d.setTransform(1, 0, 0, 1, 0, 0);
8100
+ context2d.imageSmoothingEnabled = true;
8089
8101
  };
8090
8102
  /**
8091
8103
  * If this returns true, the render will be skipped and tried again on the
@@ -8543,6 +8555,7 @@ var canvas_tileLayer = function canvas_tileLayer() {
8543
8555
 
8544
8556
  this._update = function (request) {
8545
8557
  s_update.call(m_this, request);
8558
+ m_quadFeature.nearestPixel(m_this.nearestPixel());
8546
8559
 
8547
8560
  m_this._addBaseQuadToTiles(m_quadFeature, m_tiles);
8548
8561
 
@@ -18628,6 +18641,10 @@ var map = function map(arg) {
18628
18641
  m_autoshareRenderer = arg === null ? undefined : arg;
18629
18642
  return m_this;
18630
18643
  };
18644
+ /* Report the current version on the map object. */
18645
+
18646
+
18647
+ this._version = __webpack_require__(2978);
18631
18648
  /**
18632
18649
  * Draw a layer image to a canvas context. The layer's opacity and transform
18633
18650
  * are applied. This is used as part of making a screenshot.
@@ -18641,7 +18658,6 @@ var map = function map(arg) {
18641
18658
  * @private
18642
18659
  */
18643
18660
 
18644
-
18645
18661
  function drawLayerImageToContext(context, opacity, elem, img, mixBlendMode) {
18646
18662
  context.globalAlpha = opacity;
18647
18663
 
@@ -24200,6 +24216,7 @@ var pixelmapLayer = function pixelmapLayer(arg) {
24200
24216
  this._init = function () {
24201
24217
  // Call super class init
24202
24218
  s_init.apply(m_this, arguments);
24219
+ m_this.nearestPixel(true, true);
24203
24220
  var pixelmapArgs = {
24204
24221
  quadFeature: m_this.features()[0]
24205
24222
  };
@@ -26010,6 +26027,10 @@ var feature = __webpack_require__(6837);
26010
26027
  * call `cacheUpdate` on the data item or for all data.
26011
26028
  * @property {geo.quadFeature.styleSpec} [style] Style object with default
26012
26029
  * style options.
26030
+ * @property {boolean|number} [nearestPixel] If true, image quads are
26031
+ * rendered with near-neighbor sampling. If false, with interpolated
26032
+ * sampling. If a number, interpolate at that zoom level or below and
26033
+ * nearest neighbor at that zoom level or above.
26013
26034
  */
26014
26035
 
26015
26036
  /**
@@ -26073,6 +26094,7 @@ var quadFeature = function quadFeature(arg) {
26073
26094
  var m_this = this,
26074
26095
  s_init = this._init,
26075
26096
  m_cacheQuads,
26097
+ m_nearestPixel = arg.nearestPixel,
26076
26098
  m_nextQuadId = 0,
26077
26099
  m_images = [],
26078
26100
  m_videos = [],
@@ -26755,6 +26777,27 @@ var quadFeature = function quadFeature(arg) {
26755
26777
 
26756
26778
  return null;
26757
26779
  };
26780
+ /**
26781
+ * Get/Set nearestPixel value.
26782
+ *
26783
+ * @param {boolean|number} [val] If not specified, return the current value.
26784
+ * If true, image quads are rendered with near-neighbor sampling. If
26785
+ * false, with interpolated sampling. If a number, interpolate at that
26786
+ * zoom level or below and nearest neighbor at that zoom level or above.
26787
+ * @returns {boolean|number|this}
26788
+ */
26789
+
26790
+
26791
+ this.nearestPixel = function (val) {
26792
+ if (val === undefined) {
26793
+ return m_nearestPixel;
26794
+ } else {
26795
+ m_nearestPixel = val;
26796
+ m_this.modified();
26797
+ }
26798
+
26799
+ return m_this;
26800
+ };
26758
26801
  /**
26759
26802
  * Initialize.
26760
26803
  *
@@ -27823,7 +27866,7 @@ module.exports = sceneObject;
27823
27866
  * @constant
27824
27867
  * @type {string}
27825
27868
  */
27826
- module.exports = "b37bd8311e8146b64ad199fccd0b4a5404d78157";
27869
+ module.exports = "8a83afdb7516115b52119da8bfe845e7def699dd";
27827
27870
 
27828
27871
  /***/ }),
27829
27872
 
@@ -30731,6 +30774,10 @@ var featureLayer = __webpack_require__(3715);
30731
30774
  * any tile layers. If specified, this uses the quad defaults, so this is a
30732
30775
  * ``geo.quadFeature.position`` object with, typically, an ``image`` property
30733
30776
  * added to it. The quad positions are in the map gcs coordinates.
30777
+ * @property {boolean|number} [nearestPixel] If true, image quads are
30778
+ * rendered with near-neighbor sampling. If false, with interpolated
30779
+ * sampling. If a number, interpolate at that zoom level or below and
30780
+ * nearest neighbor at that zoom level or above.
30734
30781
  */
30735
30782
 
30736
30783
  /**
@@ -30894,6 +30941,7 @@ var tileLayer = function tileLayer(arg) {
30894
30941
  m_reference,
30895
30942
  m_exited,
30896
30943
  m_lastBaseQuad,
30944
+ m_nearestPixel = arg.nearestPixel,
30897
30945
  m_this = this; // copy the options into a private variable
30898
30946
 
30899
30947
  this._options = $.extend(true, {}, arg); // set the layer attribution text
@@ -32535,6 +32583,36 @@ var tileLayer = function tileLayer(arg) {
32535
32583
 
32536
32584
  return m_this;
32537
32585
  };
32586
+ /**
32587
+ * Get/Set nearestPixel value.
32588
+ *
32589
+ * @param {boolean|number} [val] If not specified, return the current value.
32590
+ * If true, image quads are rendered with near-neighbor sampling. If
32591
+ * false, with interpolated sampling. If a number, interpolate at that
32592
+ * zoom level or below and nearest neighbor at that zoom level or above.
32593
+ * @param {boolean} [skipUpdate] If specifying val and this value is truthy,
32594
+ * don't update the layer or mark it as modified.
32595
+ * @returns {boolean|number|this}
32596
+ */
32597
+
32598
+
32599
+ this.nearestPixel = function (val, skipUpdate) {
32600
+ if (val === undefined) {
32601
+ return m_nearestPixel;
32602
+ }
32603
+
32604
+ if (m_nearestPixel !== val) {
32605
+ m_nearestPixel = val;
32606
+
32607
+ if (!skipUpdate) {
32608
+ m_this.modified();
32609
+
32610
+ m_this._update();
32611
+ }
32612
+ }
32613
+
32614
+ return m_this;
32615
+ };
32538
32616
  /**
32539
32617
  * Get/set the baseQuad.
32540
32618
  *
@@ -40948,7 +41026,7 @@ module.exports = vectorFeature;
40948
41026
  * @constant
40949
41027
  * @type {string}
40950
41028
  */
40951
- module.exports = "1.10.1";
41029
+ module.exports = "1.10.2";
40952
41030
 
40953
41031
  /***/ }),
40954
41032
 
@@ -43942,7 +44020,8 @@ var webgl_pixelmapFeature = function webgl_pixelmapFeature(arg) {
43942
44020
  m_quadFeature = m_this.layer().createFeature('quad', {
43943
44021
  selectionAPI: false,
43944
44022
  gcs: m_this.gcs(),
43945
- visible: m_this.visible(undefined, true)
44023
+ visible: m_this.visible(undefined, true),
44024
+ nearestPixel: true
43946
44025
  });
43947
44026
  m_quadFeatureInit = false;
43948
44027
  }
@@ -43964,11 +44043,6 @@ var webgl_pixelmapFeature = function webgl_pixelmapFeature(arg) {
43964
44043
  };
43965
44044
 
43966
44045
  m_quadFeature._hookRenderImageQuads = function (renderState, quads) {
43967
- quads.forEach(function (quad) {
43968
- if (quad.image && quad.texture && !quad.texture.nearestPixel()) {
43969
- quad.texture.setNearestPixel(true);
43970
- }
43971
- });
43972
44046
  m_lookupTable.bind(renderState, quads);
43973
44047
  };
43974
44048
 
@@ -44002,6 +44076,7 @@ var webgl_pixelmapFeature = function webgl_pixelmapFeature(arg) {
44002
44076
 
44003
44077
  if (arg.quadFeature) {
44004
44078
  m_quadFeature = arg.quadFeature;
44079
+ m_quadFeature.nearestPixel(true);
44005
44080
  }
44006
44081
 
44007
44082
  this._init(arg);
@@ -45204,6 +45279,8 @@ var quadFeature = __webpack_require__(5017);
45204
45279
 
45205
45280
  var timestamp = __webpack_require__(6618);
45206
45281
 
45282
+ var util = __webpack_require__(4634);
45283
+
45207
45284
  var _memoryCheckLargestTested = 4096 * 4096;
45208
45285
  /**
45209
45286
  * Create a new instance of class quadFeature.
@@ -45608,6 +45685,20 @@ var webgl_quadFeature = function webgl_quadFeature(arg) {
45608
45685
  h,
45609
45686
  quadw,
45610
45687
  quadh;
45688
+ var nearestPixel = m_this.nearestPixel();
45689
+
45690
+ if (nearestPixel !== undefined) {
45691
+ if (nearestPixel !== true && util.isNonNullFinite(nearestPixel)) {
45692
+ var curZoom = m_this.layer().map().zoom();
45693
+ nearestPixel = curZoom >= nearestPixel;
45694
+ }
45695
+
45696
+ m_quads.imgQuads.forEach(function (quad) {
45697
+ if (quad.image && quad.texture && quad.texture.nearestPixel() !== nearestPixel) {
45698
+ quad.texture.setNearestPixel(nearestPixel);
45699
+ }
45700
+ });
45701
+ }
45611
45702
 
45612
45703
  if (m_this._hookRenderImageQuads) {
45613
45704
  m_this._hookRenderImageQuads(renderState, m_quads.imgQuads);
@@ -46001,6 +46092,7 @@ var webgl_tileLayer = function webgl_tileLayer() {
46001
46092
 
46002
46093
  this._update = function (request) {
46003
46094
  s_update.call(m_this, request);
46095
+ m_quadFeature.nearestPixel(m_this.nearestPixel());
46004
46096
 
46005
46097
  m_this._addBaseQuadToTiles(m_quadFeature, m_tiles);
46006
46098
 
package/geo.lean.js CHANGED
@@ -8017,6 +8017,17 @@ var canvas_quadFeature = function canvas_quadFeature(arg) {
8017
8017
 
8018
8018
  var oldAlpha = context2d.globalAlpha;
8019
8019
  var opacity = oldAlpha;
8020
+ var nearestPixel = m_this.nearestPixel();
8021
+
8022
+ if (nearestPixel !== undefined) {
8023
+ if (nearestPixel !== true && util.isNonNullFinite(nearestPixel)) {
8024
+ var curZoom = m_this.layer().map().zoom();
8025
+ nearestPixel = curZoom >= nearestPixel;
8026
+ }
8027
+
8028
+ context2d.imageSmoothingEnabled = !nearestPixel;
8029
+ }
8030
+
8020
8031
  $.each([m_quads.imgQuads, m_quads.vidQuads], function (listidx, quadlist) {
8021
8032
  if (!quadlist) {
8022
8033
  return;
@@ -8086,6 +8097,7 @@ var canvas_quadFeature = function canvas_quadFeature(arg) {
8086
8097
  }
8087
8098
 
8088
8099
  context2d.setTransform(1, 0, 0, 1, 0, 0);
8100
+ context2d.imageSmoothingEnabled = true;
8089
8101
  };
8090
8102
  /**
8091
8103
  * If this returns true, the render will be skipped and tried again on the
@@ -8543,6 +8555,7 @@ var canvas_tileLayer = function canvas_tileLayer() {
8543
8555
 
8544
8556
  this._update = function (request) {
8545
8557
  s_update.call(m_this, request);
8558
+ m_quadFeature.nearestPixel(m_this.nearestPixel());
8546
8559
 
8547
8560
  m_this._addBaseQuadToTiles(m_quadFeature, m_tiles);
8548
8561
 
@@ -18628,6 +18641,10 @@ var map = function map(arg) {
18628
18641
  m_autoshareRenderer = arg === null ? undefined : arg;
18629
18642
  return m_this;
18630
18643
  };
18644
+ /* Report the current version on the map object. */
18645
+
18646
+
18647
+ this._version = __webpack_require__(2978);
18631
18648
  /**
18632
18649
  * Draw a layer image to a canvas context. The layer's opacity and transform
18633
18650
  * are applied. This is used as part of making a screenshot.
@@ -18641,7 +18658,6 @@ var map = function map(arg) {
18641
18658
  * @private
18642
18659
  */
18643
18660
 
18644
-
18645
18661
  function drawLayerImageToContext(context, opacity, elem, img, mixBlendMode) {
18646
18662
  context.globalAlpha = opacity;
18647
18663
 
@@ -24200,6 +24216,7 @@ var pixelmapLayer = function pixelmapLayer(arg) {
24200
24216
  this._init = function () {
24201
24217
  // Call super class init
24202
24218
  s_init.apply(m_this, arguments);
24219
+ m_this.nearestPixel(true, true);
24203
24220
  var pixelmapArgs = {
24204
24221
  quadFeature: m_this.features()[0]
24205
24222
  };
@@ -26010,6 +26027,10 @@ var feature = __webpack_require__(6837);
26010
26027
  * call `cacheUpdate` on the data item or for all data.
26011
26028
  * @property {geo.quadFeature.styleSpec} [style] Style object with default
26012
26029
  * style options.
26030
+ * @property {boolean|number} [nearestPixel] If true, image quads are
26031
+ * rendered with near-neighbor sampling. If false, with interpolated
26032
+ * sampling. If a number, interpolate at that zoom level or below and
26033
+ * nearest neighbor at that zoom level or above.
26013
26034
  */
26014
26035
 
26015
26036
  /**
@@ -26073,6 +26094,7 @@ var quadFeature = function quadFeature(arg) {
26073
26094
  var m_this = this,
26074
26095
  s_init = this._init,
26075
26096
  m_cacheQuads,
26097
+ m_nearestPixel = arg.nearestPixel,
26076
26098
  m_nextQuadId = 0,
26077
26099
  m_images = [],
26078
26100
  m_videos = [],
@@ -26755,6 +26777,27 @@ var quadFeature = function quadFeature(arg) {
26755
26777
 
26756
26778
  return null;
26757
26779
  };
26780
+ /**
26781
+ * Get/Set nearestPixel value.
26782
+ *
26783
+ * @param {boolean|number} [val] If not specified, return the current value.
26784
+ * If true, image quads are rendered with near-neighbor sampling. If
26785
+ * false, with interpolated sampling. If a number, interpolate at that
26786
+ * zoom level or below and nearest neighbor at that zoom level or above.
26787
+ * @returns {boolean|number|this}
26788
+ */
26789
+
26790
+
26791
+ this.nearestPixel = function (val) {
26792
+ if (val === undefined) {
26793
+ return m_nearestPixel;
26794
+ } else {
26795
+ m_nearestPixel = val;
26796
+ m_this.modified();
26797
+ }
26798
+
26799
+ return m_this;
26800
+ };
26758
26801
  /**
26759
26802
  * Initialize.
26760
26803
  *
@@ -27823,7 +27866,7 @@ module.exports = sceneObject;
27823
27866
  * @constant
27824
27867
  * @type {string}
27825
27868
  */
27826
- module.exports = "b37bd8311e8146b64ad199fccd0b4a5404d78157";
27869
+ module.exports = "8a83afdb7516115b52119da8bfe845e7def699dd";
27827
27870
 
27828
27871
  /***/ }),
27829
27872
 
@@ -30731,6 +30774,10 @@ var featureLayer = __webpack_require__(3715);
30731
30774
  * any tile layers. If specified, this uses the quad defaults, so this is a
30732
30775
  * ``geo.quadFeature.position`` object with, typically, an ``image`` property
30733
30776
  * added to it. The quad positions are in the map gcs coordinates.
30777
+ * @property {boolean|number} [nearestPixel] If true, image quads are
30778
+ * rendered with near-neighbor sampling. If false, with interpolated
30779
+ * sampling. If a number, interpolate at that zoom level or below and
30780
+ * nearest neighbor at that zoom level or above.
30734
30781
  */
30735
30782
 
30736
30783
  /**
@@ -30894,6 +30941,7 @@ var tileLayer = function tileLayer(arg) {
30894
30941
  m_reference,
30895
30942
  m_exited,
30896
30943
  m_lastBaseQuad,
30944
+ m_nearestPixel = arg.nearestPixel,
30897
30945
  m_this = this; // copy the options into a private variable
30898
30946
 
30899
30947
  this._options = $.extend(true, {}, arg); // set the layer attribution text
@@ -32535,6 +32583,36 @@ var tileLayer = function tileLayer(arg) {
32535
32583
 
32536
32584
  return m_this;
32537
32585
  };
32586
+ /**
32587
+ * Get/Set nearestPixel value.
32588
+ *
32589
+ * @param {boolean|number} [val] If not specified, return the current value.
32590
+ * If true, image quads are rendered with near-neighbor sampling. If
32591
+ * false, with interpolated sampling. If a number, interpolate at that
32592
+ * zoom level or below and nearest neighbor at that zoom level or above.
32593
+ * @param {boolean} [skipUpdate] If specifying val and this value is truthy,
32594
+ * don't update the layer or mark it as modified.
32595
+ * @returns {boolean|number|this}
32596
+ */
32597
+
32598
+
32599
+ this.nearestPixel = function (val, skipUpdate) {
32600
+ if (val === undefined) {
32601
+ return m_nearestPixel;
32602
+ }
32603
+
32604
+ if (m_nearestPixel !== val) {
32605
+ m_nearestPixel = val;
32606
+
32607
+ if (!skipUpdate) {
32608
+ m_this.modified();
32609
+
32610
+ m_this._update();
32611
+ }
32612
+ }
32613
+
32614
+ return m_this;
32615
+ };
32538
32616
  /**
32539
32617
  * Get/set the baseQuad.
32540
32618
  *
@@ -40948,7 +41026,7 @@ module.exports = vectorFeature;
40948
41026
  * @constant
40949
41027
  * @type {string}
40950
41028
  */
40951
- module.exports = "1.10.1";
41029
+ module.exports = "1.10.2";
40952
41030
 
40953
41031
  /***/ }),
40954
41032
 
@@ -43942,7 +44020,8 @@ var webgl_pixelmapFeature = function webgl_pixelmapFeature(arg) {
43942
44020
  m_quadFeature = m_this.layer().createFeature('quad', {
43943
44021
  selectionAPI: false,
43944
44022
  gcs: m_this.gcs(),
43945
- visible: m_this.visible(undefined, true)
44023
+ visible: m_this.visible(undefined, true),
44024
+ nearestPixel: true
43946
44025
  });
43947
44026
  m_quadFeatureInit = false;
43948
44027
  }
@@ -43964,11 +44043,6 @@ var webgl_pixelmapFeature = function webgl_pixelmapFeature(arg) {
43964
44043
  };
43965
44044
 
43966
44045
  m_quadFeature._hookRenderImageQuads = function (renderState, quads) {
43967
- quads.forEach(function (quad) {
43968
- if (quad.image && quad.texture && !quad.texture.nearestPixel()) {
43969
- quad.texture.setNearestPixel(true);
43970
- }
43971
- });
43972
44046
  m_lookupTable.bind(renderState, quads);
43973
44047
  };
43974
44048
 
@@ -44002,6 +44076,7 @@ var webgl_pixelmapFeature = function webgl_pixelmapFeature(arg) {
44002
44076
 
44003
44077
  if (arg.quadFeature) {
44004
44078
  m_quadFeature = arg.quadFeature;
44079
+ m_quadFeature.nearestPixel(true);
44005
44080
  }
44006
44081
 
44007
44082
  this._init(arg);
@@ -45204,6 +45279,8 @@ var quadFeature = __webpack_require__(5017);
45204
45279
 
45205
45280
  var timestamp = __webpack_require__(6618);
45206
45281
 
45282
+ var util = __webpack_require__(4634);
45283
+
45207
45284
  var _memoryCheckLargestTested = 4096 * 4096;
45208
45285
  /**
45209
45286
  * Create a new instance of class quadFeature.
@@ -45608,6 +45685,20 @@ var webgl_quadFeature = function webgl_quadFeature(arg) {
45608
45685
  h,
45609
45686
  quadw,
45610
45687
  quadh;
45688
+ var nearestPixel = m_this.nearestPixel();
45689
+
45690
+ if (nearestPixel !== undefined) {
45691
+ if (nearestPixel !== true && util.isNonNullFinite(nearestPixel)) {
45692
+ var curZoom = m_this.layer().map().zoom();
45693
+ nearestPixel = curZoom >= nearestPixel;
45694
+ }
45695
+
45696
+ m_quads.imgQuads.forEach(function (quad) {
45697
+ if (quad.image && quad.texture && quad.texture.nearestPixel() !== nearestPixel) {
45698
+ quad.texture.setNearestPixel(nearestPixel);
45699
+ }
45700
+ });
45701
+ }
45611
45702
 
45612
45703
  if (m_this._hookRenderImageQuads) {
45613
45704
  m_this._hookRenderImageQuads(renderState, m_quads.imgQuads);
@@ -46001,6 +46092,7 @@ var webgl_tileLayer = function webgl_tileLayer() {
46001
46092
 
46002
46093
  this._update = function (request) {
46003
46094
  s_update.call(m_this, request);
46095
+ m_quadFeature.nearestPixel(m_this.nearestPixel());
46004
46096
 
46005
46097
  m_this._addBaseQuadToTiles(m_quadFeature, m_tiles);
46006
46098