geojs 1.12.10 → 1.13.0

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/geo.js CHANGED
@@ -19222,6 +19222,34 @@ var _map2 = function map(arg) {
19222
19222
  return m_this;
19223
19223
  };
19224
19224
 
19225
+ /**
19226
+ * Get the corners of the map. Since the map can be rotated, this is
19227
+ * necessarily not the same as the overall bounds, which is the orthogonal
19228
+ * bounding box.
19229
+ *
19230
+ * @param {string|geo.transform|null} [gcs] `undefined` to use the interface
19231
+ * gcs, `null` to use the map gcs, or any other transform. If setting the
19232
+ * bounds, they are converted from this gcs to the map projection. The
19233
+ * returned bounds are converted from the map projection to this gcs.
19234
+ * @returns {geo.geoPosition[]} The corners of the map in the order
19235
+ * upper-left, upper-right, lower-right, lower-left.
19236
+ */
19237
+ this.corners = function (gcs) {
19238
+ return [m_this.displayToGcs({
19239
+ x: 0,
19240
+ y: 0
19241
+ }, gcs), m_this.displayToGcs({
19242
+ x: m_width,
19243
+ y: 0
19244
+ }, gcs), m_this.displayToGcs({
19245
+ x: m_width,
19246
+ y: m_height
19247
+ }, gcs), m_this.displayToGcs({
19248
+ x: 0,
19249
+ y: m_height
19250
+ }, gcs)];
19251
+ };
19252
+
19225
19253
  /**
19226
19254
  * Get the center zoom level necessary to display the given bounds.
19227
19255
  *
@@ -22781,9 +22809,7 @@ var _markerFeature = function markerFeature(arg) {
22781
22809
 
22782
22810
  // Find markers inside the bounding box
22783
22811
  idx = m_rangeTree.range(min.x, min.y, max.x, max.y);
22784
- idx.sort(function (a, b) {
22785
- return a - b;
22786
- });
22812
+ idx = Uint32Array.from(idx).sort();
22787
22813
  // Filter by circular region
22788
22814
  idx.forEach(function (i) {
22789
22815
  var d = data[i],
@@ -22940,18 +22966,20 @@ var _markerFeature = function markerFeature(arg) {
22940
22966
  };
22941
22967
  // Find markers inside the bounding box. Only these could be in the polygon
22942
22968
  idx = m_rangeTree.range(min.x, min.y, max.x, max.y);
22943
- // sort by index
22944
- idx.sort(function (a, b) {
22945
- return a - b;
22946
- });
22969
+ /* sort by index. This had been
22970
+ * idx.sort((a, b) => a - b);
22971
+ * but this requires continual casting from int to str and back, so using
22972
+ * a Uint32Array is faster, though potentially limits the maximum number of
22973
+ * markers. */
22974
+ idx = Uint32Array.from(idx).sort();
22947
22975
  // filter markers within the polygon
