bruce-models 4.7.8 → 4.7.9
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 -63
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +68 -63
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/environment.js +6 -0
- package/dist/lib/environment.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/environment.d.ts +2 -0
- package/package.json +1 -1
package/dist/bruce-models.es5.js
CHANGED
|
@@ -1600,6 +1600,68 @@ class ApiGetters {
|
|
|
1600
1600
|
}
|
|
1601
1601
|
}
|
|
1602
1602
|
|
|
1603
|
+
/**
|
|
1604
|
+
* Simple event utility.
|
|
1605
|
+
* Instantiate the model, then subscribe and trigger events.
|
|
1606
|
+
*/
|
|
1607
|
+
class BruceEvent {
|
|
1608
|
+
constructor() {
|
|
1609
|
+
// Counter to help differentiate subscriptions.
|
|
1610
|
+
this._counter = 0;
|
|
1611
|
+
// Record of all callback subscriptions for this event.
|
|
1612
|
+
this.callbacks = [];
|
|
1613
|
+
}
|
|
1614
|
+
/**
|
|
1615
|
+
* Subscribes to this event.
|
|
1616
|
+
* The provided callback will be called when the event is triggered.
|
|
1617
|
+
* @param callback
|
|
1618
|
+
* @returns A function that can be called to unsubscribe from this event.
|
|
1619
|
+
*/
|
|
1620
|
+
Subscribe(callback) {
|
|
1621
|
+
let id = this._counter++;
|
|
1622
|
+
let newBruceEventCallback = {
|
|
1623
|
+
_id: id,
|
|
1624
|
+
removeCallback: () => {
|
|
1625
|
+
this.Unsubscribe(id);
|
|
1626
|
+
},
|
|
1627
|
+
callback: callback
|
|
1628
|
+
};
|
|
1629
|
+
this.callbacks.push(newBruceEventCallback);
|
|
1630
|
+
return newBruceEventCallback.removeCallback;
|
|
1631
|
+
}
|
|
1632
|
+
/**
|
|
1633
|
+
* Unsubscribes from this event.
|
|
1634
|
+
* @param id specific subscription entry to remove.
|
|
1635
|
+
* @warning please use the returned function from Subscribe() instead of this function.
|
|
1636
|
+
*/
|
|
1637
|
+
Unsubscribe(id) {
|
|
1638
|
+
let index = this.callbacks.findIndex(x => x._id == id);
|
|
1639
|
+
if (index > -1) {
|
|
1640
|
+
this.callbacks.splice(index, 1);
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
/**
|
|
1644
|
+
* Triggers this event with optional data.
|
|
1645
|
+
* This will call all subscribed callbacks.
|
|
1646
|
+
* @param data
|
|
1647
|
+
*/
|
|
1648
|
+
Trigger(data) {
|
|
1649
|
+
let callbacks = this.callbacks;
|
|
1650
|
+
for (let i = 0; i < callbacks.length; i++) {
|
|
1651
|
+
let callback = callbacks[i];
|
|
1652
|
+
if (callback.callback) {
|
|
1653
|
+
callback.callback(data);
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
/**
|
|
1658
|
+
* Clears all subscriptions.
|
|
1659
|
+
*/
|
|
1660
|
+
Clear() {
|
|
1661
|
+
this.callbacks = [];
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1603
1665
|
// Global instance for smaller use-cases where you don't want to manage the getters yourself.
|
|
1604
1666
|
let _getters;
|
|
1605
1667
|
var ENVIRONMENT;
|
|
@@ -1615,6 +1677,9 @@ var ENVIRONMENT;
|
|
|
1615
1677
|
// Default session ID.
|
|
1616
1678
|
sessionId: ""
|
|
1617
1679
|
};
|
|
1680
|
+
// Subscribe to get notified when someone calls Reset.
|
|
1681
|
+
// If you are manually updating params, call OnParamsChange.Trigger() to notify others.
|
|
1682
|
+
ENVIRONMENT.OnParamsChange = new BruceEvent();
|
|
1618
1683
|
/**
|
|
1619
1684
|
* Returns the ApiGetters instance.
|
|
1620
1685
|
* This is used to communicate with any Nextspace API instance.
|
|
@@ -1639,6 +1704,7 @@ var ENVIRONMENT;
|
|
|
1639
1704
|
* @param params
|
|
1640
1705
|
*/
|
|
1641
1706
|
function Reset(params) {
|
|
1707
|
+
var _a;
|
|
1642
1708
|
if (ENVIRONMENT.IS_SELF_MANAGED) {
|
|
1643
1709
|
throw ("Self managed mode ON. You are getting this error because you didn't pass an Api instance to a function.");
|
|
1644
1710
|
}
|
|
@@ -1655,6 +1721,7 @@ var ENVIRONMENT;
|
|
|
1655
1721
|
}
|
|
1656
1722
|
}
|
|
1657
1723
|
ENVIRONMENT.PARAMS = Object.assign(Object.assign({}, ENVIRONMENT.PARAMS), params);
|
|
1724
|
+
(_a = ENVIRONMENT.OnParamsChange) === null || _a === void 0 ? void 0 : _a.Trigger();
|
|
1658
1725
|
}
|
|
1659
1726
|
ENVIRONMENT.Reset = Reset;
|
|
1660
1727
|
})(ENVIRONMENT || (ENVIRONMENT = {}));
|
|
@@ -5009,68 +5076,6 @@ var Bounds;
|
|
|
5009
5076
|
Bounds.FromEntity = FromEntity;
|
|
5010
5077
|
})(Bounds || (Bounds = {}));
|
|
5011
5078
|
|
|
5012
|
-
/**
|
|
5013
|
-
* Simple event utility.
|
|
5014
|
-
* Instantiate the model, then subscribe and trigger events.
|
|
5015
|
-
*/
|
|
5016
|
-
class BruceEvent {
|
|
5017
|
-
constructor() {
|
|
5018
|
-
// Counter to help differentiate subscriptions.
|
|
5019
|
-
this._counter = 0;
|
|
5020
|
-
// Record of all callback subscriptions for this event.
|
|
5021
|
-
this.callbacks = [];
|
|
5022
|
-
}
|
|
5023
|
-
/**
|
|
5024
|
-
* Subscribes to this event.
|
|
5025
|
-
* The provided callback will be called when the event is triggered.
|
|
5026
|
-
* @param callback
|
|
5027
|
-
* @returns A function that can be called to unsubscribe from this event.
|
|
5028
|
-
*/
|
|
5029
|
-
Subscribe(callback) {
|
|
5030
|
-
let id = this._counter++;
|
|
5031
|
-
let newBruceEventCallback = {
|
|
5032
|
-
_id: id,
|
|
5033
|
-
removeCallback: () => {
|
|
5034
|
-
this.Unsubscribe(id);
|
|
5035
|
-
},
|
|
5036
|
-
callback: callback
|
|
5037
|
-
};
|
|
5038
|
-
this.callbacks.push(newBruceEventCallback);
|
|
5039
|
-
return newBruceEventCallback.removeCallback;
|
|
5040
|
-
}
|
|
5041
|
-
/**
|
|
5042
|
-
* Unsubscribes from this event.
|
|
5043
|
-
* @param id specific subscription entry to remove.
|
|
5044
|
-
* @warning please use the returned function from Subscribe() instead of this function.
|
|
5045
|
-
*/
|
|
5046
|
-
Unsubscribe(id) {
|
|
5047
|
-
let index = this.callbacks.findIndex(x => x._id == id);
|
|
5048
|
-
if (index > -1) {
|
|
5049
|
-
this.callbacks.splice(index, 1);
|
|
5050
|
-
}
|
|
5051
|
-
}
|
|
5052
|
-
/**
|
|
5053
|
-
* Triggers this event with optional data.
|
|
5054
|
-
* This will call all subscribed callbacks.
|
|
5055
|
-
* @param data
|
|
5056
|
-
*/
|
|
5057
|
-
Trigger(data) {
|
|
5058
|
-
let callbacks = this.callbacks;
|
|
5059
|
-
for (let i = 0; i < callbacks.length; i++) {
|
|
5060
|
-
let callback = callbacks[i];
|
|
5061
|
-
if (callback.callback) {
|
|
5062
|
-
callback.callback(data);
|
|
5063
|
-
}
|
|
5064
|
-
}
|
|
5065
|
-
}
|
|
5066
|
-
/**
|
|
5067
|
-
* Clears all subscriptions.
|
|
5068
|
-
*/
|
|
5069
|
-
Clear() {
|
|
5070
|
-
this.callbacks = [];
|
|
5071
|
-
}
|
|
5072
|
-
}
|
|
5073
|
-
|
|
5074
5079
|
var Camera;
|
|
5075
5080
|
(function (Camera) {
|
|
5076
5081
|
let EFrustum;
|
|
@@ -14135,7 +14140,7 @@ var DataSource;
|
|
|
14135
14140
|
})(DataSource || (DataSource = {}));
|
|
14136
14141
|
|
|
14137
14142
|
// This is updated with the package.json version on build.
|
|
14138
|
-
const VERSION = "4.7.
|
|
14143
|
+
const VERSION = "4.7.9";
|
|
14139
14144
|
|
|
14140
14145
|
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, EntityTypeVisualSettings, EntityAttribute, EntityHistoricData, EntityTableView, Comment, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, Account, AccountInvite, AccountFeatures, AccountLimits, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, ImportCad, ImportCsv, ImportJson, ImportKml, ImportedFile, Markup, Uploader, Plugin, ENVIRONMENT, DataSource };
|
|
14141
14146
|
//# sourceMappingURL=bruce-models.es5.js.map
|