geojs 1.8.6 → 1.8.7
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 +6 -0
- package/geo.js +33 -7
- package/geo.lean.js +33 -7
- package/geo.lean.min.js +1 -1
- package/geo.min.js +1 -1
- package/package.json +1 -1
- package/src/transform.js +15 -0
- package/src/webgl/lineFeature.js +7 -3
- package/src/webgl/polygonFeature.js +11 -8
package/CHANGELOG.md
CHANGED
package/geo.js
CHANGED
|
@@ -27053,7 +27053,7 @@ module.exports = sceneObject;
|
|
|
27053
27053
|
* @constant
|
|
27054
27054
|
* @type {string}
|
|
27055
27055
|
*/
|
|
27056
|
-
module.exports = "
|
|
27056
|
+
module.exports = "493ff30a20fb5c5febb2c3521372398121e0cdee";
|
|
27057
27057
|
|
|
27058
27058
|
/***/ }),
|
|
27059
27059
|
|
|
@@ -33921,6 +33921,22 @@ transform.vincentyDistance = function (pt1, pt2, gcs, baseGcs, ellipsoid, maxIte
|
|
|
33921
33921
|
alpha2: Math.atan2(cosU1 * Math.sin(lambda), -sinU1 * cosU2 + cosU1 * sinU2 * Math.cos(lambda))
|
|
33922
33922
|
};
|
|
33923
33923
|
};
|
|
33924
|
+
/**
|
|
33925
|
+
* Return a boolean indicating if the projections only differ in their y
|
|
33926
|
+
* coordinate.
|
|
33927
|
+
*
|
|
33928
|
+
* @param {string} srcPrj The source projection.
|
|
33929
|
+
* @param {string} tgtPrj The destination projection.
|
|
33930
|
+
* @returns {boolean} truthy if only the y coordinate is different between
|
|
33931
|
+
* projections.
|
|
33932
|
+
*/
|
|
33933
|
+
|
|
33934
|
+
|
|
33935
|
+
transform.onlyInvertedY = function (srcPrj, tgtPrj) {
|
|
33936
|
+
var smatch = srcPrj.match(axisPattern),
|
|
33937
|
+
tmatch = tgtPrj.match(axisPattern);
|
|
33938
|
+
return smatch && tmatch && smatch[1] === tmatch[1] && smatch[3] === tmatch[3];
|
|
33939
|
+
};
|
|
33924
33940
|
/* Expose proj4 to make it easier to debug */
|
|
33925
33941
|
|
|
33926
33942
|
|
|
@@ -39552,7 +39568,7 @@ module.exports = vectorFeature;
|
|
|
39552
39568
|
* @constant
|
|
39553
39569
|
* @type {string}
|
|
39554
39570
|
*/
|
|
39555
|
-
module.exports = "1.8.
|
|
39571
|
+
module.exports = "1.8.7";
|
|
39556
39572
|
|
|
39557
39573
|
/***/ }),
|
|
39558
39574
|
|
|
@@ -40783,6 +40799,9 @@ var webgl_lineFeature = function webgl_lineFeature(arg) {
|
|
|
40783
40799
|
negStrokeOffset: 0
|
|
40784
40800
|
}],
|
|
40785
40801
|
v = vert[1],
|
|
40802
|
+
target_gcs = m_this.gcs(),
|
|
40803
|
+
map_gcs = m_this.layer().map().gcs(),
|
|
40804
|
+
simpleInverse = transform.onlyInvertedY(target_gcs, map_gcs),
|
|
40786
40805
|
pos,
|
|
40787
40806
|
posIdx3,
|
|
40788
40807
|
firstpos,
|
|
@@ -40863,7 +40882,7 @@ var webgl_lineFeature = function webgl_lineFeature(arg) {
|
|
|
40863
40882
|
for (j = 0; j < lineItem.length; j += 1) {
|
|
40864
40883
|
pos = posFunc(lineItem[j], j, d, i);
|
|
40865
40884
|
position.push(pos.x);
|
|
40866
|
-
position.push(pos.y);
|
|
40885
|
+
position.push(simpleInverse ? -pos.y : pos.y);
|
|
40867
40886
|
position.push(pos.z || 0.0);
|
|
40868
40887
|
|
|
40869
40888
|
if (!j) {
|
|
@@ -40886,7 +40905,10 @@ var webgl_lineFeature = function webgl_lineFeature(arg) {
|
|
|
40886
40905
|
}
|
|
40887
40906
|
}
|
|
40888
40907
|
|
|
40889
|
-
|
|
40908
|
+
if (!simpleInverse) {
|
|
40909
|
+
position = transform.transformCoordinates(target_gcs, map_gcs, position, 3);
|
|
40910
|
+
}
|
|
40911
|
+
|
|
40890
40912
|
m_origin = new Float32Array(m_this.style.get('origin')(position));
|
|
40891
40913
|
|
|
40892
40914
|
if (m_origin[0] || m_origin[1] || m_origin[2]) {
|
|
@@ -43410,6 +43432,7 @@ var webgl_polygonFeature = function webgl_polygonFeature(arg) {
|
|
|
43410
43432
|
items = [],
|
|
43411
43433
|
target_gcs = m_this.gcs(),
|
|
43412
43434
|
map_gcs = m_this.layer().map().gcs(),
|
|
43435
|
+
simpleInverse = transform.onlyInvertedY(target_gcs, map_gcs),
|
|
43413
43436
|
numPts = 0,
|
|
43414
43437
|
geom = m_mapper.geometryData(),
|
|
43415
43438
|
color,
|
|
@@ -43460,7 +43483,7 @@ var webgl_polygonFeature = function webgl_polygonFeature(arg) {
|
|
|
43460
43483
|
for (i = d3 = 0; i < outer.length; i += 1, d3 += 3) {
|
|
43461
43484
|
c = posFunc(outer[i], i, item, itemIndex);
|
|
43462
43485
|
geometry[d3] = c.x;
|
|
43463
|
-
geometry[d3 + 1] = c.y; // ignore the z values until we support them
|
|
43486
|
+
geometry[d3 + 1] = simpleInverse ? -c.y : c.y; // ignore the z values until we support them
|
|
43464
43487
|
|
|
43465
43488
|
geometry[d3 + 2] = 0; // c.z || 0;
|
|
43466
43489
|
}
|
|
@@ -43484,7 +43507,7 @@ var webgl_polygonFeature = function webgl_polygonFeature(arg) {
|
|
|
43484
43507
|
for (i = 0; i < hole.length; i += 1, d3 += 3) {
|
|
43485
43508
|
c = posFunc(hole[i], i, item, itemIndex);
|
|
43486
43509
|
geometry.vertices[d3] = c.x;
|
|
43487
|
-
geometry.vertices[d3 + 1] = c.y; // ignore the z values until we support them
|
|
43510
|
+
geometry.vertices[d3 + 1] = simpleInverse ? -c.y : c.y; // ignore the z values until we support them
|
|
43488
43511
|
|
|
43489
43512
|
geometry.vertices[d3 + 2] = 0; // c.z || 0;
|
|
43490
43513
|
}
|
|
@@ -43492,7 +43515,10 @@ var webgl_polygonFeature = function webgl_polygonFeature(arg) {
|
|
|
43492
43515
|
} // transform to map gcs
|
|
43493
43516
|
|
|
43494
43517
|
|
|
43495
|
-
|
|
43518
|
+
if (!simpleInverse) {
|
|
43519
|
+
geometry.vertices = transform.transformCoordinates(target_gcs, map_gcs, geometry.vertices, geometry.dimensions);
|
|
43520
|
+
}
|
|
43521
|
+
|
|
43496
43522
|
record = {
|
|
43497
43523
|
// triangulate
|
|
43498
43524
|
triangles: earcut(geometry.vertices, geometry.holes, geometry.dimensions),
|
package/geo.lean.js
CHANGED
|
@@ -27053,7 +27053,7 @@ module.exports = sceneObject;
|
|
|
27053
27053
|
* @constant
|
|
27054
27054
|
* @type {string}
|
|
27055
27055
|
*/
|
|
27056
|
-
module.exports = "
|
|
27056
|
+
module.exports = "493ff30a20fb5c5febb2c3521372398121e0cdee";
|
|
27057
27057
|
|
|
27058
27058
|
/***/ }),
|
|
27059
27059
|
|
|
@@ -33921,6 +33921,22 @@ transform.vincentyDistance = function (pt1, pt2, gcs, baseGcs, ellipsoid, maxIte
|
|
|
33921
33921
|
alpha2: Math.atan2(cosU1 * Math.sin(lambda), -sinU1 * cosU2 + cosU1 * sinU2 * Math.cos(lambda))
|
|
33922
33922
|
};
|
|
33923
33923
|
};
|
|
33924
|
+
/**
|
|
33925
|
+
* Return a boolean indicating if the projections only differ in their y
|
|
33926
|
+
* coordinate.
|
|
33927
|
+
*
|
|
33928
|
+
* @param {string} srcPrj The source projection.
|
|
33929
|
+
* @param {string} tgtPrj The destination projection.
|
|
33930
|
+
* @returns {boolean} truthy if only the y coordinate is different between
|
|
33931
|
+
* projections.
|
|
33932
|
+
*/
|
|
33933
|
+
|
|
33934
|
+
|
|
33935
|
+
transform.onlyInvertedY = function (srcPrj, tgtPrj) {
|
|
33936
|
+
var smatch = srcPrj.match(axisPattern),
|
|
33937
|
+
tmatch = tgtPrj.match(axisPattern);
|
|
33938
|
+
return smatch && tmatch && smatch[1] === tmatch[1] && smatch[3] === tmatch[3];
|
|
33939
|
+
};
|
|
33924
33940
|
/* Expose proj4 to make it easier to debug */
|
|
33925
33941
|
|
|
33926
33942
|
|
|
@@ -39552,7 +39568,7 @@ module.exports = vectorFeature;
|
|
|
39552
39568
|
* @constant
|
|
39553
39569
|
* @type {string}
|
|
39554
39570
|
*/
|
|
39555
|
-
module.exports = "1.8.
|
|
39571
|
+
module.exports = "1.8.7";
|
|
39556
39572
|
|
|
39557
39573
|
/***/ }),
|
|
39558
39574
|
|
|
@@ -40783,6 +40799,9 @@ var webgl_lineFeature = function webgl_lineFeature(arg) {
|
|
|
40783
40799
|
negStrokeOffset: 0
|
|
40784
40800
|
}],
|
|
40785
40801
|
v = vert[1],
|
|
40802
|
+
target_gcs = m_this.gcs(),
|
|
40803
|
+
map_gcs = m_this.layer().map().gcs(),
|
|
40804
|
+
simpleInverse = transform.onlyInvertedY(target_gcs, map_gcs),
|
|
40786
40805
|
pos,
|
|
40787
40806
|
posIdx3,
|
|
40788
40807
|
firstpos,
|
|
@@ -40863,7 +40882,7 @@ var webgl_lineFeature = function webgl_lineFeature(arg) {
|
|
|
40863
40882
|
for (j = 0; j < lineItem.length; j += 1) {
|
|
40864
40883
|
pos = posFunc(lineItem[j], j, d, i);
|
|
40865
40884
|
position.push(pos.x);
|
|
40866
|
-
position.push(pos.y);
|
|
40885
|
+
position.push(simpleInverse ? -pos.y : pos.y);
|
|
40867
40886
|
position.push(pos.z || 0.0);
|
|
40868
40887
|
|
|
40869
40888
|
if (!j) {
|
|
@@ -40886,7 +40905,10 @@ var webgl_lineFeature = function webgl_lineFeature(arg) {
|
|
|
40886
40905
|
}
|
|
40887
40906
|
}
|
|
40888
40907
|
|
|
40889
|
-
|
|
40908
|
+
if (!simpleInverse) {
|
|
40909
|
+
position = transform.transformCoordinates(target_gcs, map_gcs, position, 3);
|
|
40910
|
+
}
|
|
40911
|
+
|
|
40890
40912
|
m_origin = new Float32Array(m_this.style.get('origin')(position));
|
|
40891
40913
|
|
|
40892
40914
|
if (m_origin[0] || m_origin[1] || m_origin[2]) {
|
|
@@ -43410,6 +43432,7 @@ var webgl_polygonFeature = function webgl_polygonFeature(arg) {
|
|
|
43410
43432
|
items = [],
|
|
43411
43433
|
target_gcs = m_this.gcs(),
|
|
43412
43434
|
map_gcs = m_this.layer().map().gcs(),
|
|
43435
|
+
simpleInverse = transform.onlyInvertedY(target_gcs, map_gcs),
|
|
43413
43436
|
numPts = 0,
|
|
43414
43437
|
geom = m_mapper.geometryData(),
|
|
43415
43438
|
color,
|
|
@@ -43460,7 +43483,7 @@ var webgl_polygonFeature = function webgl_polygonFeature(arg) {
|
|
|
43460
43483
|
for (i = d3 = 0; i < outer.length; i += 1, d3 += 3) {
|
|
43461
43484
|
c = posFunc(outer[i], i, item, itemIndex);
|
|
43462
43485
|
geometry[d3] = c.x;
|
|
43463
|
-
geometry[d3 + 1] = c.y; // ignore the z values until we support them
|
|
43486
|
+
geometry[d3 + 1] = simpleInverse ? -c.y : c.y; // ignore the z values until we support them
|
|
43464
43487
|
|
|
43465
43488
|
geometry[d3 + 2] = 0; // c.z || 0;
|
|
43466
43489
|
}
|
|
@@ -43484,7 +43507,7 @@ var webgl_polygonFeature = function webgl_polygonFeature(arg) {
|
|
|
43484
43507
|
for (i = 0; i < hole.length; i += 1, d3 += 3) {
|
|
43485
43508
|
c = posFunc(hole[i], i, item, itemIndex);
|
|
43486
43509
|
geometry.vertices[d3] = c.x;
|
|
43487
|
-
geometry.vertices[d3 + 1] = c.y; // ignore the z values until we support them
|
|
43510
|
+
geometry.vertices[d3 + 1] = simpleInverse ? -c.y : c.y; // ignore the z values until we support them
|
|
43488
43511
|
|
|
43489
43512
|
geometry.vertices[d3 + 2] = 0; // c.z || 0;
|
|
43490
43513
|
}
|
|
@@ -43492,7 +43515,10 @@ var webgl_polygonFeature = function webgl_polygonFeature(arg) {
|
|
|
43492
43515
|
} // transform to map gcs
|
|
43493
43516
|
|
|
43494
43517
|
|
|
43495
|
-
|
|
43518
|
+
if (!simpleInverse) {
|
|
43519
|
+
geometry.vertices = transform.transformCoordinates(target_gcs, map_gcs, geometry.vertices, geometry.dimensions);
|
|
43520
|
+
}
|
|
43521
|
+
|
|
43496
43522
|
record = {
|
|
43497
43523
|
// triangulate
|
|
43498
43524
|
triangles: earcut(geometry.vertices, geometry.holes, geometry.dimensions),
|