geojs 1.8.3 → 1.8.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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # GeoJS Change Log
2
2
 
3
+ ## Version 1.8.4
4
+
5
+ ### Improvements
6
+
7
+ - Support polygon annotations with holes through geojson ([#1201](../../pull/1201))
8
+ - Adjust queue track size based on number of tile layers ([#1202](../../pull/1202))
9
+
10
+ ## Version 1.8.3
11
+
12
+ ### Improvements
13
+
14
+ - Support polygon annotations with holes ([#1200](../../pull/1200))
15
+
3
16
  ## Version 1.8.2
4
17
 
5
18
  ### Improvements
package/geo.js CHANGED
@@ -4165,16 +4165,31 @@ var annotationLayer = function annotationLayer(arg) {
4165
4165
  } // make a copy of the position array to avoid mutating the original.
4166
4166
 
4167
4167
 
4168
- position = position.outer.slice();
4168
+ position = {
4169
+ outer: position.outer.slice(),
4170
+ inner: (position.inner || []).map(function (h) {
4171
+ return h.slice();
4172
+ })
4173
+ };
4169
4174
 
4170
- if (position[position.length - 1][0] === position[0][0] && position[position.length - 1][1] === position[0][1]) {
4171
- position.splice(position.length - 1, 1);
4175
+ if (position.outer[position.outer.length - 1][0] === position.outer[0][0] && position.outer[position.outer.length - 1][1] === position.outer[0][1]) {
4176
+ position.outer.splice(position.outer.length - 1, 1);
4172
4177
 
4173
- if (position.length < 3) {
4178
+ if (position.outer.length < 3) {
4174
4179
  return;
4175
4180
  }
4176
4181
  }
4177
4182
 
4183
+ position.inner.forEach(function (h) {
4184
+ if (h.length > 3 && h[h.length - 1][0] === h[0][0] && h[h.length - 1][1] === h[0][1]) {
4185
+ h.splice(h.length - 1, 1);
4186
+ }
4187
+ });
4188
+
4189
+ if (!position.inner || !position.inner.length) {
4190
+ position = position.outer;
4191
+ }
4192
+
4178
4193
  break;
4179
4194
 
4180
4195
  case 'marker':
@@ -4186,16 +4201,20 @@ var annotationLayer = function annotationLayer(arg) {
4186
4201
  break;
4187
4202
  }
4188
4203
 
4189
- for (i = 0; i < position.length; i += 1) {
4190
- position[i] = util.normalizeCoordinates(position[i]);
4191
- }
4192
-
4193
4204
  datagcs = data.crs && data.crs.type === 'name' && data.crs.properties && data.crs.properties.type === 'proj4' && data.crs.properties.name ? data.crs.properties.name : gcs;
4205
+ [position.outer || position].concat(position.inner || []).forEach(function (poslist) {
4206
+ for (i = 0; i < poslist.length; i += 1) {
4207
+ poslist[i] = util.normalizeCoordinates(poslist[i]);
4208
+ }
4194
4209
 
4195
- if (datagcs !== map.gcs()) {
4196
- position = transform.transformCoordinates(datagcs, map.gcs(), position);
4197
- }
4210
+ if (datagcs !== map.gcs()) {
4211
+ var transposlist = transform.transformCoordinates(datagcs, map.gcs(), poslist);
4198
4212
 
4213
+ for (i = 0; i < poslist.length; i += 1) {
4214
+ poslist[i] = transposlist[i];
4215
+ }
4216
+ }
4217
+ });
4199
4218
  options.coordinates = position;
4200
4219
  /* For each style listed in the geojsonStyleProperties object, check if
4201
4220
  * is given under any of the variety of keys as a valid instance of the
@@ -10761,6 +10780,7 @@ var fetchQueue = function fetchQueue(options) {
10761
10780
  this._size = options.size || 6;
10762
10781
  this._initialSize = options.initialSize || 0;
10763
10782
  this._track = options.track || 600;
10783
+ this._initialTrack = this._track;
10764
10784
  this._needed = options.needed || null;
10765
10785
  this._batch = false;
10766
10786
  var m_this = this,
@@ -10801,6 +10821,38 @@ var fetchQueue = function fetchQueue(options) {
10801
10821
  m_this.next_item();
10802
10822
  }
10803
10823
  });
10824
+ /**
10825
+ * Get/set the track size. This is used to determine when to check if
10826
+ * entries can be discarded.
10827
+ * @property {number} track The number of entries to track without checking
10828
+ * for discards.
10829
+ * @name geo.fetchQueue#track
10830
+ */
10831
+
10832
+ Object.defineProperty(this, 'track', {
10833
+ get: function get() {
10834
+ return m_this._track;
10835
+ },
10836
+ set: function set(n) {
10837
+ m_this._track = n;
10838
+ }
10839
+ });
10840
+ /**
10841
+ * Get/set the initial track size. Unless changed, this is the value used
10842
+ * for track on class initialization.
10843
+ * @property {number} initialTrack The number of entries to track without
10844
+ * checking for discards.
10845
+ * @name geo.fetchQueue#intitialTrack
10846
+ */
10847
+
10848
+ Object.defineProperty(this, 'initialTrack', {
10849
+ get: function get() {
10850
+ return m_this._initialTrack;
10851
+ },
10852
+ set: function set(n) {
10853
+ m_this._initialTrack = n;
10854
+ }
10855
+ });
10804
10856
  /**
10805
10857
  * Get the current queue size. Read only.
10806
10858
  * @property {number} length The current queue size.
@@ -10897,7 +10949,7 @@ var fetchQueue = function fetchQueue(options) {
10897
10949
 
10898
10950
  if (atEnd) {
10899
10951
  m_this._queue.push(defer);
10900
- } else if (!this._batch) {
10952
+ } else if (!m_this._batch) {
10901
10953
  m_this._queue.unshift(defer);
10902
10954
  } else {
10903
10955
  for (var i = 0; i < m_this._queue.length; i += 1) {
@@ -26804,7 +26856,7 @@ module.exports = sceneObject;
26804
26856
  * @constant
26805
26857
  * @type {string}
26806
26858
  */
26807
- module.exports = "06c78d577d1a9dd6332ee47b20fe441d239225ca";
26859
+ module.exports = "aa7a52c0facebedfe694ae91d1f9a295ade8765e";
26808
26860
 
26809
26861
  /***/ }),
26810
26862
 
@@ -29647,7 +29699,7 @@ var featureLayer = __webpack_require__(3715);
29647
29699
  * @property {function} [tilesAtZoom=null] A function that is given a zoom
29648
29700
  * level and returns `{x: (num), y: (num)}` with the number of tiles at that
29649
29701
  * zoom level.
29650
- * @property {number} [cacheSize=400] The maximum number of tiles to cache.
29702
+ * @property {number} [cacheSize=600] The maximum number of tiles to cache.
29651
29703
  * The default is 200 if keepLower is false.
29652
29704
  * @property {geo.fetchQueue} [queue] A fetch queue to use. If unspecified, a
29653
29705
  * new queue is created.
@@ -29832,6 +29884,10 @@ var tileLayer = function tileLayer(arg) {
29832
29884
 
29833
29885
  if (!arg.cacheSize) {
29834
29886
  // this size should be sufficient for a 4k display
29887
+ // where display size is (w, h), minimum tile dimension is ts, and total
29888
+ // number of levels is ml, this is roughly
29889
+ // sum([(math.ceil((w**2+h**2)**0.5 / (ts*2**l)) + 1) *
29890
+ // (math.ceil(min(w, h) / (ts*2**l)) + 1) for l in range(ml)])
29835
29891
  arg.cacheSize = arg.keepLower ? 600 : 200;
29836
29892
  }
29837
29893
 
@@ -29909,6 +29965,10 @@ var tileLayer = function tileLayer(arg) {
29909
29965
 
29910
29966
  this._queue._tileLayers.push(m_this);
29911
29967
 
29968
+ if (this._queue.initialTrack && this._queue.track) {
29969
+ this._queue.track = this._queue.initialTrack * this._queue._tileLayers.length;
29970
+ }
29971
+
29912
29972
  var m_tileOffsetValues = {};
29913
29973
  /**
29914
29974
  * Readonly accessor to the options object.
@@ -29965,12 +30025,20 @@ var tileLayer = function tileLayer(arg) {
29965
30025
  if (m_this._queue !== queue) {
29966
30026
  if (this._queue && this._queue._tileLayers && this._queue._tileLayers.indexOf(m_this) >= 0) {
29967
30027
  this._queue._tileLayers.splice(this._queue._tileLayers.indexOf(m_this), 1);
30028
+
30029
+ if (this._queue.initialTrack && this._queue.track && this._queue._tileLayers.length) {
30030
+ this._queue.track = this._queue.initialTrack * this._queue._tileLayers.length;
30031
+ }
29968
30032
  }
29969
30033
 
29970
30034
  m_this._queue = queue;
29971
30035
  m_this._queue._tileLayers = m_this._queue._tileLayers || [];
29972
30036
 
29973
30037
  m_this._queue._tileLayers.push(m_this);
30038
+
30039
+ if (m_this._queue.initialTrack && m_this._queue.track) {
30040
+ m_this._queue.track = m_this._queue.initialTrack * m_this._queue._tileLayers.length;
30041
+ }
29974
30042
  }
29975
30043
  }
29976
30044
  });
@@ -31579,6 +31647,10 @@ var tileLayer = function tileLayer(arg) {
31579
31647
 
31580
31648
  if (this._queue && this._queue._tileLayers && this._queue._tileLayers.indexOf(m_this) >= 0) {
31581
31649
  this._queue._tileLayers.splice(this._queue._tileLayers.indexOf(m_this), 1);
31650
+
31651
+ if (this._queue.initialTrack && this._queue.track && this._queue._tileLayers.length) {
31652
+ this._queue.track = this._queue.initialTrack * this._queue._tileLayers.length;
31653
+ }
31582
31654
  }
31583
31655
 
31584
31656
  return m_this;
@@ -31615,7 +31687,7 @@ tileLayer.defaults = {
31615
31687
  topDown: false,
31616
31688
  keepLower: true,
31617
31689
  idleAfter: 'view',
31618
- // cacheSize: 400, // set depending on keepLower
31690
+ // cacheSize: 600, // set depending on keepLower
31619
31691
  tileRounding: Math.round,
31620
31692
  attribution: '',
31621
31693
  animationDuration: 0
@@ -39274,7 +39346,7 @@ module.exports = vectorFeature;
39274
39346
  * @constant
39275
39347
  * @type {string}
39276
39348
  */
39277
- module.exports = "1.8.3";
39349
+ module.exports = "1.8.4";
39278
39350
 
39279
39351
  /***/ }),
39280
39352
 
package/geo.lean.js CHANGED
@@ -4165,16 +4165,31 @@ var annotationLayer = function annotationLayer(arg) {
4165
4165
  } // make a copy of the position array to avoid mutating the original.
4166
4166
 
4167
4167
 
4168
- position = position.outer.slice();
4168
+ position = {
4169
+ outer: position.outer.slice(),
4170
+ inner: (position.inner || []).map(function (h) {
4171
+ return h.slice();
4172
+ })
4173
+ };
4169
4174
 
4170
- if (position[position.length - 1][0] === position[0][0] && position[position.length - 1][1] === position[0][1]) {
4171
- position.splice(position.length - 1, 1);
4175
+ if (position.outer[position.outer.length - 1][0] === position.outer[0][0] && position.outer[position.outer.length - 1][1] === position.outer[0][1]) {
4176
+ position.outer.splice(position.outer.length - 1, 1);
4172
4177
 
4173
- if (position.length < 3) {
4178
+ if (position.outer.length < 3) {
4174
4179
  return;
4175
4180
  }
4176
4181
  }
4177
4182
 
4183
+ position.inner.forEach(function (h) {
4184
+ if (h.length > 3 && h[h.length - 1][0] === h[0][0] && h[h.length - 1][1] === h[0][1]) {
4185
+ h.splice(h.length - 1, 1);
4186
+ }
4187
+ });
4188
+
4189
+ if (!position.inner || !position.inner.length) {
4190
+ position = position.outer;
4191
+ }
4192
+
4178
4193
  break;
4179
4194
 
4180
4195
  case 'marker':
@@ -4186,16 +4201,20 @@ var annotationLayer = function annotationLayer(arg) {
4186
4201
  break;
4187
4202
  }
4188
4203
 
4189
- for (i = 0; i < position.length; i += 1) {
4190
- position[i] = util.normalizeCoordinates(position[i]);
4191
- }
4192
-
4193
4204
  datagcs = data.crs && data.crs.type === 'name' && data.crs.properties && data.crs.properties.type === 'proj4' && data.crs.properties.name ? data.crs.properties.name : gcs;
4205
+ [position.outer || position].concat(position.inner || []).forEach(function (poslist) {
4206
+ for (i = 0; i < poslist.length; i += 1) {
4207
+ poslist[i] = util.normalizeCoordinates(poslist[i]);
4208
+ }
4194
4209
 
4195
- if (datagcs !== map.gcs()) {
4196
- position = transform.transformCoordinates(datagcs, map.gcs(), position);
4197
- }
4210
+ if (datagcs !== map.gcs()) {
4211
+ var transposlist = transform.transformCoordinates(datagcs, map.gcs(), poslist);
4198
4212
 
4213
+ for (i = 0; i < poslist.length; i += 1) {
4214
+ poslist[i] = transposlist[i];
4215
+ }
4216
+ }
4217
+ });
4199
4218
  options.coordinates = position;
4200
4219
  /* For each style listed in the geojsonStyleProperties object, check if
4201
4220
  * is given under any of the variety of keys as a valid instance of the
@@ -10761,6 +10780,7 @@ var fetchQueue = function fetchQueue(options) {
10761
10780
  this._size = options.size || 6;
10762
10781
  this._initialSize = options.initialSize || 0;
10763
10782
  this._track = options.track || 600;
10783
+ this._initialTrack = this._track;
10764
10784
  this._needed = options.needed || null;
10765
10785
  this._batch = false;
10766
10786
  var m_this = this,
@@ -10801,6 +10821,38 @@ var fetchQueue = function fetchQueue(options) {
10801
10821
  m_this.next_item();
10802
10822
  }
10803
10823
  });
10824
+ /**
10825
+ * Get/set the track size. This is used to determine when to check if
10826
+ * entries can be discarded.
10827
+ * @property {number} track The number of entries to track without checking
10828
+ * for discards.
10829
+ * @name geo.fetchQueue#track
10830
+ */
10831
+
10832
+ Object.defineProperty(this, 'track', {
10833
+ get: function get() {
10834
+ return m_this._track;
10835
+ },
10836
+ set: function set(n) {
10837
+ m_this._track = n;
10838
+ }
10839
+ });
10840
+ /**
10841
+ * Get/set the initial track size. Unless changed, this is the value used
10842
+ * for track on class initialization.
10843
+ * @property {number} initialTrack The number of entries to track without
10844
+ * checking for discards.
10845
+ * @name geo.fetchQueue#intitialTrack
10846
+ */
10847
+
10848
+ Object.defineProperty(this, 'initialTrack', {
10849
+ get: function get() {
10850
+ return m_this._initialTrack;
10851
+ },
10852
+ set: function set(n) {
10853
+ m_this._initialTrack = n;
10854
+ }
10855
+ });
10804
10856
  /**
10805
10857
  * Get the current queue size. Read only.
10806
10858
  * @property {number} length The current queue size.
@@ -10897,7 +10949,7 @@ var fetchQueue = function fetchQueue(options) {
10897
10949
 
10898
10950
  if (atEnd) {
10899
10951
  m_this._queue.push(defer);
10900
- } else if (!this._batch) {
10952
+ } else if (!m_this._batch) {
10901
10953
  m_this._queue.unshift(defer);
10902
10954
  } else {
10903
10955
  for (var i = 0; i < m_this._queue.length; i += 1) {
@@ -26804,7 +26856,7 @@ module.exports = sceneObject;
26804
26856
  * @constant
26805
26857
  * @type {string}
26806
26858
  */
26807
- module.exports = "06c78d577d1a9dd6332ee47b20fe441d239225ca";
26859
+ module.exports = "aa7a52c0facebedfe694ae91d1f9a295ade8765e";
26808
26860
 
26809
26861
  /***/ }),
26810
26862
 
@@ -29647,7 +29699,7 @@ var featureLayer = __webpack_require__(3715);
29647
29699
  * @property {function} [tilesAtZoom=null] A function that is given a zoom
29648
29700
  * level and returns `{x: (num), y: (num)}` with the number of tiles at that
29649
29701
  * zoom level.
29650
- * @property {number} [cacheSize=400] The maximum number of tiles to cache.
29702
+ * @property {number} [cacheSize=600] The maximum number of tiles to cache.
29651
29703
  * The default is 200 if keepLower is false.
29652
29704
  * @property {geo.fetchQueue} [queue] A fetch queue to use. If unspecified, a
29653
29705
  * new queue is created.
@@ -29832,6 +29884,10 @@ var tileLayer = function tileLayer(arg) {
29832
29884
 
29833
29885
  if (!arg.cacheSize) {
29834
29886
  // this size should be sufficient for a 4k display
29887
+ // where display size is (w, h), minimum tile dimension is ts, and total
29888
+ // number of levels is ml, this is roughly
29889
+ // sum([(math.ceil((w**2+h**2)**0.5 / (ts*2**l)) + 1) *
29890
+ // (math.ceil(min(w, h) / (ts*2**l)) + 1) for l in range(ml)])
29835
29891
  arg.cacheSize = arg.keepLower ? 600 : 200;
29836
29892
  }
29837
29893
 
@@ -29909,6 +29965,10 @@ var tileLayer = function tileLayer(arg) {
29909
29965
 
29910
29966
  this._queue._tileLayers.push(m_this);
29911
29967
 
29968
+ if (this._queue.initialTrack && this._queue.track) {
29969
+ this._queue.track = this._queue.initialTrack * this._queue._tileLayers.length;
29970
+ }
29971
+
29912
29972
  var m_tileOffsetValues = {};
29913
29973
  /**
29914
29974
  * Readonly accessor to the options object.
@@ -29965,12 +30025,20 @@ var tileLayer = function tileLayer(arg) {
29965
30025
  if (m_this._queue !== queue) {
29966
30026
  if (this._queue && this._queue._tileLayers && this._queue._tileLayers.indexOf(m_this) >= 0) {
29967
30027
  this._queue._tileLayers.splice(this._queue._tileLayers.indexOf(m_this), 1);
30028
+
30029
+ if (this._queue.initialTrack && this._queue.track && this._queue._tileLayers.length) {
30030
+ this._queue.track = this._queue.initialTrack * this._queue._tileLayers.length;
30031
+ }
29968
30032
  }
29969
30033
 
29970
30034
  m_this._queue = queue;
29971
30035
  m_this._queue._tileLayers = m_this._queue._tileLayers || [];
29972
30036
 
29973
30037
  m_this._queue._tileLayers.push(m_this);
30038
+
30039
+ if (m_this._queue.initialTrack && m_this._queue.track) {
30040
+ m_this._queue.track = m_this._queue.initialTrack * m_this._queue._tileLayers.length;
30041
+ }
29974
30042
  }
29975
30043
  }
29976
30044
  });
@@ -31579,6 +31647,10 @@ var tileLayer = function tileLayer(arg) {
31579
31647
 
31580
31648
  if (this._queue && this._queue._tileLayers && this._queue._tileLayers.indexOf(m_this) >= 0) {
31581
31649
  this._queue._tileLayers.splice(this._queue._tileLayers.indexOf(m_this), 1);
31650
+
31651
+ if (this._queue.initialTrack && this._queue.track && this._queue._tileLayers.length) {
31652
+ this._queue.track = this._queue.initialTrack * this._queue._tileLayers.length;
31653
+ }
31582
31654
  }
31583
31655
 
31584
31656
  return m_this;
@@ -31615,7 +31687,7 @@ tileLayer.defaults = {
31615
31687
  topDown: false,
31616
31688
  keepLower: true,
31617
31689
  idleAfter: 'view',
31618
- // cacheSize: 400, // set depending on keepLower
31690
+ // cacheSize: 600, // set depending on keepLower
31619
31691
  tileRounding: Math.round,
31620
31692
  attribution: '',
31621
31693
  animationDuration: 0
@@ -39274,7 +39346,7 @@ module.exports = vectorFeature;
39274
39346
  * @constant
39275
39347
  * @type {string}
39276
39348
  */
39277
- module.exports = "1.8.3";
39349
+ module.exports = "1.8.4";
39278
39350
 
39279
39351
  /***/ }),
39280
39352