22948
22976
  idx.forEach(function (i) {
22949
22977
  var d = data[i];
22950
22978
  var p = m_this.position()(d, i);
22951
- var rad = radius(data[i], i),
22952
- swz = scaleWithZoom(data[i], i);
22953
- var so = strokeOffset(data[i], i),
22954
- s = swz ? strokeWidth(data[i], i) : 0;
22979
+ var rad = radius(d, i),
22980
+ swz = scaleWithZoom(d, i);
22981
+ var so = strokeOffset(d, i),
22982
+ s = swz ? strokeWidth(d, i) : 0;
22955
22983
  var ris = radiusIncludesStroke(d, i);
22956
22984
  ris = ris === undefined ? true : ris;
22957
22985
  var rwos = ris ? rad + s * (so - 1) / 2 : rad; // radius without stroke
@@ -25233,9 +25261,7 @@ var _pointFeature = function pointFeature(arg) {
25233
25261
 
25234
25262
  // Find points inside the bounding box
25235
25263
  idx = m_rangeTree.range(min.x, min.y, max.x, max.y);
25236
- idx.sort(function (a, b) {
25237
- return a - b;
25238
- });
25264
+ idx = Uint32Array.from(idx).sort();
25239
25265
  // Filter by circular region
25240
25266
  idx.forEach(function (i) {
25241
25267
  var d = data[i],
@@ -25375,9 +25401,7 @@ var _pointFeature = function pointFeature(arg) {
25375
25401
  // Find points inside the bounding box. Only these could be in the polygon
25376
25402
  idx = m_rangeTree.range(min.x, min.y, max.x, max.y);
25377
25403
  // sort by index
25378
- idx.sort(function (a, b) {
25379
- return a - b;
25380
- });
25404
+ idx = Uint32Array.from(idx).sort();
25381
25405
  // filter points within the polygon
25382
25406
  idx.forEach(function (i) {
25383
25407
  var d = data[i],
@@ -28099,7 +28123,7 @@ module.exports = _sceneObject;
28099
28123
  * @constant
28100
28124
  * @type {string}
28101
28125
  */
28102
- module.exports = "4353a25de740301aeb481c62d29e493abbbe7b9e";
28126
+ module.exports = "d7faab33bc71a282eea9deea55df6937d29c5300";
28103
28127
 
28104
28128
  /***/ }),
28105
28129
 
@@ -33773,13 +33797,13 @@ _transform.lookup = function (projection) {
33773
33797
  }
33774
33798
  code = parts[1];
33775
33799
  return $.ajax({
33776
- url: 'https://epsg.io/?q=' + code + '&format=json'
33800
+ url: 'https://epsg.io/' + encodeURIComponent(code) + '.proj4'
33777
33801
  }).done(function (data) {
33778
33802
  var result = (data.results || [])[0];
33779
- if (!result || !result.proj4) {
33803
+ if (!result) {
33780
33804
  return defer.reject(data).promise();
33781
33805
  }
33782
- proj4.defs(projection, result.proj4);
33806
+ proj4.defs(projection, result);
33783
33807
  return $.when(proj4.defs[projection]);
33784
33808
  });
33785
33809
  };
@@ -39972,7 +39996,7 @@ module.exports = _vectorFeature;
39972
39996
  * @constant
39973
39997
  * @type {string}
39974
39998
  */
39975
- module.exports = "1.12.10";
39999
+ module.exports = "1.13.0";
39976
40000
 
39977
40001
  /***/ }),
39978
40002
 
package/geo.lean.js CHANGED
@@ -16221,6 +16221,34 @@ var _map2 = function map(arg) {
16221
16221
  return m_this;
16222
16222
  };
16223
16223
 
16224
+ /**
16225
+ * Get the corners of the map. Since the map can be rotated, this is
16226
+ * necessarily not the same as the overall bounds, which is the orthogonal
16227
+ * bounding box.
16228
+ *
16229
+ * @param {string|geo.transform|null} [gcs] `undefined` to use the interface
16230
+ * gcs, `null` to use the map gcs, or any other transform. If setting the
16231
+ * bounds, they are converted from this gcs to the map projection. The
16232
+ * returned bounds are converted from the map projection to this gcs.
16233
+ * @returns {geo.geoPosition[]} The corners of the map in the order
16234
+ * upper-left, upper-right, lower-right, lower-left.
16235
+ */
16236
+ this.corners = function (gcs) {
16237
+ return [m_this.displayToGcs({
16238
+ x: 0,
16239
+ y: 0
16240
+ }, gcs), m_this.displayToGcs({
16241
+ x: m_width,
16242
+ y: 0
16243
+ }, gcs), m_this.displayToGcs({
16244
+ x: m_width,
16245
+ y: m_height
16246
+ }, gcs), m_this.displayToGcs({
16247
+ x: 0,
16248
+ y: m_height
16249
+ }, gcs)];
16250
+ };
16251
+
16224
16252
  /**
16225
16253
  * Get the center zoom level necessary to display the given bounds.
16226
16254
  *
@@ -19780,9 +19808,7 @@ var _markerFeature = function markerFeature(arg) {
19780
19808
 
19781
19809
  // Find markers inside the bounding box
19782
19810
  idx = m_rangeTree.range(min.x, min.y, max.x, max.y);
19783
- idx.sort(function (a, b) {
19784
- return a - b;
19785
- });
19811
+ idx = Uint32Array.from(idx).sort();
19786
19812
  // Filter by circular region
19787
19813
  idx.forEach(function (i) {
19788
19814
  var d = data[i],
@@ -19939,18 +19965,20 @@ var _markerFeature = function markerFeature(arg) {
19939
19965
  };
19940
19966
  // Find markers inside the bounding box. Only these could be in the polygon
19941
19967
  idx = m_rangeTree.range(min.x, min.y, max.x, max.y);
19942
- // sort by index
19943
- idx.sort(function (a, b) {
19944
- return a - b;
19945
- });
19968
+ /* sort by index. This had been
19969
+ * idx.sort((a, b) => a - b);
19970
+ * but this requires continual casting from int to str and back, so using
19971
+ * a Uint32Array is faster, though potentially limits the maximum number of
19972
+ * markers. */
19973
+ idx = Uint32Array.from(idx).sort();
19946
19974
  // filter markers within the polygon
19947
19975
  idx.forEach(function (i) {
19948
19976
  var d = data[i];
19949
19977
  var p = m_this.position()(d, i);
19950
- var rad = radius(data[i], i),
19951
- swz = scaleWithZoom(data[i], i);
19952
- var so = strokeOffset(data[i], i),
19953
- s = swz ? strokeWidth(data[i], i) : 0;
19978
+ var rad = radius(d, i),
19979
+ swz = scaleWithZoom(d, i);
19980
+ var so = strokeOffset(d, i),
19981
+ s = swz ? strokeWidth(d, i) : 0;
19954
19982
  var ris = radiusIncludesStroke(d, i);
19955
19983
  ris = ris === undefined ? true : ris;
19956
19984
  var rwos = ris ? rad + s * (so - 1) / 2 : rad; // radius without stroke
@@ -22232,9 +22260,7 @@ var _pointFeature = function pointFeature(arg) {
22232
22260
 
22233
22261
  // Find points inside the bounding box
22234
22262
  idx = m_rangeTree.range(min.x, min.y, max.x, max.y);
22235
- idx.sort(function (a, b) {
22236
- return a - b;
22237
- });
22263
+ idx = Uint32Array.from(idx).sort();
22238
22264
  // Filter by circular region
22239
22265
  idx.forEach(function (i) {
22240
22266
  var d = data[i],
@@ -22374,9 +22400,7 @@ var _pointFeature = function pointFeature(arg) {
22374
22400
  // Find points inside the bounding box. Only these could be in the polygon
22375
22401
  idx = m_rangeTree.range(min.x, min.y, max.x, max.y);
22376
22402
  // sort by index
22377
- idx.sort(function (a, b) {
22378
- return a - b;
22379
- });
22403
+ idx = Uint32Array.from(idx).sort();
22380
22404
  // filter points within the polygon
22381
22405
  idx.forEach(function (i) {
22382
22406
  var d = data[i],
@@ -25098,7 +25122,7 @@ module.exports = _sceneObject;
25098
25122
  * @constant
25099
25123
  * @type {string}
25100
25124
  */
25101
- module.exports = "4353a25de740301aeb481c62d29e493abbbe7b9e";
25125
+ module.exports = "d7faab33bc71a282eea9deea55df6937d29c5300";
25102
25126
 
25103
25127
  /***/ }),
25104
25128
 
@@ -30772,13 +30796,13 @@ _transform.lookup = function (projection) {
30772
30796
  }
30773
30797
  code = parts[1];
30774
30798
  return $.ajax({
30775
- url: 'https://epsg.io/?q=' + code + '&format=json'
30799
+ url: 'https://epsg.io/' + encodeURIComponent(code) + '.proj4'
30776
30800
  }).done(function (data) {
30777
30801
  var result = (data.results || [])[0];
30778
- if (!result || !result.proj4) {
30802
+ if (!result) {
30779
30803
  return defer.reject(data).promise();
30780
30804
  }
30781
- proj4.defs(projection, result.proj4);
30805
+ proj4.defs(projection, result);
30782
30806
  return $.when(proj4.defs[projection]);
30783
30807
  });
30784
30808
  };
@@ -36971,7 +36995,7 @@ module.exports = _vectorFeature;
36971
36995
  * @constant
36972
36996
  * @type {string}
36973
36997
  */
36974
- module.exports = "1.12.10";
36998
+ module.exports = "1.13.0";
36975
36999
 
36976
37000
  /***/ }),
36977
37001