bruce-models 4.2.3 → 4.2.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/dist/bruce-models.es5.js +51 -34
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +51 -34
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/api/api-getters.js +2 -7
- package/dist/lib/api/api-getters.js.map +1 -1
- package/dist/lib/api/bruce-api.js +11 -8
- package/dist/lib/api/bruce-api.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/common/bounds.js +28 -10
- package/dist/lib/common/bounds.js.map +1 -1
- package/dist/lib/entity/entity.js +7 -7
- package/dist/lib/entity/entity.js.map +1 -1
- package/dist/lib/tileset/tileset.js +3 -1
- package/dist/lib/tileset/tileset.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -1430,8 +1430,8 @@
|
|
|
1430
1430
|
env: this.env
|
|
1431
1431
|
});
|
|
1432
1432
|
}
|
|
1433
|
-
const { account } = yield exports.Account.
|
|
1434
|
-
|
|
1433
|
+
const { account } = yield exports.Account.GetBySubdomain({
|
|
1434
|
+
subdomain: this.accountId,
|
|
1435
1435
|
api: guardian
|
|
1436
1436
|
});
|
|
1437
1437
|
// Precalculated URLs exist.
|
|
@@ -1575,13 +1575,16 @@
|
|
|
1575
1575
|
if (!this.cdnBaseUrl) {
|
|
1576
1576
|
return null;
|
|
1577
1577
|
}
|
|
1578
|
-
|
|
1579
|
-
if (
|
|
1580
|
-
urlParams
|
|
1578
|
+
const tmp = new URL(this.cdnBaseUrl);
|
|
1579
|
+
if (urlParams && urlParams instanceof URLSearchParams) {
|
|
1580
|
+
urlParams.forEach((value, key) => {
|
|
1581
|
+
tmp.searchParams.append(key, value);
|
|
1582
|
+
});
|
|
1581
1583
|
}
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1584
|
+
if (url) {
|
|
1585
|
+
tmp.pathname += url;
|
|
1586
|
+
}
|
|
1587
|
+
return tmp.toString();
|
|
1585
1588
|
}
|
|
1586
1589
|
/**
|
|
1587
1590
|
* Warning: This will cancel the init process.
|
|
@@ -1912,9 +1915,7 @@
|
|
|
1912
1915
|
this.bruce[key] = new exports.BruceApi.Api({
|
|
1913
1916
|
accountId,
|
|
1914
1917
|
env,
|
|
1915
|
-
|
|
1916
|
-
// We'll also load if it no default is known.
|
|
1917
|
-
loadConfig: loadConfig != null ? loadConfig : (this.accountId == accountId || !this.accountId),
|
|
1918
|
+
loadConfig: loadConfig != null ? true : loadConfig,
|
|
1918
1919
|
loadWebSocket: loadWebSocket,
|
|
1919
1920
|
guardian: this.GetGuardianApi({
|
|
1920
1921
|
env
|
|
@@ -1937,10 +1938,7 @@
|
|
|
1937
1938
|
getApi: (accountId, env) => {
|
|
1938
1939
|
return this.GetBruceApi({
|
|
1939
1940
|
accountId,
|
|
1940
|
-
env
|
|
1941
|
-
// We'll load regional config if the accountId matches the default accountId.
|
|
1942
|
-
// We'll also load if it no default is known.
|
|
1943
|
-
loadConfig: this.accountId == accountId || !this.accountId
|
|
1941
|
+
env
|
|
1944
1942
|
});
|
|
1945
1943
|
}
|
|
1946
1944
|
};
|
|
@@ -3789,18 +3787,18 @@
|
|
|
3789
3787
|
}
|
|
3790
3788
|
let totalCount;
|
|
3791
3789
|
let entities = [];
|
|
3792
|
-
if (analysis || expandRelations || (viaCdn && api.
|
|
3790
|
+
if (analysis || expandRelations || (viaCdn && api.GetCdnBaseUrl())) {
|
|
3793
3791
|
let url;
|
|
3794
3792
|
if (analysis) {
|
|
3795
3793
|
url = new URL(api.GetBaseUrl() + "entities/summary");
|
|
3796
3794
|
}
|
|
3797
|
-
else if (viaCdn && api.
|
|
3798
|
-
url = new URL(api.
|
|
3795
|
+
else if (viaCdn && api.GetCdnBaseUrl()) {
|
|
3796
|
+
url = new URL(api.ConstructCdnUrl("entities"));
|
|
3799
3797
|
}
|
|
3800
3798
|
else {
|
|
3801
3799
|
url = new URL(api.GetBaseUrl() + "entities");
|
|
3802
3800
|
}
|
|
3803
|
-
const urlParams =
|
|
3801
|
+
const urlParams = url.searchParams;
|
|
3804
3802
|
urlParams.set("cacheToken", String(viaCdnCacheToken ? viaCdnCacheToken : 0));
|
|
3805
3803
|
if (body.SortOrder) {
|
|
3806
3804
|
urlParams.set("SortOrder", body.SortOrder);
|
|
@@ -3847,7 +3845,7 @@
|
|
|
3847
3845
|
if (schemaId) {
|
|
3848
3846
|
urlParams.set("schema", schemaId);
|
|
3849
3847
|
}
|
|
3850
|
-
const urlStr = url.toString()
|
|
3848
|
+
const urlStr = url.toString();
|
|
3851
3849
|
const data = yield api.get(urlStr, exports.Api.PrepReqParams(reqParams));
|
|
3852
3850
|
if (!analysis) {
|
|
3853
3851
|
entities = data.Items;
|
|
@@ -3856,7 +3854,7 @@
|
|
|
3856
3854
|
}
|
|
3857
3855
|
else {
|
|
3858
3856
|
const url = new URL(api.GetBaseUrl() + (analysis ? "entities/summary" : "entities"));
|
|
3859
|
-
const urlParams =
|
|
3857
|
+
const urlParams = url.searchParams;
|
|
3860
3858
|
if (expandRelations) {
|
|
3861
3859
|
urlParams.append("$expand", "relation");
|
|
3862
3860
|
}
|
|
@@ -3866,7 +3864,7 @@
|
|
|
3866
3864
|
if (schemaId) {
|
|
3867
3865
|
urlParams.set("schema", schemaId);
|
|
3868
3866
|
}
|
|
3869
|
-
const urlStr = url.toString()
|
|
3867
|
+
const urlStr = url.toString();
|
|
3870
3868
|
const data = yield api.post(urlStr, body, exports.Api.PrepReqParams(reqParams));
|
|
3871
3869
|
if (!analysis) {
|
|
3872
3870
|
entities = data.Items;
|
|
@@ -4600,22 +4598,39 @@
|
|
|
4600
4598
|
minLongitude: null
|
|
4601
4599
|
};
|
|
4602
4600
|
const points = [];
|
|
4603
|
-
|
|
4604
|
-
|
|
4601
|
+
const location = exports.Entity.GetValue({
|
|
4602
|
+
entity: entity,
|
|
4603
|
+
path: ["location"]
|
|
4604
|
+
});
|
|
4605
|
+
if (location) {
|
|
4606
|
+
points.push(location);
|
|
4605
4607
|
}
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4608
|
+
const geometry = exports.Entity.GetValue({
|
|
4609
|
+
entity: entity,
|
|
4610
|
+
path: ["geometry"]
|
|
4611
|
+
});
|
|
4612
|
+
const processGeometry = (geometry, depth = 0) => {
|
|
4613
|
+
if (!geometry || depth > 5) {
|
|
4614
|
+
return;
|
|
4609
4615
|
}
|
|
4610
|
-
if (
|
|
4611
|
-
points.push(...exports.Geometry.ParsePoints(
|
|
4616
|
+
if (geometry.Point) {
|
|
4617
|
+
points.push(...exports.Geometry.ParsePoints(geometry.Point));
|
|
4612
4618
|
}
|
|
4613
|
-
if (
|
|
4614
|
-
|
|
4619
|
+
if (geometry.LineString) {
|
|
4620
|
+
points.push(...exports.Geometry.ParsePoints(geometry.LineString));
|
|
4621
|
+
}
|
|
4622
|
+
if (geometry.Polygon) {
|
|
4623
|
+
for (const ring of geometry.Polygon) {
|
|
4615
4624
|
points.push(...exports.Geometry.ParsePoints(ring.LinearRing));
|
|
4616
4625
|
}
|
|
4617
4626
|
}
|
|
4618
|
-
|
|
4627
|
+
if (geometry.MultiGeometry) {
|
|
4628
|
+
for (const multiGeometry of geometry.MultiGeometry) {
|
|
4629
|
+
processGeometry(multiGeometry, depth + 1);
|
|
4630
|
+
}
|
|
4631
|
+
}
|
|
4632
|
+
};
|
|
4633
|
+
processGeometry(geometry);
|
|
4619
4634
|
for (const point of points) {
|
|
4620
4635
|
if (bounds.maxLatitude == null || point.latitude > bounds.maxLatitude) {
|
|
4621
4636
|
bounds.maxLatitude = point.latitude;
|
|
@@ -9083,7 +9098,9 @@
|
|
|
9083
9098
|
if (!viaCdnCacheToken) {
|
|
9084
9099
|
viaCdnCacheToken = 0;
|
|
9085
9100
|
}
|
|
9086
|
-
|
|
9101
|
+
const urlParams = new URLSearchParams();
|
|
9102
|
+
urlParams.append("cacheToken", String(viaCdnCacheToken));
|
|
9103
|
+
return api.ConstructCdnUrl(`tileset/file/${tilesetId}/${file}`, urlParams);
|
|
9087
9104
|
}
|
|
9088
9105
|
return api.GetBaseUrl() + `tileset/file/${tilesetId}/${file}`;
|
|
9089
9106
|
}
|
|
@@ -12959,7 +12976,7 @@
|
|
|
12959
12976
|
})(exports.DataSource || (exports.DataSource = {}));
|
|
12960
12977
|
|
|
12961
12978
|
// This is updated with the package.json version on build.
|
|
12962
|
-
const VERSION = "4.2.
|
|
12979
|
+
const VERSION = "4.2.5";
|
|
12963
12980
|
|
|
12964
12981
|
exports.VERSION = VERSION;
|
|
12965
12982
|
exports.AbstractApi = AbstractApi;
|