@itwin/map-layers-formats 5.11.0-dev.1 → 5.11.0-dev.10
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 +21 -1
- package/README.md +30 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
- package/lib/cjs/ArcGisFeature/EsriSymbology.js.map +1 -1
- package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
- package/lib/cjs/AzureMaps/AzureMaps.d.ts +40 -0
- package/lib/cjs/AzureMaps/AzureMaps.d.ts.map +1 -0
- package/lib/cjs/AzureMaps/AzureMaps.js +124 -0
- package/lib/cjs/AzureMaps/AzureMaps.js.map +1 -0
- package/lib/cjs/AzureMaps/AzureMapsImageryFormat.d.ts +20 -0
- package/lib/cjs/AzureMaps/AzureMapsImageryFormat.d.ts.map +1 -0
- package/lib/cjs/AzureMaps/AzureMapsImageryFormat.js +52 -0
- package/lib/cjs/AzureMaps/AzureMapsImageryFormat.js.map +1 -0
- package/lib/cjs/AzureMaps/AzureMapsImageryProvider.d.ts +24 -0
- package/lib/cjs/AzureMaps/AzureMapsImageryProvider.d.ts.map +1 -0
- package/lib/cjs/AzureMaps/AzureMapsImageryProvider.js +86 -0
- package/lib/cjs/AzureMaps/AzureMapsImageryProvider.js.map +1 -0
- package/lib/cjs/Feature/DefaultMarkerIcon.js +9 -9
- package/lib/cjs/Feature/DefaultMarkerIcon.js.map +1 -1
- package/lib/cjs/Feature/FeatureCanvasRenderer.js.map +1 -1
- package/lib/cjs/Feature/FeatureInfoReader.js.map +1 -1
- package/lib/cjs/Feature/FeatureSymbology.js.map +1 -1
- package/lib/cjs/Feature/RandomMapColor.js.map +1 -1
- package/lib/cjs/GeoJSON/GeoJSONGeometry.js.map +1 -1
- package/lib/cjs/GeoJSON/GeoJSONGeometryReader.js.map +1 -1
- package/lib/cjs/GoogleMaps/GoogleMaps.js.map +1 -1
- package/lib/cjs/GoogleMaps/GoogleMapsImageryFormat.js.map +1 -1
- package/lib/cjs/GoogleMaps/GoogleMapsImageryProvider.js.map +1 -1
- package/lib/cjs/GoogleMaps/GoogleMapsSession.js.map +1 -1
- package/lib/cjs/Icons/MapInfoIcon.js.map +1 -1
- package/lib/cjs/OgcApiFeatures/OgcApiFeaturesFormat.js.map +1 -1
- package/lib/cjs/OgcApiFeatures/OgcApiFeaturesProvider.js.map +1 -1
- package/lib/cjs/OgcApiFeatures/OgcApiFeaturesReader.js.map +1 -1
- package/lib/cjs/Tools/GeometryTerrainDraper.js.map +1 -1
- package/lib/cjs/Tools/MapFeatureInfoDecorator.js.map +1 -1
- package/lib/cjs/Tools/MapFeatureInfoTool.js.map +1 -1
- package/lib/cjs/internal/GoogleMapsUtils.js.map +1 -1
- package/lib/cjs/internal/NativeGoogleMapsSession.js.map +1 -1
- package/lib/cjs/map-layers-formats.d.ts +2 -0
- package/lib/cjs/map-layers-formats.d.ts.map +1 -1
- package/lib/cjs/map-layers-formats.js +2 -0
- package/lib/cjs/map-layers-formats.js.map +1 -1
- package/lib/cjs/mapLayersFormats.d.ts +12 -0
- package/lib/cjs/mapLayersFormats.d.ts.map +1 -1
- package/lib/cjs/mapLayersFormats.js +8 -0
- package/lib/cjs/mapLayersFormats.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
- package/lib/esm/ArcGisFeature/EsriSymbology.js.map +1 -1
- package/lib/esm/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
- package/lib/esm/AzureMaps/AzureMaps.d.ts +40 -0
- package/lib/esm/AzureMaps/AzureMaps.d.ts.map +1 -0
- package/lib/esm/AzureMaps/AzureMaps.js +121 -0
- package/lib/esm/AzureMaps/AzureMaps.js.map +1 -0
- package/lib/esm/AzureMaps/AzureMapsImageryFormat.d.ts +20 -0
- package/lib/esm/AzureMaps/AzureMapsImageryFormat.d.ts.map +1 -0
- package/lib/esm/AzureMaps/AzureMapsImageryFormat.js +48 -0
- package/lib/esm/AzureMaps/AzureMapsImageryFormat.js.map +1 -0
- package/lib/esm/AzureMaps/AzureMapsImageryProvider.d.ts +24 -0
- package/lib/esm/AzureMaps/AzureMapsImageryProvider.d.ts.map +1 -0
- package/lib/esm/AzureMaps/AzureMapsImageryProvider.js +81 -0
- package/lib/esm/AzureMaps/AzureMapsImageryProvider.js.map +1 -0
- package/lib/esm/Feature/DefaultMarkerIcon.js +9 -9
- package/lib/esm/Feature/DefaultMarkerIcon.js.map +1 -1
- package/lib/esm/Feature/FeatureCanvasRenderer.js.map +1 -1
- package/lib/esm/Feature/FeatureInfoReader.js.map +1 -1
- package/lib/esm/Feature/FeatureSymbology.js.map +1 -1
- package/lib/esm/Feature/RandomMapColor.js.map +1 -1
- package/lib/esm/GeoJSON/GeoJSONGeometry.js.map +1 -1
- package/lib/esm/GeoJSON/GeoJSONGeometryReader.js.map +1 -1
- package/lib/esm/GoogleMaps/GoogleMaps.js.map +1 -1
- package/lib/esm/GoogleMaps/GoogleMapsImageryFormat.js.map +1 -1
- package/lib/esm/GoogleMaps/GoogleMapsImageryProvider.js.map +1 -1
- package/lib/esm/GoogleMaps/GoogleMapsSession.js.map +1 -1
- package/lib/esm/Icons/MapInfoIcon.js.map +1 -1
- package/lib/esm/OgcApiFeatures/OgcApiFeaturesFormat.js.map +1 -1
- package/lib/esm/OgcApiFeatures/OgcApiFeaturesProvider.js.map +1 -1
- package/lib/esm/OgcApiFeatures/OgcApiFeaturesReader.js.map +1 -1
- package/lib/esm/Tools/GeometryTerrainDraper.js.map +1 -1
- package/lib/esm/Tools/MapFeatureInfoDecorator.js.map +1 -1
- package/lib/esm/Tools/MapFeatureInfoTool.js.map +1 -1
- package/lib/esm/internal/GoogleMapsUtils.js.map +1 -1
- package/lib/esm/internal/NativeGoogleMapsSession.js.map +1 -1
- package/lib/esm/map-layers-formats.d.ts +2 -0
- package/lib/esm/map-layers-formats.d.ts.map +1 -1
- package/lib/esm/map-layers-formats.js +2 -0
- package/lib/esm/map-layers-formats.js.map +1 -1
- package/lib/esm/mapLayersFormats.d.ts +12 -0
- package/lib/esm/mapLayersFormats.d.ts.map +1 -1
- package/lib/esm/mapLayersFormats.js +8 -0
- package/lib/esm/mapLayersFormats.js.map +1 -1
- package/lib/public/images/GoogleMaps_Logo_Gray.svg +50 -50
- package/lib/public/images/GoogleMaps_Logo_WithDarkOutline.svg +78 -78
- package/lib/public/images/GoogleMaps_Logo_WithLightOutline.svg +78 -78
- package/lib/public/locales/en/mapLayersFormats.json +18 -18
- package/package.json +13 -13
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module MapLayersFormats
|
|
3
|
+
*/
|
|
4
|
+
import { BackgroundMapType, BaseMapLayerSettings, ImageMapLayerSettings } from "@itwin/core-common";
|
|
5
|
+
import { type DisplayStyleState } from "@itwin/core-frontend";
|
|
6
|
+
/**
|
|
7
|
+
* Azure Maps API.
|
|
8
|
+
* @beta
|
|
9
|
+
*/
|
|
10
|
+
export declare const AzureMaps: {
|
|
11
|
+
/**
|
|
12
|
+
* Creates Azure Maps base-layer settings for the supplied basemap type.
|
|
13
|
+
* @beta
|
|
14
|
+
*/
|
|
15
|
+
createBaseLayerSettings: (type: BackgroundMapType) => BaseMapLayerSettings;
|
|
16
|
+
/**
|
|
17
|
+
* Creates any Azure Maps background helper layers required by the supplied basemap type.
|
|
18
|
+
* Hybrid is composed from aerial imagery plus an internal road-labels helper layer.
|
|
19
|
+
* @beta
|
|
20
|
+
*/
|
|
21
|
+
createBackgroundLayers: (type: BackgroundMapType) => ImageMapLayerSettings[];
|
|
22
|
+
/**
|
|
23
|
+
* Removes any Azure Maps helper layers owned by this package from the display style.
|
|
24
|
+
* @beta
|
|
25
|
+
*/
|
|
26
|
+
clearBackgroundLayers: (displayStyle: DisplayStyleState) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Applies the requested Azure Maps basemap to the supplied display style.
|
|
29
|
+
* Preserves the existing base-layer display state, such as visibility and transparency,
|
|
30
|
+
* while replacing the basemap source with the Azure Maps equivalent.
|
|
31
|
+
* @beta
|
|
32
|
+
*/
|
|
33
|
+
applyBackgroundMap: (displayStyle: DisplayStyleState, type: BackgroundMapType) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Identifies the active Azure Maps basemap type for the supplied display style, if any.
|
|
36
|
+
* @beta
|
|
37
|
+
*/
|
|
38
|
+
getBackgroundMapType: (displayStyle: DisplayStyleState) => BackgroundMapType | undefined;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=AzureMaps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AzureMaps.d.ts","sourceRoot":"","sources":["../../../src/AzureMaps/AzureMaps.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAqB,oBAAoB,EAAsB,qBAAqB,EAAgD,MAAM,oBAAoB,CAAC;AACzL,OAAO,EAAE,KAAK,iBAAiB,EAAa,MAAM,sBAAsB,CAAC;AA2CzE;;;GAGG;AAEH,eAAO,MAAM,SAAS;IACpB;;;OAGG;oCAC6B,iBAAiB;IAKjD;;;;OAIG;mCAC4B,iBAAiB;IAMhD;;;OAGG;0CACmC,iBAAiB;IAQvD;;;;;OAKG;uCACgC,iBAAiB,QAAQ,iBAAiB;IAmB7E;;;OAGG;yCACkC,iBAAiB,KAAG,iBAAiB,GAAG,SAAS;CAgBvF,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module MapLayersFormats
|
|
7
|
+
*/
|
|
8
|
+
import { BackgroundMapType, BaseMapLayerSettings, ImageMapLayerSettings } from "@itwin/core-common";
|
|
9
|
+
import { IModelApp } from "@itwin/core-frontend";
|
|
10
|
+
import { AzureMapsMapLayerFormat } from "./AzureMapsImageryFormat.js";
|
|
11
|
+
const streetUrl = "https://atlas.microsoft.com/map/tile?tilesetId=microsoft.base.road";
|
|
12
|
+
const aerialUrl = "https://atlas.microsoft.com/map/tile?tilesetId=microsoft.imagery";
|
|
13
|
+
const roadLabelsUrl = "https://atlas.microsoft.com/map/tile?tilesetId=microsoft.base.labels.road";
|
|
14
|
+
const roadLabelsRole = "roadLabels";
|
|
15
|
+
function assertRegistered() {
|
|
16
|
+
if (!IModelApp.mapLayerFormatRegistry.isRegistered(AzureMapsMapLayerFormat.formatId))
|
|
17
|
+
throw new Error("AzureMaps format is not registered");
|
|
18
|
+
}
|
|
19
|
+
function baseLayerProps(type) {
|
|
20
|
+
switch (type) {
|
|
21
|
+
case BackgroundMapType.Street:
|
|
22
|
+
return { formatId: AzureMapsMapLayerFormat.formatId, name: "Azure Maps: Streets", url: streetUrl };
|
|
23
|
+
case BackgroundMapType.Aerial:
|
|
24
|
+
return { formatId: AzureMapsMapLayerFormat.formatId, name: "Azure Maps: Aerial Imagery", url: aerialUrl };
|
|
25
|
+
case BackgroundMapType.Hybrid:
|
|
26
|
+
return { formatId: AzureMapsMapLayerFormat.formatId, name: "Azure Maps: Hybrid", url: aerialUrl };
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function roadLabelsLayerProps() {
|
|
30
|
+
const properties = { azureMapsRole: roadLabelsRole };
|
|
31
|
+
return {
|
|
32
|
+
formatId: AzureMapsMapLayerFormat.formatId,
|
|
33
|
+
name: "Azure Maps: Road labels",
|
|
34
|
+
url: roadLabelsUrl,
|
|
35
|
+
transparentBackground: true,
|
|
36
|
+
properties,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function isOwnedRoadLabelsLayer(layer) {
|
|
40
|
+
// Identify by format + role marker, not URL: a persisted style created against an older
|
|
41
|
+
// roadLabelsUrl must still be recognized so Hybrid round-trips and cleanup stay correct.
|
|
42
|
+
return layer instanceof ImageMapLayerSettings
|
|
43
|
+
&& layer.formatId === AzureMapsMapLayerFormat.formatId
|
|
44
|
+
&& layer.properties?.azureMapsRole === roadLabelsRole;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Azure Maps API.
|
|
48
|
+
* @beta
|
|
49
|
+
*/
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
51
|
+
export const AzureMaps = {
|
|
52
|
+
/**
|
|
53
|
+
* Creates Azure Maps base-layer settings for the supplied basemap type.
|
|
54
|
+
* @beta
|
|
55
|
+
*/
|
|
56
|
+
createBaseLayerSettings: (type) => {
|
|
57
|
+
assertRegistered();
|
|
58
|
+
return BaseMapLayerSettings.fromJSON(baseLayerProps(type));
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* Creates any Azure Maps background helper layers required by the supplied basemap type.
|
|
62
|
+
* Hybrid is composed from aerial imagery plus an internal road-labels helper layer.
|
|
63
|
+
* @beta
|
|
64
|
+
*/
|
|
65
|
+
createBackgroundLayers: (type) => {
|
|
66
|
+
return type === BackgroundMapType.Hybrid
|
|
67
|
+
? [ImageMapLayerSettings.fromJSON(roadLabelsLayerProps())]
|
|
68
|
+
: [];
|
|
69
|
+
},
|
|
70
|
+
/**
|
|
71
|
+
* Removes any Azure Maps helper layers owned by this package from the display style.
|
|
72
|
+
* @beta
|
|
73
|
+
*/
|
|
74
|
+
clearBackgroundLayers: (displayStyle) => {
|
|
75
|
+
const layers = displayStyle.settings.mapImagery.backgroundLayers;
|
|
76
|
+
for (let index = layers.length - 1; index >= 0; --index) {
|
|
77
|
+
if (isOwnedRoadLabelsLayer(layers[index]))
|
|
78
|
+
displayStyle.detachMapLayerByIndex({ index, isOverlay: false });
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
/**
|
|
82
|
+
* Applies the requested Azure Maps basemap to the supplied display style.
|
|
83
|
+
* Preserves the existing base-layer display state, such as visibility and transparency,
|
|
84
|
+
* while replacing the basemap source with the Azure Maps equivalent.
|
|
85
|
+
* @beta
|
|
86
|
+
*/
|
|
87
|
+
applyBackgroundMap: (displayStyle, type) => {
|
|
88
|
+
assertRegistered();
|
|
89
|
+
AzureMaps.clearBackgroundLayers(displayStyle);
|
|
90
|
+
const azureBaseProps = baseLayerProps(type);
|
|
91
|
+
const previousBase = displayStyle.backgroundMapBase;
|
|
92
|
+
displayStyle.backgroundMapBase = previousBase instanceof BaseMapLayerSettings
|
|
93
|
+
? BaseMapLayerSettings.fromJSON({
|
|
94
|
+
...azureBaseProps,
|
|
95
|
+
visible: previousBase.visible,
|
|
96
|
+
transparency: previousBase.transparency,
|
|
97
|
+
transparentBackground: previousBase.transparentBackground,
|
|
98
|
+
})
|
|
99
|
+
: BaseMapLayerSettings.fromJSON(azureBaseProps);
|
|
100
|
+
for (const layer of AzureMaps.createBackgroundLayers(type))
|
|
101
|
+
displayStyle.attachMapLayer({ mapLayerIndex: { index: -1, isOverlay: false }, settings: layer });
|
|
102
|
+
},
|
|
103
|
+
/**
|
|
104
|
+
* Identifies the active Azure Maps basemap type for the supplied display style, if any.
|
|
105
|
+
* @beta
|
|
106
|
+
*/
|
|
107
|
+
getBackgroundMapType: (displayStyle) => {
|
|
108
|
+
const baseLayer = displayStyle.backgroundMapBase;
|
|
109
|
+
if (!(baseLayer instanceof BaseMapLayerSettings) || baseLayer.formatId !== AzureMapsMapLayerFormat.formatId)
|
|
110
|
+
return undefined;
|
|
111
|
+
if (baseLayer.url === streetUrl)
|
|
112
|
+
return BackgroundMapType.Street;
|
|
113
|
+
if (baseLayer.url === aerialUrl) {
|
|
114
|
+
return displayStyle.settings.mapImagery.backgroundLayers.some(isOwnedRoadLabelsLayer)
|
|
115
|
+
? BackgroundMapType.Hybrid
|
|
116
|
+
: BackgroundMapType.Aerial;
|
|
117
|
+
}
|
|
118
|
+
return undefined;
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=AzureMaps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AzureMaps.js","sourceRoot":"","sources":["../../../src/AzureMaps/AzureMaps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAqB,oBAAoB,EAAsB,qBAAqB,EAAgD,MAAM,oBAAoB,CAAC;AACzL,OAAO,EAA0B,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,MAAM,SAAS,GAAG,oEAAoE,CAAC;AACvF,MAAM,SAAS,GAAG,kEAAkE,CAAC;AACrF,MAAM,aAAa,GAAG,2EAA2E,CAAC;AAClG,MAAM,cAAc,GAAG,YAAY,CAAC;AAEpC,SAAS,gBAAgB;IACvB,IAAI,CAAC,SAAS,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B,EAAE,YAAY,CAAC,qBAAqB;aAC1D,CAAC;YACJ,CAAC,CAAC,oBAAoB,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QAElD,KAAK,MAAM,KAAK,IAAI,SAAS,CAAC,sBAAsB,CAAC,IAAI,CAAC;YACxD,YAAY,CAAC,cAAc,CAAC,EAAE,aAAa,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IACrG,CAAC;IAED;;;OAGG;IACH,oBAAoB,EAAE,CAAC,YAA+B,EAAiC,EAAE;QACvF,MAAM,SAAS,GAAG,YAAY,CAAC,iBAAiB,CAAC;QACjD,IAAI,CAAC,CAAC,SAAS,YAAY,oBAAoB,CAAC,IAAI,SAAS,CAAC,QAAQ,KAAK,uBAAuB,CAAC,QAAQ;YACzG,OAAO,SAAS,CAAC;QAEnB,IAAI,SAAS,CAAC,GAAG,KAAK,SAAS;YAC7B,OAAO,iBAAiB,CAAC,MAAM,CAAC;QAElC,IAAI,SAAS,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;YAChC,OAAO,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,sBAAsB,CAAC;gBACnF,CAAC,CAAC,iBAAiB,CAAC,MAAM;gBAC1B,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC;QAC/B,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module MapLayersFormats\n */\n\nimport { BackgroundMapType, BaseMapLayerProps, BaseMapLayerSettings, ImageMapLayerProps, ImageMapLayerSettings, MapLayerProviderProperties, MapLayerSettings } from \"@itwin/core-common\";\nimport { type DisplayStyleState, IModelApp } from \"@itwin/core-frontend\";\nimport { AzureMapsMapLayerFormat } from \"./AzureMapsImageryFormat.js\";\n\nconst streetUrl = \"https://atlas.microsoft.com/map/tile?tilesetId=microsoft.base.road\";\nconst aerialUrl = \"https://atlas.microsoft.com/map/tile?tilesetId=microsoft.imagery\";\nconst roadLabelsUrl = \"https://atlas.microsoft.com/map/tile?tilesetId=microsoft.base.labels.road\";\nconst roadLabelsRole = \"roadLabels\";\n\nfunction assertRegistered(): void {\n if (!IModelApp.mapLayerFormatRegistry.isRegistered(AzureMapsMapLayerFormat.formatId))\n throw new Error(\"AzureMaps format is not registered\");\n}\n\nfunction baseLayerProps(type: BackgroundMapType): BaseMapLayerProps {\n switch (type) {\n case BackgroundMapType.Street:\n return { formatId: AzureMapsMapLayerFormat.formatId, name: \"Azure Maps: Streets\", url: streetUrl };\n case BackgroundMapType.Aerial:\n return { formatId: AzureMapsMapLayerFormat.formatId, name: \"Azure Maps: Aerial Imagery\", url: aerialUrl };\n case BackgroundMapType.Hybrid:\n return { formatId: AzureMapsMapLayerFormat.formatId, name: \"Azure Maps: Hybrid\", url: aerialUrl };\n }\n}\n\nfunction roadLabelsLayerProps(): ImageMapLayerProps {\n const properties: MapLayerProviderProperties = { azureMapsRole: roadLabelsRole };\n return {\n formatId: AzureMapsMapLayerFormat.formatId,\n name: \"Azure Maps: Road labels\",\n url: roadLabelsUrl,\n transparentBackground: true,\n properties,\n };\n}\n\nfunction isOwnedRoadLabelsLayer(layer: MapLayerSettings): layer is ImageMapLayerSettings {\n // Identify by format + role marker, not URL: a persisted style created against an older\n // roadLabelsUrl must still be recognized so Hybrid round-trips and cleanup stay correct.\n return layer instanceof ImageMapLayerSettings\n && layer.formatId === AzureMapsMapLayerFormat.formatId\n && layer.properties?.azureMapsRole === roadLabelsRole;\n}\n\n/**\n * Azure Maps API.\n * @beta\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const AzureMaps = {\n /**\n * Creates Azure Maps base-layer settings for the supplied basemap type.\n * @beta\n */\n createBaseLayerSettings: (type: BackgroundMapType) => {\n assertRegistered();\n return BaseMapLayerSettings.fromJSON(baseLayerProps(type));\n },\n\n /**\n * Creates any Azure Maps background helper layers required by the supplied basemap type.\n * Hybrid is composed from aerial imagery plus an internal road-labels helper layer.\n * @beta\n */\n createBackgroundLayers: (type: BackgroundMapType) => {\n return type === BackgroundMapType.Hybrid\n ? [ImageMapLayerSettings.fromJSON(roadLabelsLayerProps())]\n : [];\n },\n\n /**\n * Removes any Azure Maps helper layers owned by this package from the display style.\n * @beta\n */\n clearBackgroundLayers: (displayStyle: DisplayStyleState) => {\n const layers = displayStyle.settings.mapImagery.backgroundLayers;\n for (let index = layers.length - 1; index >= 0; --index) {\n if (isOwnedRoadLabelsLayer(layers[index]))\n displayStyle.detachMapLayerByIndex({ index, isOverlay: false });\n }\n },\n\n /**\n * Applies the requested Azure Maps basemap to the supplied display style.\n * Preserves the existing base-layer display state, such as visibility and transparency,\n * while replacing the basemap source with the Azure Maps equivalent.\n * @beta\n */\n applyBackgroundMap: (displayStyle: DisplayStyleState, type: BackgroundMapType) => {\n assertRegistered();\n AzureMaps.clearBackgroundLayers(displayStyle);\n\n const azureBaseProps = baseLayerProps(type);\n const previousBase = displayStyle.backgroundMapBase;\n displayStyle.backgroundMapBase = previousBase instanceof BaseMapLayerSettings\n ? BaseMapLayerSettings.fromJSON({\n ...azureBaseProps,\n visible: previousBase.visible,\n transparency: previousBase.transparency,\n transparentBackground: previousBase.transparentBackground,\n })\n : BaseMapLayerSettings.fromJSON(azureBaseProps);\n\n for (const layer of AzureMaps.createBackgroundLayers(type))\n displayStyle.attachMapLayer({ mapLayerIndex: { index: -1, isOverlay: false }, settings: layer });\n },\n\n /**\n * Identifies the active Azure Maps basemap type for the supplied display style, if any.\n * @beta\n */\n getBackgroundMapType: (displayStyle: DisplayStyleState): BackgroundMapType | undefined => {\n const baseLayer = displayStyle.backgroundMapBase;\n if (!(baseLayer instanceof BaseMapLayerSettings) || baseLayer.formatId !== AzureMapsMapLayerFormat.formatId)\n return undefined;\n\n if (baseLayer.url === streetUrl)\n return BackgroundMapType.Street;\n\n if (baseLayer.url === aerialUrl) {\n return displayStyle.settings.mapImagery.backgroundLayers.some(isOwnedRoadLabelsLayer)\n ? BackgroundMapType.Hybrid\n : BackgroundMapType.Aerial;\n }\n\n return undefined;\n },\n};\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module MapLayersFormats
|
|
3
|
+
*/
|
|
4
|
+
import { ImageMapLayerSettings } from "@itwin/core-common";
|
|
5
|
+
import { ImageryMapLayerFormat, MapLayerImageryProvider, type MapLayerSourceValidation, type ValidateSourceArgs } from "@itwin/core-frontend";
|
|
6
|
+
/**
|
|
7
|
+
* Azure Maps imagery layer format.
|
|
8
|
+
* @beta
|
|
9
|
+
*/
|
|
10
|
+
export declare class AzureMapsMapLayerFormat extends ImageryMapLayerFormat {
|
|
11
|
+
/** Azure Maps imagery layer format.
|
|
12
|
+
* @beta
|
|
13
|
+
*/
|
|
14
|
+
static formatId: string;
|
|
15
|
+
private static validateAzureSourceUrl;
|
|
16
|
+
static validate(args: ValidateSourceArgs): Promise<MapLayerSourceValidation>;
|
|
17
|
+
/** @internal */
|
|
18
|
+
static createImageryProvider(settings: ImageMapLayerSettings): MapLayerImageryProvider | undefined;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=AzureMapsImageryFormat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AzureMapsImageryFormat.d.ts","sourceRoot":"","sources":["../../../src/AzureMaps/AzureMapsImageryFormat.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAa,uBAAuB,EAAwB,KAAK,wBAAwB,EAAE,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAI/K;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,qBAAqB;IAChE;;OAEG;IACH,OAAuB,QAAQ,SAAe;IAE9C,OAAO,CAAC,MAAM,CAAC,sBAAsB;WAiBR,QAAQ,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAYlG,gBAAgB;WACO,qBAAqB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,uBAAuB,GAAG,SAAS;CAGnH"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module MapLayersFormats
|
|
7
|
+
*/
|
|
8
|
+
import { ImageryMapLayerFormat, IModelApp, MapLayerSourceStatus } from "@itwin/core-frontend";
|
|
9
|
+
import { MapLayersFormats } from "../mapLayersFormats.js";
|
|
10
|
+
import { AzureMapsLayerImageryProvider, getAzureMapsSubscriptionKey } from "./AzureMapsImageryProvider.js";
|
|
11
|
+
/**
|
|
12
|
+
* Azure Maps imagery layer format.
|
|
13
|
+
* @beta
|
|
14
|
+
*/
|
|
15
|
+
export class AzureMapsMapLayerFormat extends ImageryMapLayerFormat {
|
|
16
|
+
/** Azure Maps imagery layer format.
|
|
17
|
+
* @beta
|
|
18
|
+
*/
|
|
19
|
+
static formatId = "AzureMaps";
|
|
20
|
+
static validateAzureSourceUrl(url) {
|
|
21
|
+
let parsedUrl;
|
|
22
|
+
try {
|
|
23
|
+
parsedUrl = new URL(url);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return MapLayerSourceStatus.InvalidUrl;
|
|
27
|
+
}
|
|
28
|
+
if (!parsedUrl.protocol.startsWith("http"))
|
|
29
|
+
return MapLayerSourceStatus.InvalidUrl;
|
|
30
|
+
if (parsedUrl.hostname !== "atlas.microsoft.com" || parsedUrl.pathname !== "/map/tile")
|
|
31
|
+
return MapLayerSourceStatus.IncompatibleFormat;
|
|
32
|
+
return parsedUrl.searchParams.has("tilesetId") ? MapLayerSourceStatus.Valid : MapLayerSourceStatus.InvalidUrl;
|
|
33
|
+
}
|
|
34
|
+
static async validate(args) {
|
|
35
|
+
const urlStatus = AzureMapsMapLayerFormat.validateAzureSourceUrl(args.source.url);
|
|
36
|
+
if (urlStatus !== MapLayerSourceStatus.Valid)
|
|
37
|
+
return { status: urlStatus };
|
|
38
|
+
const accessKey = IModelApp.mapLayerFormatRegistry.configOptions.AzureMaps;
|
|
39
|
+
if (undefined === getAzureMapsSubscriptionKey(accessKey, MapLayersFormats.azureMapsOpts?.subscriptionKey))
|
|
40
|
+
return { status: MapLayerSourceStatus.RequireAuth };
|
|
41
|
+
return { status: MapLayerSourceStatus.Valid };
|
|
42
|
+
}
|
|
43
|
+
/** @internal */
|
|
44
|
+
static createImageryProvider(settings) {
|
|
45
|
+
return new AzureMapsLayerImageryProvider(settings, MapLayersFormats.azureMapsOpts?.subscriptionKey);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=AzureMapsImageryFormat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AzureMapsImageryFormat.js","sourceRoot":"","sources":["../../../src/AzureMaps/AzureMapsImageryFormat.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAA2B,oBAAoB,EAA0D,MAAM,sBAAsB,CAAC;AAC/K,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,6BAA6B,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE3G;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,qBAAqB;IAChE;;OAEG;IACI,MAAM,CAAU,QA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AO,IAAI,6BAA6B,CAAC,QAAQ,EAAE,gBAAgB,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;IACtG,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module MapLayersFormats\n */\n\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\nimport { ImageryMapLayerFormat, IModelApp, MapLayerImageryProvider, MapLayerSourceStatus, type MapLayerSourceValidation, type ValidateSourceArgs } from \"@itwin/core-frontend\";\nimport { MapLayersFormats } from \"../mapLayersFormats.js\";\nimport { AzureMapsLayerImageryProvider, getAzureMapsSubscriptionKey } from \"./AzureMapsImageryProvider.js\";\n\n/**\n * Azure Maps imagery layer format.\n * @beta\n */\nexport class AzureMapsMapLayerFormat extends ImageryMapLayerFormat {\n /** Azure Maps imagery layer format.\n * @beta\n */\n public static override formatId = \"AzureMaps\";\n\n private static validateAzureSourceUrl(url: string): MapLayerSourceStatus {\n let parsedUrl: URL;\n try {\n parsedUrl = new URL(url);\n } catch {\n return MapLayerSourceStatus.InvalidUrl;\n }\n\n if (!parsedUrl.protocol.startsWith(\"http\"))\n return MapLayerSourceStatus.InvalidUrl;\n\n if (parsedUrl.hostname !== \"atlas.microsoft.com\" || parsedUrl.pathname !== \"/map/tile\")\n return MapLayerSourceStatus.IncompatibleFormat;\n\n return parsedUrl.searchParams.has(\"tilesetId\") ? MapLayerSourceStatus.Valid : MapLayerSourceStatus.InvalidUrl;\n }\n\n public static override async validate(args: ValidateSourceArgs): Promise<MapLayerSourceValidation> {\n const urlStatus = AzureMapsMapLayerFormat.validateAzureSourceUrl(args.source.url);\n if (urlStatus !== MapLayerSourceStatus.Valid)\n return { status: urlStatus };\n\n const accessKey = IModelApp.mapLayerFormatRegistry.configOptions.AzureMaps;\n if (undefined === getAzureMapsSubscriptionKey(accessKey, MapLayersFormats.azureMapsOpts?.subscriptionKey))\n return { status: MapLayerSourceStatus.RequireAuth };\n\n return { status: MapLayerSourceStatus.Valid };\n }\n\n /** @internal */\n public static override createImageryProvider(settings: ImageMapLayerSettings): MapLayerImageryProvider | undefined {\n return new AzureMapsLayerImageryProvider(settings, MapLayersFormats.azureMapsOpts?.subscriptionKey);\n }\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module MapLayersFormats
|
|
3
|
+
*/
|
|
4
|
+
import { ImageMapLayerSettings, type ImageSource, type MapLayerKey } from "@itwin/core-common";
|
|
5
|
+
import { MapLayerImageryProvider, ScreenViewport } from "@itwin/core-frontend";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export declare const azureMapsSubscriptionKeyParameter = "subscription-key";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export declare function getAzureMapsSubscriptionKey(accessKey: MapLayerKey | undefined, fallbackSubscriptionKey?: string): string | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Azure Maps imagery provider.
|
|
12
|
+
* @beta
|
|
13
|
+
*/
|
|
14
|
+
export declare class AzureMapsLayerImageryProvider extends MapLayerImageryProvider {
|
|
15
|
+
private readonly _subscriptionKey?;
|
|
16
|
+
constructor(settings: ImageMapLayerSettings, _subscriptionKey?: string | undefined);
|
|
17
|
+
private reportAzureAuthFailure;
|
|
18
|
+
loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined>;
|
|
19
|
+
constructUrl(y: number, x: number, zoom: number): Promise<string>;
|
|
20
|
+
/** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [addAttributions] instead. */
|
|
21
|
+
addLogoCards(cards: HTMLTableElement): void;
|
|
22
|
+
addAttributions(cards: HTMLTableElement, _vp: ScreenViewport): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=AzureMapsImageryProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AzureMapsImageryProvider.d.ts","sourceRoot":"","sources":["../../../src/AzureMaps/AzureMapsImageryProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC/F,OAAO,EAAa,uBAAuB,EAA8E,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtK,gBAAgB;AAChB,eAAO,MAAM,iCAAiC,qBAAqB,CAAC;AAEpE,gBAAgB;AAChB,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,WAAW,GAAG,SAAS,EAAE,uBAAuB,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOpI;AAQD;;;GAGG;AACH,qBAAa,6BAA8B,SAAQ,uBAAuB;IACpB,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC;gBAAnE,QAAQ,EAAE,qBAAqB,EAAmB,gBAAgB,CAAC,EAAE,MAAM,YAAA;IAI9F,OAAO,CAAC,sBAAsB;IAWR,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAsB1F,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAQvF,sGAAsG;IACtF,YAAY,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI;IAOrC,eAAe,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAInG"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module MapLayersFormats
|
|
7
|
+
*/
|
|
8
|
+
import { IModelApp, MapLayerImageryProvider, MapLayerImageryProviderStatus, NotifyMessageDetails, OutputMessagePriority } from "@itwin/core-frontend";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const azureMapsSubscriptionKeyParameter = "subscription-key";
|
|
11
|
+
/** @internal */
|
|
12
|
+
export function getAzureMapsSubscriptionKey(accessKey, fallbackSubscriptionKey) {
|
|
13
|
+
// A layer access key takes precedence, but an empty value falls through to the configured fallback
|
|
14
|
+
// rather than disabling auth outright.
|
|
15
|
+
if (accessKey !== undefined && accessKey.value.length > 0)
|
|
16
|
+
return accessKey.value;
|
|
17
|
+
return fallbackSubscriptionKey !== undefined && fallbackSubscriptionKey.length > 0 ? fallbackSubscriptionKey : undefined;
|
|
18
|
+
}
|
|
19
|
+
class AzureMapsRequireAuthError extends Error {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(`Azure Maps requires a non-empty ${azureMapsSubscriptionKeyParameter} credential`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Azure Maps imagery provider.
|
|
26
|
+
* @beta
|
|
27
|
+
*/
|
|
28
|
+
export class AzureMapsLayerImageryProvider extends MapLayerImageryProvider {
|
|
29
|
+
_subscriptionKey;
|
|
30
|
+
constructor(settings, _subscriptionKey) {
|
|
31
|
+
super(settings, true);
|
|
32
|
+
this._subscriptionKey = _subscriptionKey;
|
|
33
|
+
}
|
|
34
|
+
reportAzureAuthFailure() {
|
|
35
|
+
this.setStatus(MapLayerImageryProviderStatus.RequireAuth);
|
|
36
|
+
if (this._hasSuccessfullyFetchedTile) {
|
|
37
|
+
const msg = IModelApp.localization.getLocalizedString("iModelJs:MapLayers.Messages.LoadTileTokenError", { layerName: this._settings.name });
|
|
38
|
+
IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Warning, msg));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// The base loadTile marks `_hasSuccessfullyFetchedTile` as soon as a response is received, before
|
|
42
|
+
// inspecting its status. Azure returns 401/403 for missing/invalid credentials, so this override
|
|
43
|
+
// detects that before the success is recorded, ensuring no spurious token warning on the first fetch.
|
|
44
|
+
async loadTile(row, column, zoomLevel) {
|
|
45
|
+
try {
|
|
46
|
+
const tileUrl = await this.constructUrl(row, column, zoomLevel);
|
|
47
|
+
if (tileUrl.length === 0)
|
|
48
|
+
return undefined;
|
|
49
|
+
const tileResponse = await this.makeTileRequest(tileUrl);
|
|
50
|
+
if (tileResponse.status === 401 || tileResponse.status === 403) {
|
|
51
|
+
this.reportAzureAuthFailure();
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
this._hasSuccessfullyFetchedTile = true;
|
|
55
|
+
return await this.getImageFromTileResponse(tileResponse, zoomLevel);
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
if (error instanceof AzureMapsRequireAuthError)
|
|
59
|
+
this.reportAzureAuthFailure();
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async constructUrl(y, x, zoom) {
|
|
64
|
+
const subscriptionKey = getAzureMapsSubscriptionKey(this._settings.accessKey, this._subscriptionKey);
|
|
65
|
+
if (undefined === subscriptionKey)
|
|
66
|
+
throw new AzureMapsRequireAuthError();
|
|
67
|
+
return `${this._settings.url}&${azureMapsSubscriptionKeyParameter}=${encodeURIComponent(subscriptionKey)}&api-version=2.0&zoom=${zoom}&x=${x}&y=${y}`;
|
|
68
|
+
}
|
|
69
|
+
/** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [addAttributions] instead. */
|
|
70
|
+
addLogoCards(cards) {
|
|
71
|
+
if (!cards.dataset.azureMapsLogoCard) {
|
|
72
|
+
cards.dataset.azureMapsLogoCard = "true";
|
|
73
|
+
cards.appendChild(IModelApp.makeLogoCard({ heading: "Azure Maps", notice: IModelApp.localization.getLocalizedString("iModelJs:BackgroundMap.AzureMapsCopyright") }));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
async addAttributions(cards, _vp) {
|
|
77
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
78
|
+
return Promise.resolve(this.addLogoCards(cards));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=AzureMapsImageryProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AzureMapsImageryProvider.js","sourceRoot":"","sources":["../../../src/AzureMaps/AzureMapsImageryProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,oBAAoB,EAAE,qBAAqB,EAAkB,MAAM,sBAAsB,CAAC;AAEtK,gBAAgB;AAChB,MAAM,CAAC,MAAM,iCAAiC,GAAG,kBAAkB,CAAC;AAEpE,gBAAgB;AAChB,MAAM,UAAU,2BAA2B,CAAC,SAAkC,EAAE,uBAAgC;IAC9G,mGAAmG;IACnG,uCAAuC;IACvC,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;QACvD,OAAO,SAAS,CAAC,KAAK,CAAC;IAEzB,OAAO,uBAAuB,KAAK,SAAS,IAAI,uBAAuB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3H,CAAC;AAED,MAAM,yBAA0B,SAAQ,KAAK;IAC3C;QACE,KAAK,CAAC,mCAAmC,iCAAiC,aAAa,CAAC,CAAC;IAC3F,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,6BAA8B,SAAQ,uBAAuB;IACH;IAArE,YAAmB,QAA+B,EAAmB,gBAAyB;QAC5F,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAD6C,qBAAg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B,CAAC;IACH,CAAC;IAEe,KAAK,CAAC,YAAY,CAAC,CAAS,EAAE,CAAS,EAAE,IAAY;QACnE,MAAM,eAAe,GAAG,2BAA2B,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACrG,IAAI,SAAS,KAAK,eAAe;YAC/B,MAAM,IAAI,yBAAyB,EAAE,CAAC;QAExC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,iCAAiC,IAAI,kBAAkB,CAAC,eAAe,CAAC,yBAAyB,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;IACxJ,CAAC;IAED,sGAAsG;IACtF,YAAY,CAAC,KAAuB;QAClD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC;YACrC,KAAK,CAAC,OAAO,CAAC,iBAAiB,GAAG,MAAM,CAAC;YACzC,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,2CAA2C,CAAC,EAAE,CAAC,CAAC,CAAC;QACvK,CAAC;IACH,CAAC;IAEe,KAAK,CAAC,eAAe,CAAC,KAAuB,EAAE,GAAmB;QAChF,4DAA4D;QAC5D,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IACnD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module MapLayersFormats\n */\n\nimport { ImageMapLayerSettings, type ImageSource, type MapLayerKey } from \"@itwin/core-common\";\nimport { IModelApp, MapLayerImageryProvider, MapLayerImageryProviderStatus, NotifyMessageDetails, OutputMessagePriority, ScreenViewport } from \"@itwin/core-frontend\";\n\n/** @internal */\nexport const azureMapsSubscriptionKeyParameter = \"subscription-key\";\n\n/** @internal */\nexport function getAzureMapsSubscriptionKey(accessKey: MapLayerKey | undefined, fallbackSubscriptionKey?: string): string | undefined {\n // A layer access key takes precedence, but an empty value falls through to the configured fallback\n // rather than disabling auth outright.\n if (accessKey !== undefined && accessKey.value.length > 0)\n return accessKey.value;\n\n return fallbackSubscriptionKey !== undefined && fallbackSubscriptionKey.length > 0 ? fallbackSubscriptionKey : undefined;\n}\n\nclass AzureMapsRequireAuthError extends Error {\n public constructor() {\n super(`Azure Maps requires a non-empty ${azureMapsSubscriptionKeyParameter} credential`);\n }\n}\n\n/**\n * Azure Maps imagery provider.\n * @beta\n */\nexport class AzureMapsLayerImageryProvider extends MapLayerImageryProvider {\n public constructor(settings: ImageMapLayerSettings, private readonly _subscriptionKey?: string) {\n super(settings, true);\n }\n\n private reportAzureAuthFailure(): void {\n this.setStatus(MapLayerImageryProviderStatus.RequireAuth);\n if (this._hasSuccessfullyFetchedTile) {\n const msg = IModelApp.localization.getLocalizedString(\"iModelJs:MapLayers.Messages.LoadTileTokenError\", { layerName: this._settings.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Warning, msg));\n }\n }\n\n // The base loadTile marks `_hasSuccessfullyFetchedTile` as soon as a response is received, before\n // inspecting its status. Azure returns 401/403 for missing/invalid credentials, so this override\n // detects that before the success is recorded, ensuring no spurious token warning on the first fetch.\n public override async loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined> {\n try {\n const tileUrl = await this.constructUrl(row, column, zoomLevel);\n if (tileUrl.length === 0)\n return undefined;\n\n const tileResponse = await this.makeTileRequest(tileUrl);\n if (tileResponse.status === 401 || tileResponse.status === 403) {\n this.reportAzureAuthFailure();\n return undefined;\n }\n\n this._hasSuccessfullyFetchedTile = true;\n return await this.getImageFromTileResponse(tileResponse, zoomLevel);\n } catch (error) {\n if (error instanceof AzureMapsRequireAuthError)\n this.reportAzureAuthFailure();\n\n return undefined;\n }\n }\n\n public override async constructUrl(y: number, x: number, zoom: number): Promise<string> {\n const subscriptionKey = getAzureMapsSubscriptionKey(this._settings.accessKey, this._subscriptionKey);\n if (undefined === subscriptionKey)\n throw new AzureMapsRequireAuthError();\n\n return `${this._settings.url}&${azureMapsSubscriptionKeyParameter}=${encodeURIComponent(subscriptionKey)}&api-version=2.0&zoom=${zoom}&x=${x}&y=${y}`;\n }\n\n /** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [addAttributions] instead. */\n public override addLogoCards(cards: HTMLTableElement): void {\n if (!cards.dataset.azureMapsLogoCard) {\n cards.dataset.azureMapsLogoCard = \"true\";\n cards.appendChild(IModelApp.makeLogoCard({ heading: \"Azure Maps\", notice: IModelApp.localization.getLocalizedString(\"iModelJs:BackgroundMap.AzureMapsCopyright\") }));\n }\n }\n\n public override async addAttributions(cards: HTMLTableElement, _vp: ScreenViewport): Promise<void> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return Promise.resolve(this.addLogoCards(cards));\n }\n}\n"]}
|
|
@@ -6,15 +6,15 @@ import { Base64EncodedString, ColorDef } from "@itwin/core-common";
|
|
|
6
6
|
/** @internal */
|
|
7
7
|
export class DefaultMarkerIcon {
|
|
8
8
|
static getSvgContent(color = ColorDef.fromString("#00AEEF")) {
|
|
9
|
-
return `<?xml version="1.0" encoding="utf-8"?>
|
|
10
|
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
11
|
-
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
12
|
-
viewBox="0 0 365 560" enable-background="new 0 0 365 560" xml:space="preserve">
|
|
13
|
-
<g>
|
|
14
|
-
<path fill="${color.toHexString()}" d="M182.9,551.7c0,0.1,0.2,0.3,0.2,0.3S358.3,283,358.3,194.6c0-130.1-88.8-186.7-175.4-186.9
|
|
15
|
-
C96.3,7.9,7.5,64.5,7.5,194.6c0,88.4,175.3,357.4,175.3,357.4S182.9,551.7,182.9,551.7z M122.2,187.2c0-33.6,27.2-60.8,60.8-60.8
|
|
16
|
-
c33.6,0,60.8,27.2,60.8,60.8S216.5,248,182.9,248C149.4,248,122.2,220.8,122.2,187.2z"/>
|
|
17
|
-
</g>
|
|
9
|
+
return `<?xml version="1.0" encoding="utf-8"?>
|
|
10
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
11
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
12
|
+
viewBox="0 0 365 560" enable-background="new 0 0 365 560" xml:space="preserve">
|
|
13
|
+
<g>
|
|
14
|
+
<path fill="${color.toHexString()}" d="M182.9,551.7c0,0.1,0.2,0.3,0.2,0.3S358.3,283,358.3,194.6c0-130.1-88.8-186.7-175.4-186.9
|
|
15
|
+
C96.3,7.9,7.5,64.5,7.5,194.6c0,88.4,175.3,357.4,175.3,357.4S182.9,551.7,182.9,551.7z M122.2,187.2c0-33.6,27.2-60.8,60.8-60.8
|
|
16
|
+
c33.6,0,60.8,27.2,60.8,60.8S216.5,248,182.9,248C149.4,248,122.2,220.8,122.2,187.2z"/>
|
|
17
|
+
</g>
|
|
18
18
|
</svg>`;
|
|
19
19
|
}
|
|
20
20
|
static getContent(color) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultMarkerIcon.js","sourceRoot":"","sources":["../../../src/Feature/DefaultMarkerIcon.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnE,gBAAgB;AAChB,MAAM,OAAO,iBAAiB;IACpB,MAAM,CAAC,aAAa,CAAC,QAAkB,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC;QAC3E,OAAO;;;;;oBAKS,KAAK,CAAC,WAAW,EAAE;;;;WAI5B,CAAC;IACV,CAAC;IAEM,MAAM,CAAC,UAAU,CAAC,KAAgB;QACvC,OAAO;YACL,WAAW,EAAE,eAAe;YAC5B,SAAS,EAAE,mBAAmB,CAAC,MAAM,CAAC,iBAAiB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;SAC9E,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"DefaultMarkerIcon.js","sourceRoot":"","sources":["../../../src/Feature/DefaultMarkerIcon.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnE,gBAAgB;AAChB,MAAM,OAAO,iBAAiB;IACpB,MAAM,CAAC,aAAa,CAAC,QAAkB,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC;QAC3E,OAAO;;;;;oBAKS,KAAK,CAAC,WAAW,EAAE;;;;WAI5B,CAAC;IACV,CAAC;IAEM,MAAM,CAAC,UAAU,CAAC,KAAgB;QACvC,OAAO;YACL,WAAW,EAAE,eAAe;YAC5B,SAAS,EAAE,mBAAmB,CAAC,MAAM,CAAC,iBAAiB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;SAC9E,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { Base64EncodedString, ColorDef } from \"@itwin/core-common\";\n\n/** @internal */\nexport class DefaultMarkerIcon {\n private static getSvgContent(color: ColorDef = ColorDef.fromString(\"#00AEEF\")) {\n return `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n <!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n <svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 365 560\" enable-background=\"new 0 0 365 560\" xml:space=\"preserve\">\n <g>\n <path fill=\"${color.toHexString()}\" d=\"M182.9,551.7c0,0.1,0.2,0.3,0.2,0.3S358.3,283,358.3,194.6c0-130.1-88.8-186.7-175.4-186.9\n C96.3,7.9,7.5,64.5,7.5,194.6c0,88.4,175.3,357.4,175.3,357.4S182.9,551.7,182.9,551.7z M122.2,187.2c0-33.6,27.2-60.8,60.8-60.8\n c33.6,0,60.8,27.2,60.8,60.8S216.5,248,182.9,248C149.4,248,122.2,220.8,122.2,187.2z\"/>\n </g>\n </svg>`;\n }\n\n public static getContent(color?: ColorDef) {\n return {\n contentType: \"image/svg+xml\",\n imageData: Base64EncodedString.encode(DefaultMarkerIcon.getSvgContent(color)),\n };\n }\n}\n\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureCanvasRenderer.js","sourceRoot":"","sources":["../../../src/Feature/FeatureCanvasRenderer.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,2BAA2B,EAAuD,MAAM,sBAAsB,CAAC;AAIxH,gBAAgB;AAChB,MAAM,OAAO,qBAAsB,SAAQ,2BAA2B;IAC5D,QAAQ,CAA2B;IACnC,OAAO,CAAgC;IAE/C,IAAY,cAAc;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACe,oBAAoB,KAAuC,OAAO,IAAI,CAAC,CAAA,CAAC;IAExF,YAAY,OAAiC,EAAE,MAAqC,EAAE,oBAAgC;QACpH,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAES,SAAS;QACjB,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC5B,CAAC;IAES,SAAS;QACjB,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC5B,CAAC;IAES,MAAM,CAAC,CAAS,EAAE,CAAS;QACnC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7B,CAAC;IAES,MAAM,CAAC,CAAS,EAAE,CAAS;QACnC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7B,CAAC;IAES,KAAK,CAAC,IAAI;QAClB,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;IAES,KAAK,CAAC,MAAM;QACpB,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC7C,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IACzB,CAAC;IAES,KAAK,CAAC,YAAY;IAC5B,CAAC;IAES,KAAK,CAAC,SAAS,CAAC,CAAS,EAAE,CAAS;QAC5C,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"FeatureCanvasRenderer.js","sourceRoot":"","sources":["../../../src/Feature/FeatureCanvasRenderer.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,2BAA2B,EAAuD,MAAM,sBAAsB,CAAC;AAIxH,gBAAgB;AAChB,MAAM,OAAO,qBAAsB,SAAQ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,CAAC,CAAC;IAC9C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { FeatureGeometryBaseRenderer, FeatureSymbolizedRenderer, FeatureSymbologyRenderer } from \"@itwin/core-frontend\";\nimport { Transform } from \"@itwin/core-geometry\";\nimport { ArcGisSymbologyCanvasRenderer } from \"../ArcGisFeature/ArcGisSymbologyRenderer.js\";\n\n/** @internal */\nexport class FeatureCanvasRenderer extends FeatureGeometryBaseRenderer implements FeatureSymbolizedRenderer {\n private _context: CanvasRenderingContext2D;\n private _symbol: ArcGisSymbologyCanvasRenderer;\n\n public get symbolRenderer(): FeatureSymbologyRenderer {\n return this._symbol;\n }\n public override hasSymbologyRenderer(): this is FeatureSymbolizedRenderer {return true;}\n\n constructor(context: CanvasRenderingContext2D, symbol: ArcGisSymbologyCanvasRenderer, world2PixelTransform?: Transform) {\n super(world2PixelTransform);\n this._symbol = symbol;\n this._context = context;\n }\n\n protected beginPath() {\n this._context.beginPath();\n }\n\n protected closePath() {\n this._context.closePath();\n }\n\n protected lineTo(x: number, y: number) {\n this._context.lineTo(x, y);\n }\n\n protected moveTo(x: number, y: number) {\n this._context.moveTo(x, y);\n }\n\n protected async fill() {\n this._symbol.applyFillStyle(this._context);\n this._context.fill();\n }\n\n protected async stroke() {\n this._symbol.applyStrokeStyle(this._context);\n this._context.stroke();\n }\n\n protected async finishPoints() {\n }\n\n protected async drawPoint(x: number, y: number) {\n this._symbol.drawPoint(this._context, x, y);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureInfoReader.js","sourceRoot":"","sources":["../../../src/Feature/FeatureInfoReader.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAc,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEtE;;GAEG;AACH,MAAM,OAAgB,iBAAiB;IAErC,gDAAgD;IACzC,cAAc,CAAmB;IAExC,kDAAkD;IAClD,mEAAmE;IAC5D,0BAA0B,GAAG,KAAK,CAAC;IAEhC,qBAAqB,GAAG,CAAC,KAAa,EAAE,EAAE;QAClD,OAAO,CAAC,IAAI,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IACtG,CAAC,CAAC;IAEQ,eAAe,GAAG,CAAC,QAA2B,EAAE,KAAiC,EAAE,EAAE;QAC7F,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAQ,EAAE,CAAC;QACb,CAAC;aAAM,IAAK,QAAQ,KAAK,iBAAiB,CAAC,QAAQ,IAAI,IAAI,CAAC,0BAA0B,EAAE,CAAC;YACvF,OAAQ,KAAc,CAAC,WAAW,EAAE,CAAC;QACvC,CAAC;aAAM,CAAC;YACN,gEAAgE;YAChE,OAAO,GAAG,KAAK,EAAE,CAAC;QACpB,CAAC;IACH,CAAC,CAAC;CAEH","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"FeatureInfoReader.js","sourceRoot":"","sources":["../../../src/Feature/FeatureInfoReader.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAc,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEtE;;GAEG;AACH,MAAM,OAAgB,iBAAiB;IAErC,gDAAgD;IACzC,cAAc,CAAmB;IAExC,kDAAkD;IAClD,mEAAmE;IAC5D,0BAA0B,GAAG,KAAK,CAAC;IAEhC,qBAAqB,GAAG,CAAC,KAAa,EAAE,EAAE;QAClD,OAAO,CAAC,IAAI,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IACtG,CAAC,CAAC;IAEQ,eAAe,GAAG,CAAC,QAA2B,EAAE,KAAiC,EAAE,EAAE;QAC7F,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAQ,EAAE,CAAC;QACb,CAAC;aAAM,IAAK,QAAQ,KAAK,iBAAiB,CAAC,QAAQ,IAAI,IAAI,CAAC,0BAA0B,EAAE,CAAC;YACvF,OAAQ,KAAc,CAAC,WAAW,EAAE,CAAC;QACvC,CAAC;aAAM,CAAC;YACN,gEAAgE;YAChE,OAAO,GAAG,KAAK,EAAE,CAAC;QACpB,CAAC;IACH,CAAC,CAAC;CAEH","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { Primitives, StandardTypeNames } from \"@itwin/appui-abstract\";\n\n/** Base feature infos reader\n * @internal\n */\nexport abstract class FeatureInfoReader {\n\n // Optionally you can set the floating precision\n public floatPrecision: number|undefined;\n\n // Force display value of date to ISO 8601 format.\n // Turning this ON, will disable display value in end-user's locale\n public forceDateDisplayValueToIso = false;\n\n protected toFixedWithoutPadding = (value: number) => {\n return (this.floatPrecision === undefined ? value : parseFloat(value.toFixed(this.floatPrecision)));\n };\n\n protected getDisplayValue = (typename: StandardTypeNames, value: Primitives.Value|undefined) => {\n if (value === undefined) {\n return \"\";\n } else if ( typename === StandardTypeNames.DateTime && this.forceDateDisplayValueToIso) {\n return (value as Date).toISOString();\n } else {\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n return `${value}`;\n }\n };\n\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureSymbology.js","sourceRoot":"","sources":["../../../src/Feature/FeatureSymbology.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,gBAAgB;AAChB,MAAM,OAAgB,gBAAgB;CAErC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"FeatureSymbology.js","sourceRoot":"","sources":["../../../src/Feature/FeatureSymbology.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,gBAAgB;AAChB,MAAM,OAAgB,gBAAgB;CAErC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @internal */\nexport abstract class FeatureSymbology {\n\n}\n\n/** @internal */\nexport interface FeatureDefaultSymbology {\n getSymbology: (geometryType: string) => FeatureSymbology;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RandomMapColor.js","sourceRoot":"","sources":["../../../src/Feature/RandomMapColor.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,gBAAgB;AAChB,MAAM,OAAO,cAAc;IACjB,MAAM,CAAU,kBAAkB,GAAG;QAC3C,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;KAClG,CAAC;IAEK,QAAQ;QACb,OAAO,cAAc,CAAC,kBAAkB,CAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,cAAc,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;IAClH,CAAC;IAEM,WAAW;QAChB,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9C,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"RandomMapColor.js","sourceRoot":"","sources":["../../../src/Feature/RandomMapColor.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,gBAAgB;AAChB,MAAM,OAAO,cAAc;IACjB,MAAM,CAAU,kBAAkB,GAAG;QAC3C,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;QACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;KAClG,CAAC;IAEK,QAAQ;QACb,OAAO,cAAc,CAAC,kBAAkB,CAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,cAAc,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;IAClH,CAAC;IAEM,WAAW;QAChB,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9C,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { ColorDef } from \"@itwin/core-common\";\n\n/** @internal */\nexport class RandomMapColor {\n private static readonly randomColorPalette = [\n \"#8c510a\", \"#bf812d\", \"#dfc27d\", \"#f6e8c3\", \"#f5f5f5\", \"#c7eae5\", \"#80cdc1\", \"#35978f\", \"#01665e\",\n \"#b2182b\", \"#d6604d\", \"#f4a582\", \"#fddbc7\", \"#f7f7f7\", \"#d1e5f0\", \"#92c5de\", \"#4393c3\", \"#2166ac\",\n \"#d73027\", \"#f46d43\", \"#fdae61\", \"#fee090\", \"#ffffbf\", \"#e0f3f8\", \"#abd9e9\", \"#74add1\", \"#4575b4\",\n \"#a6cee3\", \"#1f78b4\", \"#b2df8a\", \"#33a02c\", \"#fb9a99\", \"#e31c2c\", \"#fdbf6f\", \"#ff7f00\", \"#cab2d6\",\n \"#fbb4ae\", \"#e41a1c\", \"#377eb8\", \"#4daf4a\", \"#984ea3\", \"#ff2000\", \"#ffff33\", \"#a65628\", \"#999999\",\n \"#8dd3c7\", \"#ffffb3\", \"#bebada\", \"#fb8072\", \"#80b1d3\", \"#fdb462\", \"#b3de69\", \"#fccde5\", \"#ffa07a\",\n \"#b15928\", \"#6a3d9a\", \"#ffed6f\", \"#9e0142\", \"#5e4fa2\", \"#999900\", \"#1a9850\", \"#4d4d4d\", \"#6baed6\",\n \"#71c671\", \"#388e8e\", \"#7d9ec0\", \"#7171c6\", \"#8e388e\", \"#8e8e38\", \"#00c957\", \"#cc3333\", \"#d1dbdd\",\n ];\n\n public getColor() {\n return RandomMapColor.randomColorPalette[ Math.floor(Math.random() * RandomMapColor.randomColorPalette.length)];\n }\n\n public getColorDef() {\n return ColorDef.fromString(this.getColor());\n }\n}\n\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeoJSONGeometry.js","sourceRoot":"","sources":["../../../src/GeoJSON/GeoJSONGeometry.ts"],"names":[],"mappings":"AAqBA,gBAAgB;AAChB,MAAM,OAAO,oBAAoB;IACxB,MAAM,CAAC,YAAY,CAAC,IAAsB,IAAG,OAAO,IAAI,CAAC,IAAI,KAAK,YAAY,IAAI,IAAI,CAAC,IAAI,KAAK,iBAAiB,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,CAAA,CAAC;IAC9K,MAAM,CAAC,QAAQ,CAAC,IAAsB,IAAG,OAAQ,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,CAAA,CAAC;IAC1G,MAAM,CAAC,OAAO,CAAC,IAAsB,IAAG,OAAO,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,CAAA,CAAC;CAC5G","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"GeoJSONGeometry.js","sourceRoot":"","sources":["../../../src/GeoJSON/GeoJSONGeometry.ts"],"names":[],"mappings":"AAqBA,gBAAgB;AAChB,MAAM,OAAO,oBAAoB;IACxB,MAAM,CAAC,YAAY,CAAC,IAAsB,IAAG,OAAO,IAAI,CAAC,IAAI,KAAK,YAAY,IAAI,IAAI,CAAC,IAAI,KAAK,iBAAiB,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,CAAA,CAAC;IAC9K,MAAM,CAAC,QAAQ,CAAC,IAAsB,IAAG,OAAQ,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,CAAA,CAAC;IAC1G,MAAM,CAAC,OAAO,CAAC,IAAsB,IAAG,OAAO,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,CAAA,CAAC;CAC5G","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport GeoJson from \"geojson\";\n\n/** @internal */\nexport type Coord = number[];\n\n/** @internal */ // Array of 2 or 3 numbers\nexport type RingCoords = Coord[];\n\n/** @internal */\nexport type MultiRingCoords = RingCoords[];\n\n/** @internal */\nexport interface MultiPath {\n lengths: number[];\n coords: number[];\n}\n\n/** @internal */\nexport class GeoJSONGeometryUtils {\n public static isRingOrPath(geom: GeoJson.Geometry) {return geom.type === \"LineString\" || geom.type === \"MultiLineString\" || geom.type === \"Polygon\" || geom.type === \"MultiPolygon\";}\n public static isFilled(geom: GeoJson.Geometry) {return geom.type === \"Polygon\" || geom.type === \"MultiPolygon\";}\n public static isPoint(geom: GeoJson.Geometry) {return geom.type === \"Point\" || geom.type === \"MultiPoint\";}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeoJSONGeometryReader.js","sourceRoot":"","sources":["../../../src/GeoJSON/GeoJSONGeometryReader.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAA2B,MAAM,sBAAsB,CAAC;AAEnF,OAAO,EAAS,oBAAoB,EAA0C,MAAM,sBAAsB,CAAC;AAE3G,MAAM,cAAc,GAAG,wCAAwC,CAAC;AAEhE,gBAAgB;AAChB,MAAM,OAAO,qBAAqB;IACxB,SAAS,CAA0B;IAE3C,YAAmB,QAAiC;QAClD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,QAA0B;QAElD,IAAI,oBAAoB,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC;YAChD,MAAM,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC7H,CAAC;aAAM,IAAI,oBAAoB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YAClD,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,CAAA,mBAAmB,CAAC,CAAC;QAC5E,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,+DAA+D,QAAQ,CAAC,IAAI,GAAG,CAAC,CAAC;QACnH,C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AAW,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,cAAc,CAAC,CAAC;IACjE,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"GeoJSONGeometryReader.js","sourceRoot":"","sources":["../../../src/GeoJSON/GeoJSONGeometryReader.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAA2B,MAAM,sBAAsB,CAAC;AAEnF,OAAO,EAAS,oBAAoB,EAA0C,MAAM,sBAAsB,CAAC;AAE3G,MAAM,cAAc,GAAG,wCAAwC,CAAC;AAEhE,gBAAgB;AAChB,MAAM,OAAO,qBAAqB;IACxB,SAAS,CAA0B;IAE3C,YAAmB,QAAiC;QAClD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,QAA0B;QAElD,IAAI,oBAAoB,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC;YAChD,MAAM,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC7H,CAAC;aAAM,IAAI,oBAAoB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YAClD,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,CAAA,mBAAmB,CAAC,CAAC;QAC5E,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,+DAA+D,QAAQ,CAAC,IAAI,GAAG,CAAC,CAAC;QACnH,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,iBAAiB,CAAC,QAA0B,EAAE,QAAiC,EAAE,IAAa,EAAE,cAAuB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*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { Logger } from \"@itwin/core-bentley\";\nimport { deflateCoordinates, FeatureGeometryRenderer } from \"@itwin/core-frontend\";\nimport GeoJson from \"geojson\";\nimport { Coord, GeoJSONGeometryUtils, MultiPath, MultiRingCoords, RingCoords } from \"./GeoJSONGeometry.js\";\n\nconst loggerCategory = \"MapLayersFormats.GeoJSONGeometryReader\";\n\n/** @internal */\nexport class GeoJSONGeometryReader {\n private _renderer: FeatureGeometryRenderer;\n\n public constructor(renderer: FeatureGeometryRenderer) {\n this._renderer = renderer;\n }\n\n public async readGeometry(geometry: GeoJson.Geometry) {\n\n if (GeoJSONGeometryUtils.isRingOrPath(geometry)) {\n await this.readRingsAndPaths(geometry, this._renderer, GeoJSONGeometryUtils.isFilled(geometry), false /* relativeCoords*/);\n } else if (GeoJSONGeometryUtils.isPoint(geometry)) {\n await this.readPoints(geometry, this._renderer, false/* relativeCoords*/);\n } else {\n Logger.logError(loggerCategory, `GeoJSONGeometryReader:readGeometry - Unknown geometry type '${geometry.type}'`);\n }\n }\n\n private async readRingsAndPaths(geometry: GeoJson.Geometry, renderer: FeatureGeometryRenderer, fill: boolean, relativeCoords: boolean) {\n const multiPath: MultiPath = {coords: [], lengths: []};\n let polys: MultiPath[] | undefined;\n\n const readPath = (ring: RingCoords, offset: number, result: MultiPath) => {\n const newOffset = deflateCoordinates(ring, result.coords, 2, offset);\n result.lengths.push(ring.length);\n return newOffset;\n };\n\n const readMultiPath = (multiRings: MultiRingCoords, result: MultiPath) => {\n let offset = 0;\n for (const ring of multiRings) {\n offset = readPath(ring, offset, result);\n }\n };\n\n if (geometry.type === \"LineString\") {\n readPath(geometry.coordinates, 0, multiPath);\n } else if (geometry.type === \"MultiLineString\" || geometry.type === \"Polygon\") {\n readMultiPath(geometry.coordinates, multiPath);\n } else if (geometry.type === \"MultiPolygon\") {\n polys = [];\n for (const poly of geometry.coordinates) {\n const tmpMultiPath: MultiPath = {coords: [], lengths: [] };\n readMultiPath(poly, tmpMultiPath);\n polys.push(tmpMultiPath);\n }\n }\n\n if (polys) {\n for (const poly of polys) {\n await renderer.renderPath(poly.lengths, poly.coords, fill, 2, relativeCoords);\n }\n } else {\n await renderer.renderPath(multiPath.lengths, multiPath.coords, fill, 2, relativeCoords);\n }\n\n }\n\n private async readPoints(geom: GeoJson.Geometry, renderer: FeatureGeometryRenderer, relativeCoords: boolean) {\n\n const lengths: Coord = [];\n const coords: Coord = [];\n const readPoint = (coord: Coord) => {\n lengths.push(1);\n coords.push(coord[0]);\n coords.push(coord[1]);\n };\n\n if (geom.type === \"MultiPoint\") {\n geom.coordinates.forEach(readPoint);\n } else if (geom.type === \"Point\") {\n readPoint(geom.coordinates);\n }\n\n await renderer.renderPoint(lengths, coords, 2, relativeCoords);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleMaps.js","sourceRoot":"","sources":["../../../src/GoogleMaps/GoogleMaps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEjF,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGjE;;;EAGE;AACF,gEAAgE;AAChE,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB;;;;;;;;;;;;;MAaE;IACF,sBAAsB,EAAE,CAAC,IAAa,EAAE,IAAqC,EAAE,EAAE;QAC/E,OAAO,qBAAqB,CAAC,QAAQ,CAAC,eAAe,CAAC,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;;;;;;MAaE;IACF,uBAAuB,EAAE,CAAC,IAAqC,EAAE,EAAE;QACjE,OAAO,oBAAoB,CAAC,QAAQ,CAAC,eAAe,CAAC,mBAAmB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC;IAChG,CAAC;IAED;;;;;MAKE;IACF,yBAAyB,EAAE,CAAC,QAA+B,EAAE,EAAE;QAC7D,OAAO,eAAe,CAAC,6BAA6B,CAAC,QAAQ,CAAC,CAAC;IACjE,CAAC;CACF,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"GoogleMaps.js","sourceRoot":"","sources":["../../../src/GoogleMaps/GoogleMaps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEjF,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGjE;;;EAGE;AACF,gEAAgE;AAChE,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB;;;;;;;;;;;;;MAaE;IACF,sBAAsB,EAAE,CAAC,IAAa,EAAE,IAAqC,EAAE,EAAE;QAC/E,OAAO,qBAAqB,CAAC,QAAQ,CAAC,eAAe,CAAC,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;;;;;;MAaE;IACF,uBAAuB,EAAE,CAAC,IAAqC,EAAE,EAAE;QACjE,OAAO,oBAAoB,CAAC,QAAQ,CAAC,eAAe,CAAC,mBAAmB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC;IAChG,CAAC;IAED;;;;;MAKE;IACF,yBAAyB,EAAE,CAAC,QAA+B,EAAE,EAAE;QAC7D,OAAO,eAAe,CAAC,6BAA6B,CAAC,QAAQ,CAAC,CAAC;IACjE,CAAC;CACF,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module MapLayersFormats\n */\n\nimport { BaseMapLayerSettings, ImageMapLayerSettings } from \"@itwin/core-common\";\nimport { GoogleMapsCreateSessionOptions } from \"./GoogleMapsSession.js\";\nimport { GoogleMapsUtils } from \"../internal/GoogleMapsUtils.js\";\n\n\n/**\n * Google Maps API\n * @beta\n*/\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const GoogleMaps = {\n /**\n * Creates Google Maps map-layer settings.\n * @param name Name of the layer (Defaults to \"GoogleMaps\")\n * @param opts Options to create the session (Defaults to satellite map type, English language, US region, and roadmap layer type)\n *\n * The following examples illustrates how a Googles Map layer can be attached to a viewport:\n * ```ts\n * [[include:GoogleMaps_AttachMapLayerSimple]]\n * ```\n * ```ts\n * [[include:GoogleMaps_AttachMapLayerOpts]]\n * ```\n * @beta\n */\n createMapLayerSettings: (name?: string, opts?: GoogleMapsCreateSessionOptions) => {\n return ImageMapLayerSettings.fromJSON(GoogleMapsUtils.createMapLayerProps(name, opts));\n },\n\n /**\n * Creates Google Maps base layer settings.\n * @param name Name of the layer (Defaults to \"GoogleMaps\")\n * @param opts Options to create the session (Defaults to satellite map type, English language, US region, and roadmap layer type)\n *\n * The following examples illustrates how a Google Maps base layer can be set on a viewport:\n * ```ts\n * [[include:GoogleMaps_BaseMapSimple]]\n * ```\n * ```ts\n * [[include:GoogleMaps_BaseMapOpts]]\n * ```\n * @beta\n */\n createBaseLayerSettings: (opts?: GoogleMapsCreateSessionOptions) => {\n return BaseMapLayerSettings.fromJSON(GoogleMapsUtils.createMapLayerProps(\"GoogleMaps\", opts));\n },\n\n /**\n * Read the session options from the map layer settings.\n * @param settings Map layer settings\n * ```\n * @beta\n */\n getMapLayerSessionOptions: (settings: ImageMapLayerSettings) => {\n return GoogleMapsUtils.getSessionOptionsFromMapLayer(settings);\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleMapsImageryFormat.js","sourceRoot":"","sources":["../../../src/GoogleMaps/GoogleMapsImageryFormat.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,qBAAqB,EAA2B,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;;GAGG;AACH,MAAM,OAAO,wBAAyB,SAAQ,qBAAqB;IACjE;;OAEG;IACI,MAAM,CAAU,QAAQ,GAAG,YAAY,CAAC;IAE/C,gBAAgB;IACT,MAAM,CAAU,qBAAqB,CAAC,QAA+B;QAC1E,OAAO,IAAI,yBAAyB,CAAC,QAAQ,EAAE,gBAAgB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;IAClG,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"GoogleMapsImageryFormat.js","sourceRoot":"","sources":["../../../src/GoogleMaps/GoogleMapsImageryFormat.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,qBAAqB,EAA2B,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;;GAGG;AACH,MAAM,OAAO,wBAAyB,SAAQ,qBAAqB;IACjE;;OAEG;IACI,MAAM,CAAU,QAAQ,GAAG,YAAY,CAAC;IAE/C,gBAAgB;IACT,MAAM,CAAU,qBAAqB,CAAC,QAA+B;QAC1E,OAAO,IAAI,yBAAyB,CAAC,QAAQ,EAAE,gBAAgB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;IAClG,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module MapLayersFormats\n */\n\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\nimport { ImageryMapLayerFormat, MapLayerImageryProvider } from \"@itwin/core-frontend\";\nimport { GoogleMapsImageryProvider } from \"./GoogleMapsImageryProvider.js\";\nimport { MapLayersFormats } from \"../mapLayersFormats.js\";\n\n/**\n * Google Maps imagery layer format.\n * @public\n */\nexport class GoogleMapsMapLayerFormat extends ImageryMapLayerFormat {\n /** Google Maps imagery layer format.\n * @public\n */\n public static override formatId = \"GoogleMaps\";\n\n /** @internal */\n public static override createImageryProvider(settings: ImageMapLayerSettings): MapLayerImageryProvider | undefined {\n return new GoogleMapsImageryProvider(settings, MapLayersFormats.googleMapsOpts?.sessionManager);\n }\n}\n"]}
|