bruce-cesium 4.0.9 → 4.1.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-cesium.es5.js +740 -96
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +737 -94
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +2 -1
- package/dist/lib/bruce-cesium.js.map +1 -1
- package/dist/lib/rendering/menu-item-manager.js +10 -0
- package/dist/lib/rendering/menu-item-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/data-source/data-source-static-csv-manager.js +2 -0
- package/dist/lib/rendering/render-managers/data-source/data-source-static-csv-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js +2 -0
- package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js +2 -0
- package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +2 -0
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entity-render-manager.js +1 -0
- package/dist/lib/rendering/render-managers/entities/entity-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/other/google-search-render-manager.js +642 -0
- package/dist/lib/rendering/render-managers/other/google-search-render-manager.js.map +1 -0
- package/dist/lib/rendering/render-managers/other/legacy-relations-render-manager.js +1 -0
- package/dist/lib/rendering/render-managers/other/legacy-relations-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/other/relations-render-manager.js +1 -0
- package/dist/lib/rendering/render-managers/other/relations-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-arb-render-manager.js +1 -0
- package/dist/lib/rendering/render-managers/tilesets/tileset-arb-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js +1 -0
- package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-entities-render-manager.js +1 -0
- package/dist/lib/rendering/render-managers/tilesets/tileset-entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-osm-render-manager.js +1 -0
- package/dist/lib/rendering/render-managers/tilesets/tileset-osm-render-manager.js.map +1 -1
- package/dist/lib/rendering/tile-render-engine.js +114 -92
- package/dist/lib/rendering/tile-render-engine.js.map +1 -1
- package/dist/lib/rendering/visuals-register.js +1 -1
- package/dist/lib/rendering/visuals-register.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +2 -1
- package/dist/types/rendering/render-managers/other/google-search-render-manager.d.ts +46 -0
- package/dist/types/rendering/visuals-register.d.ts +2 -1
- package/package.json +2 -2
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BruceEvent, Cartes, Carto, Entity as Entity$1, Geometry, Tileset, MathUtils, LRUCache, ProjectViewTile, DelayQueue, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, Bounds, Api, EntityRelationType, ENVIRONMENT, EntityHistoricData, EntityCoords, EntitySource, MenuItem, EntityRelation, ProgramKey, AbstractApi, ProjectViewBookmark, EntityAttachment, EntityAttachmentType, EntityAttribute, ProjectView, ProjectViewLegacyTile, Camera } from 'bruce-models';
|
|
2
2
|
import * as Cesium from 'cesium';
|
|
3
|
-
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, Primitive, Cesium3DTileFeature,
|
|
3
|
+
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, Primitive, Cesium3DTileFeature, DistanceDisplayCondition, NearFarScalar, Model, ColorMaterialProperty, HorizontalOrigin, VerticalOrigin, ConstantProperty, ConstantPositionProperty, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorBlendMode, HeadingPitchRoll, Transforms, SceneMode, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, Cesium3DTileStyle, KmlDataSource, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, SceneTransforms, OrthographicFrustum, EasingFunction, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, CesiumInspector, ClockRange, PolygonPipeline, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Quaternion, Intersect } from 'cesium';
|
|
4
4
|
|
|
5
5
|
/*! *****************************************************************************
|
|
6
6
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -9372,7 +9372,7 @@ var VisualsRegister;
|
|
|
9372
9372
|
else {
|
|
9373
9373
|
var entityRegos = this.rego[entityId];
|
|
9374
9374
|
if (!entityRegos) {
|
|
9375
|
-
return
|
|
9375
|
+
return null;
|
|
9376
9376
|
}
|
|
9377
9377
|
if (menuItemId) {
|
|
9378
9378
|
return entityRegos.find(function (r) { return r.menuItemId === menuItemId; });
|
|
@@ -11241,6 +11241,7 @@ var EntitiesRenderManager;
|
|
|
11241
11241
|
var rego = {
|
|
11242
11242
|
entityId: entityId,
|
|
11243
11243
|
menuItemId: _this.item.id,
|
|
11244
|
+
menuItemType: _this.item.Type,
|
|
11244
11245
|
visual: thing,
|
|
11245
11246
|
priority: 0,
|
|
11246
11247
|
entityTypeId: group.entityTypeId,
|
|
@@ -11377,6 +11378,7 @@ var EntitiesRenderManager;
|
|
|
11377
11378
|
entityId: id,
|
|
11378
11379
|
schemaId: (_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d.SchemaID,
|
|
11379
11380
|
menuItemId: this.item.id,
|
|
11381
|
+
menuItemType: this.item.Type,
|
|
11380
11382
|
visual: cEntity,
|
|
11381
11383
|
priority: 0,
|
|
11382
11384
|
entityTypeId: entity.Bruce["EntityType.ID"],
|
|
@@ -12115,6 +12117,7 @@ var EntitiesLoadedRenderManager;
|
|
|
12115
12117
|
var rego = {
|
|
12116
12118
|
entityId: entityId,
|
|
12117
12119
|
menuItemId: _this.item.id,
|
|
12120
|
+
menuItemType: _this.item.Type,
|
|
12118
12121
|
visual: thing,
|
|
12119
12122
|
priority: 0,
|
|
12120
12123
|
entityTypeId: group.entityTypeId,
|
|
@@ -12219,6 +12222,7 @@ var EntitiesLoadedRenderManager;
|
|
|
12219
12222
|
rego: {
|
|
12220
12223
|
entityId: id,
|
|
12221
12224
|
menuItemId: this.item.id,
|
|
12225
|
+
menuItemType: this.item.Type,
|
|
12222
12226
|
visual: cEntity,
|
|
12223
12227
|
priority: 0,
|
|
12224
12228
|
entityTypeId: entity.Bruce["EntityType.ID"],
|
|
@@ -12736,6 +12740,7 @@ var EntitiesIdsRenderManager;
|
|
|
12736
12740
|
var rego = {
|
|
12737
12741
|
entityId: entityId,
|
|
12738
12742
|
menuItemId: _this.item.id,
|
|
12743
|
+
menuItemType: _this.item.Type,
|
|
12739
12744
|
visual: thing,
|
|
12740
12745
|
priority: 0,
|
|
12741
12746
|
entityTypeId: group.entityTypeId,
|
|
@@ -12831,6 +12836,7 @@ var EntitiesIdsRenderManager;
|
|
|
12831
12836
|
rego: {
|
|
12832
12837
|
entityId: id,
|
|
12833
12838
|
menuItemId: this.item.id,
|
|
12839
|
+
menuItemType: this.item.Type,
|
|
12834
12840
|
visual: cEntity,
|
|
12835
12841
|
priority: 0,
|
|
12836
12842
|
entityTypeId: entity.Bruce["EntityType.ID"],
|
|
@@ -13050,6 +13056,7 @@ var EntityRenderManager;
|
|
|
13050
13056
|
rego: {
|
|
13051
13057
|
entityId: entity.Bruce.ID,
|
|
13052
13058
|
menuItemId: this.item.id,
|
|
13059
|
+
menuItemType: this.item.Type,
|
|
13053
13060
|
visual: cEntity,
|
|
13054
13061
|
priority: 0,
|
|
13055
13062
|
entityTypeId: entity.Bruce["EntityType.ID"],
|
|
@@ -14376,6 +14383,7 @@ var TilesetCadRenderManager;
|
|
|
14376
14383
|
entityId: null,
|
|
14377
14384
|
entityTypeId: null,
|
|
14378
14385
|
menuItemId: this.item.id,
|
|
14386
|
+
menuItemType: this.item.Type,
|
|
14379
14387
|
priority: 0,
|
|
14380
14388
|
visual: feature,
|
|
14381
14389
|
accountId: (_b = (_a = this.item.tileset) === null || _a === void 0 ? void 0 : _a.ClientAccountID) !== null && _b !== void 0 ? _b : this.getters.GetAccountId(),
|
|
@@ -15585,6 +15593,7 @@ var TilesetOsmRenderManager;
|
|
|
15585
15593
|
rego = {
|
|
15586
15594
|
entityId: bruceId,
|
|
15587
15595
|
menuItemId: this.item.id,
|
|
15596
|
+
menuItemType: this.item.Type,
|
|
15588
15597
|
priority: 0,
|
|
15589
15598
|
visual: feature,
|
|
15590
15599
|
entityTypeId: this.entityTypeId,
|
|
@@ -15877,6 +15886,7 @@ var TilesetEntitiesRenderManager;
|
|
|
15877
15886
|
entityId: id,
|
|
15878
15887
|
entityTypeId: this.typeId,
|
|
15879
15888
|
menuItemId: this.item.id,
|
|
15889
|
+
menuItemType: this.item.Type,
|
|
15880
15890
|
priority: 0,
|
|
15881
15891
|
visual: feature,
|
|
15882
15892
|
tilesetId: (_a = this.item.tileset) === null || _a === void 0 ? void 0 : _a.TilesetID,
|
|
@@ -16517,6 +16527,7 @@ var TilesetArbRenderManager;
|
|
|
16517
16527
|
entityId: null,
|
|
16518
16528
|
entityTypeId: null,
|
|
16519
16529
|
menuItemId: this.item.id,
|
|
16530
|
+
menuItemType: this.item.Type,
|
|
16520
16531
|
priority: 0,
|
|
16521
16532
|
visual: feature,
|
|
16522
16533
|
accountId: (_b = (_a = this.item.tileset) === null || _a === void 0 ? void 0 : _a.ClientAccountID) !== null && _b !== void 0 ? _b : this.getters.GetAccountId(),
|
|
@@ -16964,6 +16975,7 @@ var RelationsRenderManager;
|
|
|
16964
16975
|
rego: {
|
|
16965
16976
|
entityId: (_b = relation["Data.Entity.ID"]) !== null && _b !== void 0 ? _b : ObjectUtils.UId(),
|
|
16966
16977
|
menuItemId: this.item.id,
|
|
16978
|
+
menuItemType: this.item.Type,
|
|
16967
16979
|
relation: relation,
|
|
16968
16980
|
visual: cEntity,
|
|
16969
16981
|
priority: 0,
|
|
@@ -17395,6 +17407,7 @@ var LegacyRelationsRenderManager;
|
|
|
17395
17407
|
rego: {
|
|
17396
17408
|
entityId: (_b = relation["Data.Entity.ID"]) !== null && _b !== void 0 ? _b : ObjectUtils.UId(),
|
|
17397
17409
|
menuItemId: this.item.id,
|
|
17410
|
+
menuItemType: this.item.Type,
|
|
17398
17411
|
relation: relation,
|
|
17399
17412
|
visual: cEntity,
|
|
17400
17413
|
priority: 0,
|
|
@@ -17732,6 +17745,7 @@ var DataSourceStaticCsvManager;
|
|
|
17732
17745
|
rego: {
|
|
17733
17746
|
entityId: vehicleEntityId,
|
|
17734
17747
|
menuItemId: this.item.id,
|
|
17748
|
+
menuItemType: this.item.Type,
|
|
17735
17749
|
priority: 0,
|
|
17736
17750
|
visual: vehicleEntity,
|
|
17737
17751
|
accountId: this.apiGetter.accountId,
|
|
@@ -17753,6 +17767,7 @@ var DataSourceStaticCsvManager;
|
|
|
17753
17767
|
rego: {
|
|
17754
17768
|
entityId: nextspaceEntityId,
|
|
17755
17769
|
menuItemId: this.item.id,
|
|
17770
|
+
menuItemType: this.item.Type,
|
|
17756
17771
|
priority: 0,
|
|
17757
17772
|
visual: entity,
|
|
17758
17773
|
accountId: this.apiGetter.accountId,
|
|
@@ -18157,6 +18172,604 @@ var TilesetI3sRenderManager;
|
|
|
18157
18172
|
TilesetI3sRenderManager.Manager = Manager;
|
|
18158
18173
|
})(TilesetI3sRenderManager || (TilesetI3sRenderManager = {}));
|
|
18159
18174
|
|
|
18175
|
+
var GoogleSearchRenderManager;
|
|
18176
|
+
(function (GoogleSearchRenderManager$$1) {
|
|
18177
|
+
var Manager = /** @class */ (function () {
|
|
18178
|
+
function Manager(params) {
|
|
18179
|
+
// If true, this menu item is disposed and should not be used.
|
|
18180
|
+
// Any rendering will be ignored.
|
|
18181
|
+
this.disposed = false;
|
|
18182
|
+
this.grid = new EntityGlobe.Grid();
|
|
18183
|
+
this.getterLoopId = 0;
|
|
18184
|
+
var item = params.item, register = params.register, monitor = params.monitor, viewer = params.viewer, getters = params.getters;
|
|
18185
|
+
this.item = item;
|
|
18186
|
+
this.register = register;
|
|
18187
|
+
this.monitor = monitor;
|
|
18188
|
+
this.viewer = viewer;
|
|
18189
|
+
this.getters = getters;
|
|
18190
|
+
}
|
|
18191
|
+
Object.defineProperty(Manager.prototype, "Disposed", {
|
|
18192
|
+
get: function () {
|
|
18193
|
+
return this.disposed;
|
|
18194
|
+
},
|
|
18195
|
+
enumerable: false,
|
|
18196
|
+
configurable: true
|
|
18197
|
+
});
|
|
18198
|
+
Manager.prototype.Init = function () {
|
|
18199
|
+
var _this = this;
|
|
18200
|
+
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
18201
|
+
var key, valid, programKey, valid, e_1;
|
|
18202
|
+
var _this = this;
|
|
18203
|
+
var _a, _b, _c, _d;
|
|
18204
|
+
return __generator(this, function (_e) {
|
|
18205
|
+
switch (_e.label) {
|
|
18206
|
+
case 0:
|
|
18207
|
+
_e.trys.push([0, 7, , 8]);
|
|
18208
|
+
if (!!((_c = (_b = (_a = getGoogle()) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.places) === null || _c === void 0 ? void 0 : _c.PlacesService)) return [3 /*break*/, 6];
|
|
18209
|
+
key = this.item.accessToken;
|
|
18210
|
+
if (!key) return [3 /*break*/, 2];
|
|
18211
|
+
return [4 /*yield*/, validateKey(key)];
|
|
18212
|
+
case 1:
|
|
18213
|
+
valid = _e.sent();
|
|
18214
|
+
if (!valid) {
|
|
18215
|
+
console.warn("Menu Item key not valid for Google Places API. Will try use the account default.");
|
|
18216
|
+
key = null;
|
|
18217
|
+
}
|
|
18218
|
+
_e.label = 2;
|
|
18219
|
+
case 2:
|
|
18220
|
+
if (!!key) return [3 /*break*/, 5];
|
|
18221
|
+
return [4 /*yield*/, ProgramKey.Get({
|
|
18222
|
+
programId: ProgramKey.EProgramId.Google,
|
|
18223
|
+
api: this.getters.GetBruceApi()
|
|
18224
|
+
})];
|
|
18225
|
+
case 3:
|
|
18226
|
+
programKey = (_e.sent()).programKey;
|
|
18227
|
+
if (programKey === null || programKey === void 0 ? void 0 : programKey.Key) {
|
|
18228
|
+
key = programKey.Key;
|
|
18229
|
+
}
|
|
18230
|
+
if (!key) return [3 /*break*/, 5];
|
|
18231
|
+
return [4 /*yield*/, validateKey(key)];
|
|
18232
|
+
case 4:
|
|
18233
|
+
valid = _e.sent();
|
|
18234
|
+
if (!valid) {
|
|
18235
|
+
throw new Error("Account default key not valid for Google Places API.");
|
|
18236
|
+
}
|
|
18237
|
+
_e.label = 5;
|
|
18238
|
+
case 5:
|
|
18239
|
+
if (!key) {
|
|
18240
|
+
throw new Error("No valid key found for Google Places API.");
|
|
18241
|
+
}
|
|
18242
|
+
this.accessToken = key;
|
|
18243
|
+
_e.label = 6;
|
|
18244
|
+
case 6:
|
|
18245
|
+
if (this.Disposed) {
|
|
18246
|
+
return [2 /*return*/];
|
|
18247
|
+
}
|
|
18248
|
+
(_d = this.monitorRemoval) === null || _d === void 0 ? void 0 : _d.call(this);
|
|
18249
|
+
this.monitorRemoval = this.monitor.Updated().Subscribe(function () {
|
|
18250
|
+
_this.startGetterLoop();
|
|
18251
|
+
});
|
|
18252
|
+
this.startGetterLoop();
|
|
18253
|
+
return [3 /*break*/, 8];
|
|
18254
|
+
case 7:
|
|
18255
|
+
e_1 = _e.sent();
|
|
18256
|
+
console.error(e_1);
|
|
18257
|
+
return [3 /*break*/, 8];
|
|
18258
|
+
case 8: return [2 /*return*/];
|
|
18259
|
+
}
|
|
18260
|
+
});
|
|
18261
|
+
}); })();
|
|
18262
|
+
};
|
|
18263
|
+
Manager.prototype.Dispose = function () {
|
|
18264
|
+
var _a;
|
|
18265
|
+
if (this.disposed) {
|
|
18266
|
+
return;
|
|
18267
|
+
}
|
|
18268
|
+
this.disposed = true;
|
|
18269
|
+
(_a = this.monitorRemoval) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
18270
|
+
this.register.RemoveRegos({
|
|
18271
|
+
menuItemId: this.item.id
|
|
18272
|
+
});
|
|
18273
|
+
};
|
|
18274
|
+
Manager.prototype.ReRender = function (params) {
|
|
18275
|
+
// Ignore. Not relevant for this render manager.
|
|
18276
|
+
return;
|
|
18277
|
+
};
|
|
18278
|
+
/**
|
|
18279
|
+
* Starts gathering data around the view-port in blocks.
|
|
18280
|
+
* If a block was previously fetched in a different iteration, it is ignored.
|
|
18281
|
+
* This can be re-called once the camera is moved to restart the process.
|
|
18282
|
+
*/
|
|
18283
|
+
Manager.prototype.startGetterLoop = function () {
|
|
18284
|
+
var _this = this;
|
|
18285
|
+
this.getterLoopId += 1;
|
|
18286
|
+
var loopId = this.getterLoopId;
|
|
18287
|
+
return new Promise(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
18288
|
+
var MAX_HEIGHT, MIN_HEIGHT, target, bounds, alt, cells, curCellIndex, curCell, bounds_1, location_1, result, e_2;
|
|
18289
|
+
return __generator(this, function (_a) {
|
|
18290
|
+
switch (_a.label) {
|
|
18291
|
+
case 0:
|
|
18292
|
+
MAX_HEIGHT = 100000;
|
|
18293
|
+
MIN_HEIGHT = 1000;
|
|
18294
|
+
_a.label = 1;
|
|
18295
|
+
case 1:
|
|
18296
|
+
if (!((!this.monitor.GetTarget() || !this.monitor.GetBounds()) && this.getterLoopId == loopId || this.Disposed)) return [3 /*break*/, 3];
|
|
18297
|
+
return [4 /*yield*/, delay$1(500)];
|
|
18298
|
+
case 2:
|
|
18299
|
+
_a.sent();
|
|
18300
|
+
return [3 /*break*/, 1];
|
|
18301
|
+
case 3:
|
|
18302
|
+
target = this.monitor.GetTarget();
|
|
18303
|
+
bounds = this.monitor.GetBounds();
|
|
18304
|
+
if (!target || !bounds) {
|
|
18305
|
+
return [2 /*return*/];
|
|
18306
|
+
}
|
|
18307
|
+
alt = bounds.alt;
|
|
18308
|
+
if (alt == null || alt > MAX_HEIGHT || (alt < MIN_HEIGHT && MIN_HEIGHT > 0)) {
|
|
18309
|
+
return [2 /*return*/];
|
|
18310
|
+
}
|
|
18311
|
+
cells = this.grid.GetCellsForView(target, bounds);
|
|
18312
|
+
curCellIndex = cells.length > 0 ? 0 : null;
|
|
18313
|
+
_a.label = 4;
|
|
18314
|
+
case 4:
|
|
18315
|
+
if (!(curCellIndex != null)) return [3 /*break*/, 11];
|
|
18316
|
+
return [4 /*yield*/, delay$1(500)];
|
|
18317
|
+
case 5:
|
|
18318
|
+
_a.sent();
|
|
18319
|
+
// New loop started, break the old one.
|
|
18320
|
+
if (this.getterLoopId != loopId || this.Disposed) {
|
|
18321
|
+
return [3 /*break*/, 11];
|
|
18322
|
+
}
|
|
18323
|
+
curCell = cells[curCellIndex];
|
|
18324
|
+
if (curCell.IsFetched()) {
|
|
18325
|
+
curCell.Fetching = false;
|
|
18326
|
+
curCellIndex += 1;
|
|
18327
|
+
if (cells[curCellIndex]) {
|
|
18328
|
+
cells[curCellIndex].Fetching = true;
|
|
18329
|
+
}
|
|
18330
|
+
else {
|
|
18331
|
+
curCellIndex = null;
|
|
18332
|
+
}
|
|
18333
|
+
return [3 /*break*/, 4];
|
|
18334
|
+
}
|
|
18335
|
+
_a.label = 6;
|
|
18336
|
+
case 6:
|
|
18337
|
+
_a.trys.push([6, 9, , 10]);
|
|
18338
|
+
// New loop started, break the old one.
|
|
18339
|
+
if (this.getterLoopId != loopId) {
|
|
18340
|
+
return [3 /*break*/, 11];
|
|
18341
|
+
}
|
|
18342
|
+
bounds_1 = curCell.GetBounds();
|
|
18343
|
+
location_1 = {
|
|
18344
|
+
altitude: bounds_1.alt,
|
|
18345
|
+
latitude: bounds_1.south + ((bounds_1.north - bounds_1.south) / 2),
|
|
18346
|
+
longitude: bounds_1.west + ((bounds_1.east - bounds_1.west) / 2)
|
|
18347
|
+
};
|
|
18348
|
+
return [4 /*yield*/, getPlaces({
|
|
18349
|
+
location: location_1,
|
|
18350
|
+
bounds: bounds_1,
|
|
18351
|
+
keyword: this.item.keyword,
|
|
18352
|
+
accessToken: this.accessToken
|
|
18353
|
+
})];
|
|
18354
|
+
case 7:
|
|
18355
|
+
result = _a.sent();
|
|
18356
|
+
return [4 /*yield*/, this.renderPlaces(result)];
|
|
18357
|
+
case 8:
|
|
18358
|
+
_a.sent();
|
|
18359
|
+
if (this.getterLoopId != loopId || this.Disposed) {
|
|
18360
|
+
return [3 /*break*/, 11];
|
|
18361
|
+
}
|
|
18362
|
+
curCell.Fetched = true;
|
|
18363
|
+
curCell.Fetching = false;
|
|
18364
|
+
return [3 /*break*/, 10];
|
|
18365
|
+
case 9:
|
|
18366
|
+
e_2 = _a.sent();
|
|
18367
|
+
console.error(e_2);
|
|
18368
|
+
return [3 /*break*/, 11];
|
|
18369
|
+
case 10: return [3 /*break*/, 4];
|
|
18370
|
+
case 11: return [2 /*return*/];
|
|
18371
|
+
}
|
|
18372
|
+
});
|
|
18373
|
+
}); });
|
|
18374
|
+
};
|
|
18375
|
+
/**
|
|
18376
|
+
* Renders Google places on the map and registers them into the common register.
|
|
18377
|
+
* @param places
|
|
18378
|
+
* @returns
|
|
18379
|
+
*/
|
|
18380
|
+
Manager.prototype.renderPlaces = function (places) {
|
|
18381
|
+
var _a, _b;
|
|
18382
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
18383
|
+
var i, item, itemId, lat, lon, bgColor, size, canvas, pos, billboard;
|
|
18384
|
+
return __generator(this, function (_c) {
|
|
18385
|
+
switch (_c.label) {
|
|
18386
|
+
case 0:
|
|
18387
|
+
i = 0;
|
|
18388
|
+
_c.label = 1;
|
|
18389
|
+
case 1:
|
|
18390
|
+
if (!(i < places.length)) return [3 /*break*/, 4];
|
|
18391
|
+
item = places[i];
|
|
18392
|
+
itemId = item.place_id;
|
|
18393
|
+
// No ID, no item :)
|
|
18394
|
+
if (!itemId) {
|
|
18395
|
+
return [3 /*break*/, 3];
|
|
18396
|
+
}
|
|
18397
|
+
// Check if we already have this item.
|
|
18398
|
+
if (this.register.GetRego({
|
|
18399
|
+
entityId: itemId,
|
|
18400
|
+
menuItemId: this.item.id
|
|
18401
|
+
})) {
|
|
18402
|
+
return [3 /*break*/, 3];
|
|
18403
|
+
}
|
|
18404
|
+
lat = void 0;
|
|
18405
|
+
lon = void 0;
|
|
18406
|
+
if (item.geometry) {
|
|
18407
|
+
if ((_b = (_a = item.geometry.location) === null || _a === void 0 ? void 0 : _a.lat) === null || _b === void 0 ? void 0 : _b.call(_a)) {
|
|
18408
|
+
lat = item.geometry.location.lat();
|
|
18409
|
+
lon = item.geometry.location.lng();
|
|
18410
|
+
}
|
|
18411
|
+
else if (item.geometry.viewport) {
|
|
18412
|
+
lat = (item.geometry.viewport.Xh.lo + item.geometry.viewport.Xh.hi) / 2;
|
|
18413
|
+
lon = (item.geometry.viewport.Hh.lo + item.geometry.viewport.Hh.hi) / 2;
|
|
18414
|
+
}
|
|
18415
|
+
}
|
|
18416
|
+
if (!lat || !lon || typeof lat !== "number" || typeof lon !== "number") {
|
|
18417
|
+
return [3 /*break*/, 3];
|
|
18418
|
+
}
|
|
18419
|
+
bgColor = item.icon_background_color || "white";
|
|
18420
|
+
size = 38;
|
|
18421
|
+
return [4 /*yield*/, createBillboardImage(item.icon, bgColor, size)];
|
|
18422
|
+
case 2:
|
|
18423
|
+
canvas = _c.sent();
|
|
18424
|
+
pos = Cartesian3.fromDegrees(lon, lat);
|
|
18425
|
+
billboard = this.viewer.entities.add({
|
|
18426
|
+
position: pos,
|
|
18427
|
+
billboard: {
|
|
18428
|
+
image: canvas,
|
|
18429
|
+
scale: 1,
|
|
18430
|
+
verticalOrigin: VerticalOrigin.BOTTOM,
|
|
18431
|
+
heightReference: HeightReference.CLAMP_TO_GROUND
|
|
18432
|
+
}
|
|
18433
|
+
});
|
|
18434
|
+
CesiumEntityStyler.BakeDefaultColor({
|
|
18435
|
+
entity: billboard,
|
|
18436
|
+
viewer: this.viewer,
|
|
18437
|
+
colors: {
|
|
18438
|
+
"billboard": Color.WHITE.clone()
|
|
18439
|
+
},
|
|
18440
|
+
refresh: false
|
|
18441
|
+
});
|
|
18442
|
+
this.register.AddRego({
|
|
18443
|
+
rego: {
|
|
18444
|
+
// If we ever want the user to be able to create a Nextspace record-
|
|
18445
|
+
//we must match this logic with the OSM logic.
|
|
18446
|
+
entityId: itemId,
|
|
18447
|
+
sourceId: itemId,
|
|
18448
|
+
menuItemId: this.item.id,
|
|
18449
|
+
menuItemType: this.item.Type,
|
|
18450
|
+
priority: 0,
|
|
18451
|
+
visual: billboard,
|
|
18452
|
+
name: item.name
|
|
18453
|
+
},
|
|
18454
|
+
requestRender: false
|
|
18455
|
+
});
|
|
18456
|
+
if (this.Disposed) {
|
|
18457
|
+
return [3 /*break*/, 4];
|
|
18458
|
+
}
|
|
18459
|
+
_c.label = 3;
|
|
18460
|
+
case 3:
|
|
18461
|
+
i++;
|
|
18462
|
+
return [3 /*break*/, 1];
|
|
18463
|
+
case 4:
|
|
18464
|
+
if (this.Disposed) {
|
|
18465
|
+
this.register.RemoveRegos({
|
|
18466
|
+
menuItemId: this.item.id,
|
|
18467
|
+
requestRender: true
|
|
18468
|
+
});
|
|
18469
|
+
return [2 /*return*/];
|
|
18470
|
+
}
|
|
18471
|
+
this.viewer.scene.requestRender();
|
|
18472
|
+
return [2 /*return*/];
|
|
18473
|
+
}
|
|
18474
|
+
});
|
|
18475
|
+
});
|
|
18476
|
+
};
|
|
18477
|
+
return Manager;
|
|
18478
|
+
}());
|
|
18479
|
+
GoogleSearchRenderManager$$1.Manager = Manager;
|
|
18480
|
+
})(GoogleSearchRenderManager || (GoogleSearchRenderManager = {}));
|
|
18481
|
+
function delay$1(milliseconds) {
|
|
18482
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
18483
|
+
return __generator(this, function (_a) {
|
|
18484
|
+
return [2 /*return*/, new Promise(function (res) {
|
|
18485
|
+
setTimeout(function () {
|
|
18486
|
+
res();
|
|
18487
|
+
}, milliseconds);
|
|
18488
|
+
})];
|
|
18489
|
+
});
|
|
18490
|
+
});
|
|
18491
|
+
}
|
|
18492
|
+
/**
|
|
18493
|
+
* Gets places of a certain type, eg: restaurant, schools, etc.
|
|
18494
|
+
* We can then display this on the map.
|
|
18495
|
+
* @param params
|
|
18496
|
+
*/
|
|
18497
|
+
function getPlaces(params) {
|
|
18498
|
+
var _a, _b, _c;
|
|
18499
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
18500
|
+
return __generator(this, function (_d) {
|
|
18501
|
+
// Works better with CORS.
|
|
18502
|
+
// Does not allow a token to be passed in.
|
|
18503
|
+
if ((_c = (_b = (_a = getGoogle()) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.places) === null || _c === void 0 ? void 0 : _c.PlacesService) {
|
|
18504
|
+
return [2 /*return*/, getPlacesThroughLib(params)];
|
|
18505
|
+
}
|
|
18506
|
+
// Dies in localhost with CORS errors.
|
|
18507
|
+
return [2 /*return*/, getPlacesThroughHTTP(params)];
|
|
18508
|
+
});
|
|
18509
|
+
});
|
|
18510
|
+
}
|
|
18511
|
+
function getPlacesThroughHTTP(params) {
|
|
18512
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
18513
|
+
var location, bounds, keyword, accessToken, isKeyValid, url, baseUrl, boundsStr, locationStr, baseUrl, locationStr, response, data;
|
|
18514
|
+
return __generator(this, function (_a) {
|
|
18515
|
+
switch (_a.label) {
|
|
18516
|
+
case 0:
|
|
18517
|
+
location = params.location, bounds = params.bounds, keyword = params.keyword, accessToken = params.accessToken;
|
|
18518
|
+
if (!accessToken) {
|
|
18519
|
+
throw new Error("No access token provided");
|
|
18520
|
+
}
|
|
18521
|
+
return [4 /*yield*/, validateKeyForSearches(accessToken)];
|
|
18522
|
+
case 1:
|
|
18523
|
+
isKeyValid = _a.sent();
|
|
18524
|
+
if (!isKeyValid) {
|
|
18525
|
+
throw new Error("Invalid Google API Key");
|
|
18526
|
+
}
|
|
18527
|
+
if (bounds) {
|
|
18528
|
+
baseUrl = "https://maps.googleapis.com/maps/api/place/textsearch/json";
|
|
18529
|
+
url = new URL(baseUrl);
|
|
18530
|
+
url.searchParams.append("key", accessToken);
|
|
18531
|
+
url.searchParams.append("query", keyword);
|
|
18532
|
+
boundsStr = "".concat(MathUtils.Round(bounds.south, 4), ",").concat(MathUtils.Round(bounds.west, 4), "|").concat(MathUtils.Round(bounds.north, 4), ",").concat(MathUtils.Round(bounds.east, 4));
|
|
18533
|
+
url.searchParams.append("bounds", boundsStr);
|
|
18534
|
+
locationStr = "".concat(MathUtils.Round(location.latitude, 4), ",").concat(MathUtils.Round(location.longitude, 4));
|
|
18535
|
+
url.searchParams.append("location", locationStr);
|
|
18536
|
+
}
|
|
18537
|
+
else {
|
|
18538
|
+
baseUrl = "https://maps.googleapis.com/maps/api/place/nearbysearch/json";
|
|
18539
|
+
url = new URL(baseUrl);
|
|
18540
|
+
url.searchParams.append("key", accessToken);
|
|
18541
|
+
url.searchParams.append("keyword", keyword);
|
|
18542
|
+
locationStr = "".concat(MathUtils.Round(location.latitude, 4), ",").concat(MathUtils.Round(location.longitude, 4));
|
|
18543
|
+
url.searchParams.append("location", locationStr);
|
|
18544
|
+
url.searchParams.append("radius", "1000");
|
|
18545
|
+
}
|
|
18546
|
+
return [4 /*yield*/, fetch(url.toString())];
|
|
18547
|
+
case 2:
|
|
18548
|
+
response = _a.sent();
|
|
18549
|
+
if (!response.ok) {
|
|
18550
|
+
throw new Error("HTTP error! status: ".concat(response.status));
|
|
18551
|
+
}
|
|
18552
|
+
return [4 /*yield*/, response.json()];
|
|
18553
|
+
case 3:
|
|
18554
|
+
data = _a.sent();
|
|
18555
|
+
if (data.status !== "OK") {
|
|
18556
|
+
throw new Error("API error! status: ".concat(data.status));
|
|
18557
|
+
}
|
|
18558
|
+
return [2 /*return*/, data.results];
|
|
18559
|
+
}
|
|
18560
|
+
});
|
|
18561
|
+
});
|
|
18562
|
+
}
|
|
18563
|
+
function getPlacesThroughLib(params) {
|
|
18564
|
+
var _a, _b, _c;
|
|
18565
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
18566
|
+
var location, bounds, keyword;
|
|
18567
|
+
return __generator(this, function (_d) {
|
|
18568
|
+
location = params.location, bounds = params.bounds, keyword = params.keyword;
|
|
18569
|
+
if (!getGoogle()) {
|
|
18570
|
+
throw new Error("Google is not defined");
|
|
18571
|
+
}
|
|
18572
|
+
if (!_detailsService && ((_c = (_b = (_a = getGoogle()) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.places) === null || _c === void 0 ? void 0 : _c.PlacesService)) {
|
|
18573
|
+
_detailsService = new (getGoogle().maps.places.PlacesService)(document.createElement("div"));
|
|
18574
|
+
}
|
|
18575
|
+
return [2 /*return*/, new Promise(function (res, rej) {
|
|
18576
|
+
if (!(_detailsService === null || _detailsService === void 0 ? void 0 : _detailsService.nearbySearch)) {
|
|
18577
|
+
rej("Google is not defined");
|
|
18578
|
+
}
|
|
18579
|
+
var searchParams = {
|
|
18580
|
+
location: new (getGoogle().maps.LatLng)(location.latitude, location.longitude),
|
|
18581
|
+
radius: 1000,
|
|
18582
|
+
keyword: keyword
|
|
18583
|
+
};
|
|
18584
|
+
if (bounds) {
|
|
18585
|
+
searchParams["bounds"] = new (getGoogle().maps.LatLngBounds)(new (getGoogle().maps.LatLng)(bounds.south, bounds.west), new (getGoogle().maps.LatLng)(bounds.north, bounds.east));
|
|
18586
|
+
}
|
|
18587
|
+
_detailsService.nearbySearch(searchParams, function (results, status) {
|
|
18588
|
+
try {
|
|
18589
|
+
if (status === (getGoogle().maps.places.PlacesServiceStatus).OK) {
|
|
18590
|
+
res(results);
|
|
18591
|
+
}
|
|
18592
|
+
else {
|
|
18593
|
+
rej(status);
|
|
18594
|
+
}
|
|
18595
|
+
}
|
|
18596
|
+
catch (e) {
|
|
18597
|
+
rej(e);
|
|
18598
|
+
}
|
|
18599
|
+
});
|
|
18600
|
+
})];
|
|
18601
|
+
});
|
|
18602
|
+
});
|
|
18603
|
+
}
|
|
18604
|
+
/**
|
|
18605
|
+
* Returns if a google api token is valid or not for the geocoding service.
|
|
18606
|
+
* @param apiKey
|
|
18607
|
+
* @returns
|
|
18608
|
+
*/
|
|
18609
|
+
function validateKey(apiKey) {
|
|
18610
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
18611
|
+
return __generator(this, function (_a) {
|
|
18612
|
+
return [2 /*return*/, validateKeyForSearches(apiKey)];
|
|
18613
|
+
});
|
|
18614
|
+
});
|
|
18615
|
+
}
|
|
18616
|
+
var _validateKeyCache = new Map();
|
|
18617
|
+
/**
|
|
18618
|
+
* Returns if a google api token is valid or not for the geocoding service.
|
|
18619
|
+
* @param apiKey
|
|
18620
|
+
* @returns
|
|
18621
|
+
*/
|
|
18622
|
+
function validateKeyForSearches(apiKey) {
|
|
18623
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
18624
|
+
var prom;
|
|
18625
|
+
var _this = this;
|
|
18626
|
+
return __generator(this, function (_a) {
|
|
18627
|
+
if (!apiKey) {
|
|
18628
|
+
return [2 /*return*/, false];
|
|
18629
|
+
}
|
|
18630
|
+
if (_validateKeyCache.has(apiKey)) {
|
|
18631
|
+
return [2 /*return*/, _validateKeyCache.get(apiKey)];
|
|
18632
|
+
}
|
|
18633
|
+
prom = new Promise(function (res, rej) { return __awaiter(_this, void 0, void 0, function () {
|
|
18634
|
+
var url, response, data, e_3;
|
|
18635
|
+
return __generator(this, function (_a) {
|
|
18636
|
+
switch (_a.label) {
|
|
18637
|
+
case 0:
|
|
18638
|
+
url = "https://maps.googleapis.com/maps/api/geocode/json?address=invalid&key=".concat(apiKey);
|
|
18639
|
+
_a.label = 1;
|
|
18640
|
+
case 1:
|
|
18641
|
+
_a.trys.push([1, 4, , 5]);
|
|
18642
|
+
return [4 /*yield*/, fetch(url)];
|
|
18643
|
+
case 2:
|
|
18644
|
+
response = _a.sent();
|
|
18645
|
+
if (!response.ok) {
|
|
18646
|
+
console.error(response);
|
|
18647
|
+
res(false);
|
|
18648
|
+
}
|
|
18649
|
+
return [4 /*yield*/, response.json()];
|
|
18650
|
+
case 3:
|
|
18651
|
+
data = _a.sent();
|
|
18652
|
+
if (data.status === "REQUEST_DENIED") {
|
|
18653
|
+
console.error(data);
|
|
18654
|
+
res(false);
|
|
18655
|
+
}
|
|
18656
|
+
res(true);
|
|
18657
|
+
return [2 /*return*/];
|
|
18658
|
+
case 4:
|
|
18659
|
+
e_3 = _a.sent();
|
|
18660
|
+
console.error(e_3);
|
|
18661
|
+
return [3 /*break*/, 5];
|
|
18662
|
+
case 5:
|
|
18663
|
+
res(false);
|
|
18664
|
+
return [2 /*return*/];
|
|
18665
|
+
}
|
|
18666
|
+
});
|
|
18667
|
+
}); });
|
|
18668
|
+
_validateKeyCache.set(apiKey, prom);
|
|
18669
|
+
return [2 /*return*/, prom];
|
|
18670
|
+
});
|
|
18671
|
+
});
|
|
18672
|
+
}
|
|
18673
|
+
var _billboardCache$1 = new LRUCache(150);
|
|
18674
|
+
/**
|
|
18675
|
+
* Calculates the resized dimensions while maintaining aspect ratio.
|
|
18676
|
+
* @param originalWidth
|
|
18677
|
+
* @param originalHeight
|
|
18678
|
+
* @param targetWidth
|
|
18679
|
+
* @param targetHeight
|
|
18680
|
+
*/
|
|
18681
|
+
function calculateBillboardSpace(originalWidth, originalHeight, targetWidth, targetHeight) {
|
|
18682
|
+
var aspectRatio = originalWidth / originalHeight;
|
|
18683
|
+
var newWidth = targetWidth;
|
|
18684
|
+
var newHeight = targetHeight;
|
|
18685
|
+
if (newWidth / newHeight > aspectRatio) {
|
|
18686
|
+
newWidth = newHeight * aspectRatio;
|
|
18687
|
+
}
|
|
18688
|
+
else {
|
|
18689
|
+
newHeight = newWidth / aspectRatio;
|
|
18690
|
+
}
|
|
18691
|
+
return { newWidth: newWidth, newHeight: newHeight };
|
|
18692
|
+
}
|
|
18693
|
+
/**
|
|
18694
|
+
* Returns a billboard image with a circle of the given size and color.
|
|
18695
|
+
* The image URL will be loaded and drawn on the center of the circle.
|
|
18696
|
+
* The promise is cached so that the same image is not loaded multiple times.
|
|
18697
|
+
* @param url
|
|
18698
|
+
* @param bgColor
|
|
18699
|
+
* @param width
|
|
18700
|
+
* @param height
|
|
18701
|
+
*/
|
|
18702
|
+
function createBillboardImage(url, bgColor, size) {
|
|
18703
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
18704
|
+
var key, cacheData, IMAGE_PADDING, prom;
|
|
18705
|
+
var _this = this;
|
|
18706
|
+
return __generator(this, function (_a) {
|
|
18707
|
+
key = "".concat(url, "-").concat(bgColor, "-").concat(size);
|
|
18708
|
+
cacheData = _billboardCache$1.Get(key);
|
|
18709
|
+
if (cacheData) {
|
|
18710
|
+
return [2 /*return*/, cacheData];
|
|
18711
|
+
}
|
|
18712
|
+
IMAGE_PADDING = 8;
|
|
18713
|
+
prom = new Promise(function (res, rej) { return __awaiter(_this, void 0, void 0, function () {
|
|
18714
|
+
var response, blob, image_1, e_4;
|
|
18715
|
+
return __generator(this, function (_a) {
|
|
18716
|
+
switch (_a.label) {
|
|
18717
|
+
case 0:
|
|
18718
|
+
_a.trys.push([0, 3, , 4]);
|
|
18719
|
+
return [4 /*yield*/, fetch(url)];
|
|
18720
|
+
case 1:
|
|
18721
|
+
response = _a.sent();
|
|
18722
|
+
return [4 /*yield*/, response.blob()];
|
|
18723
|
+
case 2:
|
|
18724
|
+
blob = _a.sent();
|
|
18725
|
+
image_1 = new Image();
|
|
18726
|
+
image_1.onload = function () {
|
|
18727
|
+
var canvas = document.createElement("canvas");
|
|
18728
|
+
canvas.width = size;
|
|
18729
|
+
canvas.height = size;
|
|
18730
|
+
var context = canvas.getContext("2d");
|
|
18731
|
+
// Calculate padding and available space.
|
|
18732
|
+
var availableSize = size - 2 * IMAGE_PADDING;
|
|
18733
|
+
// Calculate resized dimensions preserving aspect ratio.
|
|
18734
|
+
var _a = calculateBillboardSpace(image_1.width, image_1.height, availableSize, availableSize), newWidth = _a.newWidth, newHeight = _a.newHeight;
|
|
18735
|
+
// Draw the circular background.
|
|
18736
|
+
context.beginPath();
|
|
18737
|
+
context.arc(size / 2, size / 2, size / 2, 0, 2 * Math.PI, false);
|
|
18738
|
+
context.fillStyle = bgColor;
|
|
18739
|
+
context.fill();
|
|
18740
|
+
// Draw the image centered within the circle.
|
|
18741
|
+
var offsetX = (size - newWidth) / 2;
|
|
18742
|
+
var offsetY = (size - newHeight) / 2;
|
|
18743
|
+
context.drawImage(image_1, offsetX, offsetY, newWidth, newHeight);
|
|
18744
|
+
// Draw a 2px darkened border around the circle.
|
|
18745
|
+
context.beginPath();
|
|
18746
|
+
context.arc(size / 2, size / 2, size / 2 - 1, 0, 2 * Math.PI, false);
|
|
18747
|
+
context.lineWidth = 1;
|
|
18748
|
+
context.strokeStyle = "rgba(0, 0, 0, 0.3)";
|
|
18749
|
+
context.stroke();
|
|
18750
|
+
res(canvas);
|
|
18751
|
+
};
|
|
18752
|
+
image_1.onerror = function (e) { return rej(e); };
|
|
18753
|
+
image_1.src = URL.createObjectURL(blob);
|
|
18754
|
+
return [3 /*break*/, 4];
|
|
18755
|
+
case 3:
|
|
18756
|
+
e_4 = _a.sent();
|
|
18757
|
+
rej(e_4);
|
|
18758
|
+
return [3 /*break*/, 4];
|
|
18759
|
+
case 4: return [2 /*return*/];
|
|
18760
|
+
}
|
|
18761
|
+
});
|
|
18762
|
+
}); });
|
|
18763
|
+
_billboardCache$1.Set(key, prom);
|
|
18764
|
+
return [2 /*return*/, prom];
|
|
18765
|
+
});
|
|
18766
|
+
});
|
|
18767
|
+
}
|
|
18768
|
+
var _detailsService = null;
|
|
18769
|
+
function getGoogle() {
|
|
18770
|
+
return window["google"];
|
|
18771
|
+
}
|
|
18772
|
+
|
|
18160
18773
|
/**
|
|
18161
18774
|
* Utility to keep track of enabled menu items within a Cesium viewer.
|
|
18162
18775
|
*/
|
|
@@ -18444,6 +19057,15 @@ var MenuItemManager;
|
|
|
18444
19057
|
viewer: this.viewer,
|
|
18445
19058
|
});
|
|
18446
19059
|
break;
|
|
19060
|
+
case MenuItem.EType.GoogleSearch:
|
|
19061
|
+
rItem.renderManager = new GoogleSearchRenderManager.Manager({
|
|
19062
|
+
item: params.item,
|
|
19063
|
+
monitor: this.sharedMonitor,
|
|
19064
|
+
register: this.visualsRegister,
|
|
19065
|
+
viewer: this.viewer,
|
|
19066
|
+
getters: params.getters
|
|
19067
|
+
});
|
|
19068
|
+
break;
|
|
18447
19069
|
// Any "none" type can be ignored. These are just containers for other items.
|
|
18448
19070
|
case MenuItem.EType.None:
|
|
18449
19071
|
break;
|
|
@@ -22504,6 +23126,8 @@ function assertIteration(viewer, iteration) {
|
|
|
22504
23126
|
}
|
|
22505
23127
|
var DEFAULT_BING_KEY = "AqL0uYT5T84jiJeX55_b9zJeeP3MX2p1WLOHH4ljIEPZ7ZL2M81bYLzyYeSwuzzl";
|
|
22506
23128
|
var DEFAULT_MAPBOX_KEY = "pk.eyJ1IjoiYWxleHRodW5kZXIiLCJhIjoiY2psbHJxbnN5MTBvbzNxczZwMHNpeTI0MCJ9.fdoj2QW_7n8RV4e0NCFgZA";
|
|
23129
|
+
var DEFAULT_STAMEN_KEY = "a652e5f2-8d9e-4706-a9d9-d5daa7d4c89e";
|
|
23130
|
+
var DEFAULT_THUNDERFOREST_KEY = "c3c1b64fbb5240be8e0d284a01e33107";
|
|
22507
23131
|
var re = /[\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g;
|
|
22508
23132
|
/**
|
|
22509
23133
|
* Prepares a legacy imagery name for comparison.
|
|
@@ -22705,10 +23329,10 @@ function findKey(apiGetter, keyId, defaultKey) {
|
|
|
22705
23329
|
*/
|
|
22706
23330
|
function renderDefaultMapTile(apiGetter, id) {
|
|
22707
23331
|
return __awaiter(this, void 0, void 0, function () {
|
|
22708
|
-
var CESIUM, provider, _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
22709
|
-
var
|
|
22710
|
-
return __generator(this, function (
|
|
22711
|
-
switch (
|
|
23332
|
+
var CESIUM, provider, _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12;
|
|
23333
|
+
var _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26;
|
|
23334
|
+
return __generator(this, function (_27) {
|
|
23335
|
+
switch (_27.label) {
|
|
22712
23336
|
case 0:
|
|
22713
23337
|
CESIUM = Cesium;
|
|
22714
23338
|
_a = id;
|
|
@@ -22725,210 +23349,230 @@ function renderDefaultMapTile(apiGetter, id) {
|
|
|
22725
23349
|
case ProjectViewTile.EDefaultImagery.OpenStreetMap: return [3 /*break*/, 37];
|
|
22726
23350
|
case ProjectViewTile.EDefaultImagery.LINZ: return [3 /*break*/, 38];
|
|
22727
23351
|
case ProjectViewTile.EDefaultImagery.StamenWaterColor: return [3 /*break*/, 39];
|
|
22728
|
-
case ProjectViewTile.EDefaultImagery.StamenToner: return [3 /*break*/,
|
|
22729
|
-
case ProjectViewTile.EDefaultImagery.ThunderforestCycle: return [3 /*break*/,
|
|
22730
|
-
case ProjectViewTile.EDefaultImagery.ThunderforestTransport: return [3 /*break*/,
|
|
22731
|
-
case ProjectViewTile.EDefaultImagery.ThunderforestLandscape: return [3 /*break*/,
|
|
22732
|
-
case ProjectViewTile.EDefaultImagery.Grid: return [3 /*break*/,
|
|
23352
|
+
case ProjectViewTile.EDefaultImagery.StamenToner: return [3 /*break*/, 41];
|
|
23353
|
+
case ProjectViewTile.EDefaultImagery.ThunderforestCycle: return [3 /*break*/, 43];
|
|
23354
|
+
case ProjectViewTile.EDefaultImagery.ThunderforestTransport: return [3 /*break*/, 45];
|
|
23355
|
+
case ProjectViewTile.EDefaultImagery.ThunderforestLandscape: return [3 /*break*/, 47];
|
|
23356
|
+
case ProjectViewTile.EDefaultImagery.Grid: return [3 /*break*/, 49];
|
|
22733
23357
|
}
|
|
22734
|
-
return [3 /*break*/,
|
|
23358
|
+
return [3 /*break*/, 50];
|
|
22735
23359
|
case 1:
|
|
22736
23360
|
if (!BingMapsImageryProvider.hasOwnProperty("fromUrl")) return [3 /*break*/, 4];
|
|
22737
23361
|
_c = (_b = CESIUM.BingMapsImageryProvider).fromUrl;
|
|
22738
23362
|
_d = ["https://dev.virtualearth.net"];
|
|
22739
|
-
|
|
23363
|
+
_13 = {
|
|
22740
23364
|
mapStyle: BingMapsStyle.AERIAL
|
|
22741
23365
|
};
|
|
22742
23366
|
return [4 /*yield*/, findKey(apiGetter, ProgramKey.EProgramId.BingMaps, DEFAULT_BING_KEY)];
|
|
22743
|
-
case 2: return [4 /*yield*/, _c.apply(_b, _d.concat([(
|
|
22744
|
-
|
|
23367
|
+
case 2: return [4 /*yield*/, _c.apply(_b, _d.concat([(_13.key = _27.sent(),
|
|
23368
|
+
_13)]))];
|
|
22745
23369
|
case 3:
|
|
22746
|
-
provider =
|
|
23370
|
+
provider = _27.sent();
|
|
22747
23371
|
return [3 /*break*/, 6];
|
|
22748
23372
|
case 4:
|
|
22749
23373
|
_f = (_e = CESIUM.BingMapsImageryProvider).bind;
|
|
22750
|
-
|
|
23374
|
+
_14 = {
|
|
22751
23375
|
url: "https://dev.virtualearth.net",
|
|
22752
23376
|
mapStyle: BingMapsStyle.AERIAL
|
|
22753
23377
|
};
|
|
22754
23378
|
return [4 /*yield*/, findKey(apiGetter, ProgramKey.EProgramId.BingMaps, DEFAULT_BING_KEY)];
|
|
22755
23379
|
case 5:
|
|
22756
|
-
provider = new (_f.apply(_e, [void 0, (
|
|
22757
|
-
|
|
22758
|
-
|
|
22759
|
-
case 6: return [3 /*break*/,
|
|
23380
|
+
provider = new (_f.apply(_e, [void 0, (_14.key = _27.sent(),
|
|
23381
|
+
_14)]))();
|
|
23382
|
+
_27.label = 6;
|
|
23383
|
+
case 6: return [3 /*break*/, 50];
|
|
22760
23384
|
case 7:
|
|
22761
23385
|
if (!BingMapsImageryProvider.hasOwnProperty("fromUrl")) return [3 /*break*/, 10];
|
|
22762
23386
|
_h = (_g = CESIUM.BingMapsImageryProvider).fromUrl;
|
|
22763
23387
|
_j = ["https://dev.virtualearth.net"];
|
|
22764
|
-
|
|
23388
|
+
_15 = {
|
|
22765
23389
|
mapStyle: BingMapsStyle.AERIAL_WITH_LABELS
|
|
22766
23390
|
};
|
|
22767
23391
|
return [4 /*yield*/, findKey(apiGetter, ProgramKey.EProgramId.BingMaps, DEFAULT_BING_KEY)];
|
|
22768
|
-
case 8: return [4 /*yield*/, _h.apply(_g, _j.concat([(
|
|
22769
|
-
|
|
23392
|
+
case 8: return [4 /*yield*/, _h.apply(_g, _j.concat([(_15.key = _27.sent(),
|
|
23393
|
+
_15)]))];
|
|
22770
23394
|
case 9:
|
|
22771
|
-
provider =
|
|
23395
|
+
provider = _27.sent();
|
|
22772
23396
|
return [3 /*break*/, 12];
|
|
22773
23397
|
case 10:
|
|
22774
23398
|
_l = (_k = CESIUM.BingMapsImageryProvider).bind;
|
|
22775
|
-
|
|
23399
|
+
_16 = {
|
|
22776
23400
|
url: "https://dev.virtualearth.net",
|
|
22777
23401
|
mapStyle: BingMapsStyle.AERIAL_WITH_LABELS
|
|
22778
23402
|
};
|
|
22779
23403
|
return [4 /*yield*/, findKey(apiGetter, ProgramKey.EProgramId.BingMaps, DEFAULT_BING_KEY)];
|
|
22780
23404
|
case 11:
|
|
22781
|
-
provider = new (_l.apply(_k, [void 0, (
|
|
22782
|
-
|
|
22783
|
-
|
|
22784
|
-
case 12: return [3 /*break*/,
|
|
23405
|
+
provider = new (_l.apply(_k, [void 0, (_16.key = _27.sent(),
|
|
23406
|
+
_16)]))();
|
|
23407
|
+
_27.label = 12;
|
|
23408
|
+
case 12: return [3 /*break*/, 50];
|
|
22785
23409
|
case 13:
|
|
22786
23410
|
if (!BingMapsImageryProvider.hasOwnProperty("fromUrl")) return [3 /*break*/, 16];
|
|
22787
23411
|
_o = (_m = CESIUM.BingMapsImageryProvider).fromUrl;
|
|
22788
23412
|
_p = ["https://dev.virtualearth.net"];
|
|
22789
|
-
|
|
23413
|
+
_17 = {
|
|
22790
23414
|
mapStyle: BingMapsStyle.ROAD_ON_DEMAND
|
|
22791
23415
|
};
|
|
22792
23416
|
return [4 /*yield*/, findKey(apiGetter, ProgramKey.EProgramId.BingMaps, DEFAULT_BING_KEY)];
|
|
22793
|
-
case 14: return [4 /*yield*/, _o.apply(_m, _p.concat([(
|
|
22794
|
-
|
|
23417
|
+
case 14: return [4 /*yield*/, _o.apply(_m, _p.concat([(_17.key = _27.sent(),
|
|
23418
|
+
_17)]))];
|
|
22795
23419
|
case 15:
|
|
22796
|
-
provider =
|
|
23420
|
+
provider = _27.sent();
|
|
22797
23421
|
return [3 /*break*/, 18];
|
|
22798
23422
|
case 16:
|
|
22799
23423
|
_r = (_q = CESIUM.BingMapsImageryProvider).bind;
|
|
22800
|
-
|
|
23424
|
+
_18 = {
|
|
22801
23425
|
url: "https://dev.virtualearth.net",
|
|
22802
23426
|
mapStyle: BingMapsStyle.ROAD_ON_DEMAND
|
|
22803
23427
|
};
|
|
22804
23428
|
return [4 /*yield*/, findKey(apiGetter, ProgramKey.EProgramId.BingMaps, DEFAULT_BING_KEY)];
|
|
22805
23429
|
case 17:
|
|
22806
|
-
provider = new (_r.apply(_q, [void 0, (
|
|
22807
|
-
|
|
22808
|
-
|
|
22809
|
-
case 18: return [3 /*break*/,
|
|
23430
|
+
provider = new (_r.apply(_q, [void 0, (_18.key = _27.sent(),
|
|
23431
|
+
_18)]))();
|
|
23432
|
+
_27.label = 18;
|
|
23433
|
+
case 18: return [3 /*break*/, 50];
|
|
22810
23434
|
case 19:
|
|
22811
23435
|
_t = (_s = MapboxImageryProvider).bind;
|
|
22812
|
-
|
|
23436
|
+
_19 = {
|
|
22813
23437
|
mapId: "mapbox.satellite"
|
|
22814
23438
|
};
|
|
22815
23439
|
return [4 /*yield*/, findKey(apiGetter, ProgramKey.EProgramId.Mapbox, DEFAULT_MAPBOX_KEY)];
|
|
22816
23440
|
case 20:
|
|
22817
|
-
provider = new (_t.apply(_s, [void 0, (
|
|
22818
|
-
|
|
22819
|
-
return [3 /*break*/,
|
|
23441
|
+
provider = new (_t.apply(_s, [void 0, (_19.accessToken = _27.sent(),
|
|
23442
|
+
_19)]))();
|
|
23443
|
+
return [3 /*break*/, 50];
|
|
22820
23444
|
case 21:
|
|
22821
23445
|
_v = (_u = MapboxStyleImageryProvider).bind;
|
|
22822
|
-
|
|
23446
|
+
_20 = {
|
|
22823
23447
|
styleId: "satellite-streets-v11"
|
|
22824
23448
|
};
|
|
22825
23449
|
return [4 /*yield*/, findKey(apiGetter, ProgramKey.EProgramId.Mapbox, DEFAULT_MAPBOX_KEY)];
|
|
22826
23450
|
case 22:
|
|
22827
|
-
provider = new (_v.apply(_u, [void 0, (
|
|
22828
|
-
|
|
22829
|
-
return [3 /*break*/,
|
|
23451
|
+
provider = new (_v.apply(_u, [void 0, (_20.accessToken = _27.sent(),
|
|
23452
|
+
_20)]))();
|
|
23453
|
+
return [3 /*break*/, 50];
|
|
22830
23454
|
case 23:
|
|
22831
23455
|
_x = (_w = MapboxStyleImageryProvider).bind;
|
|
22832
|
-
|
|
23456
|
+
_21 = {
|
|
22833
23457
|
styleId: "streets-v11"
|
|
22834
23458
|
};
|
|
22835
23459
|
return [4 /*yield*/, findKey(apiGetter, ProgramKey.EProgramId.Mapbox, DEFAULT_MAPBOX_KEY)];
|
|
22836
23460
|
case 24:
|
|
22837
|
-
provider = new (_x.apply(_w, [void 0, (
|
|
22838
|
-
|
|
22839
|
-
return [3 /*break*/,
|
|
23461
|
+
provider = new (_x.apply(_w, [void 0, (_21.accessToken = _27.sent(),
|
|
23462
|
+
_21)]))();
|
|
23463
|
+
return [3 /*break*/, 50];
|
|
22840
23464
|
case 25:
|
|
22841
23465
|
if (!ArcGisMapServerImageryProvider.hasOwnProperty("fromUrl")) return [3 /*break*/, 27];
|
|
22842
23466
|
return [4 /*yield*/, CESIUM.ArcGisMapServerImageryProvider.fromUrl("https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer", {
|
|
22843
23467
|
enablePickFeatures: false
|
|
22844
23468
|
})];
|
|
22845
23469
|
case 26:
|
|
22846
|
-
provider =
|
|
23470
|
+
provider = _27.sent();
|
|
22847
23471
|
return [3 /*break*/, 28];
|
|
22848
23472
|
case 27:
|
|
22849
23473
|
provider = new CESIUM.ArcGisMapServerImageryProvider({
|
|
22850
23474
|
url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",
|
|
22851
23475
|
enablePickFeatures: false
|
|
22852
23476
|
});
|
|
22853
|
-
|
|
22854
|
-
case 28: return [3 /*break*/,
|
|
23477
|
+
_27.label = 28;
|
|
23478
|
+
case 28: return [3 /*break*/, 50];
|
|
22855
23479
|
case 29:
|
|
22856
23480
|
if (!ArcGisMapServerImageryProvider.hasOwnProperty("fromUrl")) return [3 /*break*/, 31];
|
|
22857
23481
|
return [4 /*yield*/, CESIUM.ArcGisMapServerImageryProvider.fromUrl("https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer", {
|
|
22858
23482
|
enablePickFeatures: false
|
|
22859
23483
|
})];
|
|
22860
23484
|
case 30:
|
|
22861
|
-
provider =
|
|
23485
|
+
provider = _27.sent();
|
|
22862
23486
|
return [3 /*break*/, 32];
|
|
22863
23487
|
case 31:
|
|
22864
23488
|
provider = new CESIUM.ArcGisMapServerImageryProvider({
|
|
22865
23489
|
url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",
|
|
22866
23490
|
enablePickFeatures: false
|
|
22867
23491
|
});
|
|
22868
|
-
|
|
22869
|
-
case 32: return [3 /*break*/,
|
|
23492
|
+
_27.label = 32;
|
|
23493
|
+
case 32: return [3 /*break*/, 50];
|
|
22870
23494
|
case 33:
|
|
22871
23495
|
if (!CESIUM.ArcGisMapServerImageryProvider.hasOwnProperty("fromUrl")) return [3 /*break*/, 35];
|
|
22872
23496
|
return [4 /*yield*/, CESIUM.ArcGisMapServerImageryProvider.fromUrl("https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/", {
|
|
22873
23497
|
enablePickFeatures: false
|
|
22874
23498
|
})];
|
|
22875
23499
|
case 34:
|
|
22876
|
-
provider =
|
|
23500
|
+
provider = _27.sent();
|
|
22877
23501
|
return [3 /*break*/, 36];
|
|
22878
23502
|
case 35:
|
|
22879
23503
|
provider = new CESIUM.ArcGisMapServerImageryProvider({
|
|
22880
23504
|
url: "https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/",
|
|
22881
23505
|
enablePickFeatures: false
|
|
22882
23506
|
});
|
|
22883
|
-
|
|
22884
|
-
case 36: return [3 /*break*/,
|
|
23507
|
+
_27.label = 36;
|
|
23508
|
+
case 36: return [3 /*break*/, 50];
|
|
22885
23509
|
case 37:
|
|
22886
23510
|
provider = new OpenStreetMapImageryProvider({
|
|
22887
23511
|
url: "https://a.tile.openstreetmap.org/"
|
|
22888
23512
|
});
|
|
22889
|
-
return [3 /*break*/,
|
|
23513
|
+
return [3 /*break*/, 50];
|
|
22890
23514
|
case 38:
|
|
22891
23515
|
provider = new OpenStreetMapImageryProvider({
|
|
22892
23516
|
url: "https://s3-ap-southeast-2.amazonaws.com/digitalnewzealand/PROD/Tilesets/nz-img",
|
|
22893
23517
|
fileExtension: "jpg"
|
|
22894
23518
|
});
|
|
22895
|
-
return [3 /*break*/,
|
|
23519
|
+
return [3 /*break*/, 50];
|
|
22896
23520
|
case 39:
|
|
22897
|
-
|
|
22898
|
-
|
|
22899
|
-
|
|
22900
|
-
|
|
22901
|
-
});
|
|
22902
|
-
return [3 /*break*/, 45];
|
|
23521
|
+
_z = (_y = UrlTemplateImageryProvider).bind;
|
|
23522
|
+
_22 = {};
|
|
23523
|
+
_0 = "https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key=".concat;
|
|
23524
|
+
return [4 /*yield*/, findKey(apiGetter, ProgramKey.EProgramId.StadiaMaps, DEFAULT_STAMEN_KEY)];
|
|
22903
23525
|
case 40:
|
|
22904
|
-
provider = new
|
|
22905
|
-
|
|
22906
|
-
|
|
22907
|
-
|
|
22908
|
-
|
|
22909
|
-
return [3 /*break*/, 45];
|
|
23526
|
+
provider = provider = new (_z.apply(_y, [void 0, (_22.url = _0.apply("https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key=", [_27.sent()]),
|
|
23527
|
+
_22.credit = '© Stadia Maps, © OpenMapTiles © OpenStreetMap contributors',
|
|
23528
|
+
_22.maximumLevel = 16,
|
|
23529
|
+
_22)]))();
|
|
23530
|
+
return [3 /*break*/, 50];
|
|
22910
23531
|
case 41:
|
|
22911
|
-
|
|
22912
|
-
|
|
22913
|
-
|
|
22914
|
-
|
|
22915
|
-
});
|
|
22916
|
-
return [3 /*break*/, 45];
|
|
23532
|
+
_2 = (_1 = UrlTemplateImageryProvider).bind;
|
|
23533
|
+
_23 = {};
|
|
23534
|
+
_3 = "https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key=".concat;
|
|
23535
|
+
return [4 /*yield*/, findKey(apiGetter, ProgramKey.EProgramId.StadiaMaps, DEFAULT_STAMEN_KEY)];
|
|
22917
23536
|
case 42:
|
|
22918
|
-
provider = new
|
|
22919
|
-
|
|
22920
|
-
|
|
22921
|
-
|
|
22922
|
-
|
|
22923
|
-
return [3 /*break*/, 45];
|
|
23537
|
+
provider = new (_2.apply(_1, [void 0, (_23.url = _3.apply("https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key=", [_27.sent()]),
|
|
23538
|
+
_23.credit = '© Stadia Maps, © OpenMapTiles © OpenStreetMap contributors',
|
|
23539
|
+
_23.maximumLevel = 18,
|
|
23540
|
+
_23)]))();
|
|
23541
|
+
return [3 /*break*/, 50];
|
|
22924
23542
|
case 43:
|
|
22925
|
-
|
|
22926
|
-
|
|
22927
|
-
|
|
22928
|
-
|
|
22929
|
-
});
|
|
22930
|
-
return [3 /*break*/, 45];
|
|
23543
|
+
_5 = (_4 = UrlTemplateImageryProvider).bind;
|
|
23544
|
+
_24 = {};
|
|
23545
|
+
_6 = "https://tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=".concat;
|
|
23546
|
+
return [4 /*yield*/, findKey(apiGetter, ProgramKey.EProgramId.Thunderforest, DEFAULT_THUNDERFOREST_KEY)];
|
|
22931
23547
|
case 44:
|
|
23548
|
+
provider = new (_5.apply(_4, [void 0, (_24.url = _6.apply("https://tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=", [_27.sent()]),
|
|
23549
|
+
_24.credit = '© Thunderforest, © OpenStreetMap contributors',
|
|
23550
|
+
_24.maximumLevel = 22,
|
|
23551
|
+
_24)]))();
|
|
23552
|
+
return [3 /*break*/, 50];
|
|
23553
|
+
case 45:
|
|
23554
|
+
_8 = (_7 = UrlTemplateImageryProvider).bind;
|
|
23555
|
+
_25 = {};
|
|
23556
|
+
_9 = "https://tile.thunderforest.com/transport/{z}/{x}/{y}.png?apikey=".concat;
|
|
23557
|
+
return [4 /*yield*/, findKey(apiGetter, ProgramKey.EProgramId.Thunderforest, DEFAULT_THUNDERFOREST_KEY)];
|
|
23558
|
+
case 46:
|
|
23559
|
+
provider = new (_8.apply(_7, [void 0, (_25.url = _9.apply("https://tile.thunderforest.com/transport/{z}/{x}/{y}.png?apikey=", [_27.sent()]),
|
|
23560
|
+
_25.credit = '© Thunderforest, © OpenStreetMap contributors',
|
|
23561
|
+
_25.maximumLevel = 22,
|
|
23562
|
+
_25)]))();
|
|
23563
|
+
return [3 /*break*/, 50];
|
|
23564
|
+
case 47:
|
|
23565
|
+
_11 = (_10 = UrlTemplateImageryProvider).bind;
|
|
23566
|
+
_26 = {};
|
|
23567
|
+
_12 = "https://tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=".concat;
|
|
23568
|
+
return [4 /*yield*/, findKey(apiGetter, ProgramKey.EProgramId.Thunderforest, DEFAULT_THUNDERFOREST_KEY)];
|
|
23569
|
+
case 48:
|
|
23570
|
+
provider = new (_11.apply(_10, [void 0, (_26.url = _12.apply("https://tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=", [_27.sent()]),
|
|
23571
|
+
_26.credit = '© Thunderforest, © OpenStreetMap contributors',
|
|
23572
|
+
_26.maximumLevel = 22,
|
|
23573
|
+
_26)]))();
|
|
23574
|
+
return [3 /*break*/, 50];
|
|
23575
|
+
case 49:
|
|
22932
23576
|
provider = new GridImageryProvider({
|
|
22933
23577
|
tilingScheme: new GeographicTilingScheme(),
|
|
22934
23578
|
cells: 0,
|
|
@@ -22940,8 +23584,8 @@ function renderDefaultMapTile(apiGetter, id) {
|
|
|
22940
23584
|
tileHeight: 256,
|
|
22941
23585
|
canvasSize: 256
|
|
22942
23586
|
});
|
|
22943
|
-
return [3 /*break*/,
|
|
22944
|
-
case
|
|
23587
|
+
return [3 /*break*/, 50];
|
|
23588
|
+
case 50: return [2 /*return*/, provider];
|
|
22945
23589
|
}
|
|
22946
23590
|
});
|
|
22947
23591
|
});
|
|
@@ -24673,7 +25317,7 @@ var ViewRenderEngine;
|
|
|
24673
25317
|
ViewRenderEngine.Render = Render;
|
|
24674
25318
|
})(ViewRenderEngine || (ViewRenderEngine = {}));
|
|
24675
25319
|
|
|
24676
|
-
var VERSION = "4.
|
|
25320
|
+
var VERSION = "4.1.1";
|
|
24677
25321
|
|
|
24678
|
-
export { VERSION, CesiumViewMonitor, ViewerUtils, MenuItemManager, EntityRenderEngine, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, CesiumAnimatedProperty, CesiumAnimatedInOut, Draw3dPolygon, Draw3dPolyline };
|
|
25322
|
+
export { VERSION, CesiumViewMonitor, ViewerUtils, MenuItemManager, EntityRenderEngine, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, GoogleSearchRenderManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, CesiumAnimatedProperty, CesiumAnimatedInOut, Draw3dPolygon, Draw3dPolyline };
|
|
24679
25323
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|