bruce-models 5.6.9 → 5.7.1
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 +68 -16
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +68 -16
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/api/abstract-api.js +17 -26
- package/dist/lib/api/abstract-api.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/project/project-view-tile.js +15 -15
- package/dist/lib/project/project-view-tile.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/package.json +1 -1
package/dist/bruce-models.es5.js
CHANGED
|
@@ -561,6 +561,12 @@ class AbstractApi {
|
|
|
561
561
|
formData.append(key, params.formData[key]);
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
|
+
/**
|
|
565
|
+
* If we support the legacy request and need it for progress, then we diverge there.
|
|
566
|
+
*/
|
|
567
|
+
if (window && window["XMLHttpRequest"] && params.onProgress) {
|
|
568
|
+
return legacyUpload(url, params.headers, formData, params.onProgress, params.abortSignal);
|
|
569
|
+
}
|
|
564
570
|
const res = yield fetch(url, {
|
|
565
571
|
headers: params.headers,
|
|
566
572
|
method: "POST",
|
|
@@ -571,6 +577,52 @@ class AbstractApi {
|
|
|
571
577
|
});
|
|
572
578
|
}
|
|
573
579
|
}
|
|
580
|
+
/**
|
|
581
|
+
* Performs a legacy upload with XMLHttpRequest.
|
|
582
|
+
* Unfortunately, this is needed to track progress when it's supported.
|
|
583
|
+
* Fetch doesn't have this capability.
|
|
584
|
+
* @param url
|
|
585
|
+
* @param params
|
|
586
|
+
*/
|
|
587
|
+
function legacyUpload(url, headers, formData, onProgress, abortSignal) {
|
|
588
|
+
return new Promise((resolve, reject) => {
|
|
589
|
+
const xhr = new window["XMLHttpRequest"]();
|
|
590
|
+
xhr.open("POST", url, true);
|
|
591
|
+
// Set custom headers.
|
|
592
|
+
if (headers) {
|
|
593
|
+
Object.keys(headers).forEach((key) => {
|
|
594
|
+
let value = headers[key];
|
|
595
|
+
if (!value) {
|
|
596
|
+
value = "";
|
|
597
|
+
}
|
|
598
|
+
xhr.setRequestHeader(key, value);
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
// Progress event.
|
|
602
|
+
xhr.upload.onprogress = (event) => {
|
|
603
|
+
if (onProgress && event.lengthComputable) {
|
|
604
|
+
onProgress(event);
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
// Success and error handling.
|
|
608
|
+
xhr.onload = () => {
|
|
609
|
+
if (xhr.status >= 200 && xhr.status < 300) {
|
|
610
|
+
resolve(JSON.parse(xhr.responseText));
|
|
611
|
+
}
|
|
612
|
+
else {
|
|
613
|
+
reject(new Error(`Failed to upload: ${xhr.status} ${xhr.statusText}`));
|
|
614
|
+
}
|
|
615
|
+
};
|
|
616
|
+
xhr.onerror = () => reject(new Error("Network error occurred during file upload."));
|
|
617
|
+
if (abortSignal) {
|
|
618
|
+
abortSignal.addEventListener("abort", () => {
|
|
619
|
+
xhr.abort();
|
|
620
|
+
reject(new Error("Upload aborted."));
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
xhr.send(formData);
|
|
624
|
+
});
|
|
625
|
+
}
|
|
574
626
|
|
|
575
627
|
/**
|
|
576
628
|
* TODO: rewrite.
|
|
@@ -10662,67 +10714,67 @@ var ProjectViewTile;
|
|
|
10662
10714
|
{
|
|
10663
10715
|
id: EDefaultImagery.BingMapsAerial,
|
|
10664
10716
|
name: "Bing Maps Aerial",
|
|
10665
|
-
iconUrl: "https://template.
|
|
10717
|
+
iconUrl: "https://template.api.nextspace-uat-aus.net/file/3974f74e-f65e-41cb-9980-d004d2a4eac1?cc=1"
|
|
10666
10718
|
},
|
|
10667
10719
|
{
|
|
10668
10720
|
id: EDefaultImagery.BingMapsAerialWithLabels,
|
|
10669
10721
|
name: "Bing Maps Aerial with Labels",
|
|
10670
|
-
iconUrl: "https://template.
|
|
10722
|
+
iconUrl: "https://template.api.nextspace-uat-aus.net/file/f8013557-ef2b-4536-9a6f-aee76c1ffc45?cc=1"
|
|
10671
10723
|
},
|
|
10672
10724
|
{
|
|
10673
10725
|
id: EDefaultImagery.BingMapsRoads,
|
|
10674
10726
|
name: "Bing Maps Roads",
|
|
10675
|
-
iconUrl: "https://template.
|
|
10727
|
+
iconUrl: "https://template.api.nextspace-uat-aus.net/file/24d5031c-9e3d-42b4-9067-6d6e763e3bc2?cc=1"
|
|
10676
10728
|
},
|
|
10677
10729
|
{
|
|
10678
10730
|
id: EDefaultImagery.MapboxSatellite,
|
|
10679
10731
|
name: "Mapbox Satellite",
|
|
10680
|
-
iconUrl: "https://template.
|
|
10732
|
+
iconUrl: "https://template.api.nextspace-uat-aus.net/file/80408e6f-f225-484f-8b50-698d6b367c89?cc=1"
|
|
10681
10733
|
},
|
|
10682
10734
|
{
|
|
10683
10735
|
id: EDefaultImagery.MapBoxStreets,
|
|
10684
10736
|
name: "Mapbox Streets",
|
|
10685
|
-
iconUrl: "https://template.
|
|
10737
|
+
iconUrl: "https://template.api.nextspace-uat-aus.net/file/8adcb13e-2289-4672-8218-381adae37c72?cc=1"
|
|
10686
10738
|
},
|
|
10687
10739
|
{
|
|
10688
10740
|
id: EDefaultImagery.MapBoxStreetsClassic,
|
|
10689
10741
|
name: "Mapbox Streets Classic",
|
|
10690
|
-
iconUrl: "https://template.
|
|
10742
|
+
iconUrl: "https://template.api.nextspace-uat-aus.net/file/8371bab5-9e32-4597-9405-842ec12c93b6?cc=1"
|
|
10691
10743
|
},
|
|
10692
10744
|
{
|
|
10693
10745
|
id: EDefaultImagery.EsriWorldImagery,
|
|
10694
10746
|
name: "Esri World Imagery",
|
|
10695
|
-
iconUrl: "https://template.
|
|
10747
|
+
iconUrl: "https://template.api.nextspace-uat-aus.net/file/8331102f-f976-4811-b5a8-947a823ee605?cc=1"
|
|
10696
10748
|
},
|
|
10697
10749
|
{
|
|
10698
10750
|
id: EDefaultImagery.EsriWorldStreetMap,
|
|
10699
10751
|
name: "Esri World Street Map",
|
|
10700
|
-
iconUrl: "https://template.
|
|
10752
|
+
iconUrl: "https://template.api.nextspace-uat-aus.net/file/1057b493-c1cb-4fbd-ba6a-a2aa18e7961f?cc=1"
|
|
10701
10753
|
},
|
|
10702
10754
|
{
|
|
10703
10755
|
id: EDefaultImagery.EsriNationalGeographic,
|
|
10704
10756
|
name: "Esri National Geographic",
|
|
10705
|
-
iconUrl: "https://template.
|
|
10757
|
+
iconUrl: "https://template.api.nextspace-uat-aus.net/file/ee0c1425-d775-4f35-971a-14f032d34f35?cc=1"
|
|
10706
10758
|
},
|
|
10707
10759
|
{
|
|
10708
10760
|
id: EDefaultImagery.OpenStreetMap,
|
|
10709
10761
|
name: "Open Street Map",
|
|
10710
|
-
iconUrl: "https://template.
|
|
10762
|
+
iconUrl: "https://template.api.nextspace-uat-aus.net/file/df78c884-983e-4827-8aa3-eb6403ec0b5e?cc=1"
|
|
10711
10763
|
},
|
|
10712
10764
|
{
|
|
10713
10765
|
id: EDefaultImagery.LINZ,
|
|
10714
10766
|
name: "LINZ",
|
|
10715
|
-
iconUrl: "https://template.
|
|
10767
|
+
iconUrl: "https://template.api.nextspace-uat-aus.net/file/023fca3d-d849-45df-a0c8-511cebc98414?cc=1"
|
|
10716
10768
|
},
|
|
10717
10769
|
{
|
|
10718
10770
|
id: EDefaultImagery.StamenWaterColor,
|
|
10719
10771
|
name: "Stamen Water Color",
|
|
10720
|
-
iconUrl: "https://template.
|
|
10772
|
+
iconUrl: "https://template.api.nextspace-uat-aus.net/file/4d8b29e2-0df3-43de-aaf4-0e788cd1642a?cc=1"
|
|
10721
10773
|
},
|
|
10722
10774
|
{
|
|
10723
10775
|
id: EDefaultImagery.StamenToner,
|
|
10724
10776
|
name: "Stamen Toner",
|
|
10725
|
-
iconUrl: "https://template.
|
|
10777
|
+
iconUrl: "https://template.api.nextspace-uat-aus.net/file/d5b9fa60-4fb3-4c2f-914c-b6d3016ecb54?cc=1"
|
|
10726
10778
|
},
|
|
10727
10779
|
{
|
|
10728
10780
|
id: EDefaultImagery.ThunderforestCycle,
|
|
@@ -10759,12 +10811,12 @@ var ProjectViewTile;
|
|
|
10759
10811
|
{
|
|
10760
10812
|
id: EDefaultTerrain.CesiumWorldTerrain,
|
|
10761
10813
|
name: "Cesium World Terrain",
|
|
10762
|
-
iconUrl: "https://template.
|
|
10814
|
+
iconUrl: "https://template.api.nextspace-uat-aus.net/file/b3486042-c2d8-4588-85e8-0bba2c0ccb80?cc=1"
|
|
10763
10815
|
},
|
|
10764
10816
|
{
|
|
10765
10817
|
id: EDefaultTerrain.LINZ,
|
|
10766
10818
|
name: "LINZ",
|
|
10767
|
-
iconUrl: "https://template.
|
|
10819
|
+
iconUrl: "https://template.api.nextspace-uat-aus.net/file/023fca3d-d849-45df-a0c8-511cebc98414?cc=1"
|
|
10768
10820
|
},
|
|
10769
10821
|
{
|
|
10770
10822
|
id: EDefaultTerrain.FlatTerrain,
|
|
@@ -15211,7 +15263,7 @@ var Scenario;
|
|
|
15211
15263
|
})(Scenario || (Scenario = {}));
|
|
15212
15264
|
|
|
15213
15265
|
// This is updated with the package.json version on build.
|
|
15214
|
-
const VERSION = "5.
|
|
15266
|
+
const VERSION = "5.7.1";
|
|
15215
15267
|
|
|
15216
15268
|
export { VERSION, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, GeoJson, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityCoords, EntityAttribute, EntityHistoricData, EntityTableView, Comment, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, ProjectViewBookmarkGroup, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, Account, AccountInvite, AccountFeatures, AccountLimits, AccountTemplate, AccountType, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, DataLabGroup, ImportAssembly, ImportCad, ImportCsv, ImportJson, ImportGeoJson, ImportKml, ImportedFile, ExportBrz, ExportUsd, Markup, Uploader, Plugin, ENVIRONMENT, DataSource, Scenario };
|
|
15217
15269
|
//# sourceMappingURL=bruce-models.es5.js.map
|