Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make maplayers API public #3745

Merged
merged 15 commits into from
Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 29 additions & 22 deletions common/api/core-common.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ export interface BackgroundMapProps {
useDepthBuffer?: boolean;
}

// @beta
// @public
export class BackgroundMapProvider {
clone(changedProps: BackgroundMapProviderProps): BackgroundMapProvider;
equals(other: BackgroundMapProvider): boolean;
Expand All @@ -419,7 +419,7 @@ export class BackgroundMapProvider {
// @public
export type BackgroundMapProviderName = "BingProvider" | "MapBoxProvider";

// @beta
// @public
export interface BackgroundMapProviderProps {
name?: BackgroundMapProviderName;
type?: BackgroundMapType;
Expand Down Expand Up @@ -472,24 +472,24 @@ export namespace Base64EncodedString {
const replacer: (_name: string, value: any) => any;
}

// @beta
// @public
export type BaseLayerProps = BaseMapLayerProps | ColorDefProps;

// @beta
// @public
export type BaseLayerSettings = BaseMapLayerSettings | ColorDef;

// @beta (undocumented)
// @public (undocumented)
export namespace BaseLayerSettings {
export function fromJSON(props: BaseLayerProps): BaseLayerSettings;
}

// @beta
// @public
export interface BaseMapLayerProps extends ImageMapLayerProps {
// (undocumented)
provider?: BackgroundMapProviderProps;
}

// @beta
// @public
export class BaseMapLayerSettings extends ImageMapLayerSettings {
clone(changedProps: Partial<BaseMapLayerProps>): BaseMapLayerSettings;
// @internal (undocumented)
Expand Down Expand Up @@ -1509,7 +1509,7 @@ export enum CommonLoggerCategory {
RpcInterfaceFrontend = "core-frontend.RpcInterface"
}

// @beta
// @public
export interface CommonMapLayerProps {
name: string;
transparency?: number;
Expand Down Expand Up @@ -4310,17 +4310,18 @@ export interface ImageGraphicProps {
textureId: Id64String;
}

// @beta
// @public
export interface ImageMapLayerProps extends CommonMapLayerProps {
// @internal (undocumented)
accessKey?: MapLayerKey;
formatId: string;
formatId: MapLayerFormatId;
// @internal (undocumented)
modelId?: never;
subLayers?: MapSubLayerProps[];
url: string;
}

// @beta
// @public
export class ImageMapLayerSettings extends MapLayerSettings {
// @internal
protected constructor(props: ImageMapLayerProps);
Expand All @@ -4333,7 +4334,7 @@ export class ImageMapLayerSettings extends MapLayerSettings {
// @internal (undocumented)
displayMatches(other: MapLayerSettings): boolean;
// (undocumented)
readonly formatId: string;
readonly formatId: MapLayerFormatId;
// (undocumented)
static fromJSON(props: ImageMapLayerProps): ImageMapLayerSettings;
getSubLayerChildren(subLayer: MapSubLayerSettings): MapSubLayerSettings[] | undefined;
Expand Down Expand Up @@ -4364,6 +4365,9 @@ export interface ImagePrimitive {
type: "image";
}

// @public
export type ImageryMapLayerFormatId = "ArcGIS" | "BingMaps" | "MapboxImagery" | "TileURL" | "WMS" | "WMTS";

// @public
export class ImageSource {
constructor(data: Uint8Array | string, format: ImageSourceFormat);
Expand Down Expand Up @@ -5086,7 +5090,7 @@ export interface Localization {

export { LogFunction }

// @beta
// @public
export interface MapImageryProps {
// (undocumented)
backgroundBase?: BaseLayerProps;
Expand All @@ -5096,7 +5100,7 @@ export interface MapImageryProps {
overlayLayers?: MapLayerProps[];
}

// @beta
// @public
export class MapImagerySettings {
get backgroundBase(): BaseLayerSettings;
set backgroundBase(base: BaseLayerSettings);
Expand All @@ -5113,18 +5117,21 @@ export class MapImagerySettings {
toJSON(): MapImageryProps;
}

// @beta
// @public
export type MapLayerFormatId = string | ImageryMapLayerFormatId;

// @public
export interface MapLayerKey {
// (undocumented)
key: string;
// (undocumented)
value: string;
}

// @beta
// @public
export type MapLayerProps = ImageMapLayerProps | ModelMapLayerProps;

// @beta
// @public
export abstract class MapLayerSettings {
// @internal
protected constructor(name: string, visible?: boolean, transparency?: number, transparentBackground?: boolean);
Expand Down Expand Up @@ -5154,7 +5161,7 @@ export abstract class MapLayerSettings {
readonly visible: boolean;
}

// @beta
// @public
export interface MapSubLayerProps {
// (undocumented)
children?: SubLayerId[];
Expand All @@ -5170,7 +5177,7 @@ export interface MapSubLayerProps {
visible?: boolean;
}

// @beta
// @public
export class MapSubLayerSettings {
constructor(name: string, title?: string, visible?: boolean, id?: SubLayerId, parent?: SubLayerId, children?: SubLayerId[]);
readonly children?: SubLayerId[];
Expand Down Expand Up @@ -5373,7 +5380,7 @@ export interface ModelLoadProps {
id?: Id64String;
}

// @beta
// @public
export interface ModelMapLayerProps extends CommonMapLayerProps {
// @internal (undocumented)
accessKey?: never;
Expand All @@ -5386,7 +5393,7 @@ export interface ModelMapLayerProps extends CommonMapLayerProps {
url?: never;
}

// @beta
// @public
export class ModelMapLayerSettings extends MapLayerSettings {
// @internal
protected constructor(modelId: Id64String, name: string, visible?: boolean, transparency?: number, transparentBackground?: boolean);
Expand Down Expand Up @@ -8533,7 +8540,7 @@ export interface SubjectProps extends ElementProps {
description?: string;
}

// @beta (undocumented)
// @public (undocumented)
export type SubLayerId = string | number;

// @beta
Expand Down
39 changes: 11 additions & 28 deletions common/api/core-frontend.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ import { Loop } from '@itwin/core-geometry';
import { LowAndHighXY } from '@itwin/core-geometry';
import { LowAndHighXYZ } from '@itwin/core-geometry';
import { Map4d } from '@itwin/core-geometry';
import { MapLayerFormatId } from '@itwin/core-common';
import { MapLayerKey } from '@itwin/core-common';
import { MapLayerProps } from '@itwin/core-common';
import { MapLayerSettings } from '@itwin/core-common';
Expand Down Expand Up @@ -2433,14 +2434,12 @@ export abstract class DisplayStyleState extends ElementState implements DisplayS
constructor(props: DisplayStyleProps, iModel: IModelConnection, source?: DisplayStyleState);
// @internal (undocumented)
anyMapLayersVisible(overlay: boolean): boolean;
attachMapLayer(settings: MapLayerSettings, isOverlay?: boolean, insertIndex?: number): void;
// @internal (undocumented)
attachMapLayer(props: MapLayerProps, isOverlay: boolean, insertIndex?: number): void;
// @internal (undocumented)
attachMapLayerSettings(settings: MapLayerSettings, isOverlay: boolean, insertIndex?: number): void;
attachMapLayerProps(props: MapLayerProps, isOverlay?: boolean, insertIndex?: number): void;
attachRealityModel(props: ContextRealityModelProps): ContextRealityModelState;
get backgroundColor(): ColorDef;
set backgroundColor(val: ColorDef);
// @beta (undocumented)
get backgroundMapBase(): BaseLayerSettings;
set backgroundMapBase(base: BaseLayerSettings);
// @internal (undocumented)
Expand All @@ -2449,25 +2448,20 @@ export abstract class DisplayStyleState extends ElementState implements DisplayS
get backgroundMapLayers(): MapLayerSettings[];
get backgroundMapSettings(): BackgroundMapSettings;
set backgroundMapSettings(settings: BackgroundMapSettings);
// @internal
get baseMapTransparency(): number;
changeBackgroundMapProps(props: BackgroundMapProps): void;
changeBackgroundMapProvider(props: BackgroundMapProviderProps): void;
// @internal (undocumented)
changeBaseMapTransparency(transparency: number): void;
// (undocumented)
changeMapLayerCredentials(index: number, isOverlay: boolean, userName?: string, password?: string): void;
// @internal (undocumented)
changeMapLayerProps(props: Partial<MapLayerProps>, index: number, isOverlay: boolean): void;
// (undocumented)
changeMapSubLayerProps(props: Partial<MapSubLayerProps>, subLayerId: SubLayerId, layerIndex: number, isOverlay: boolean): void;
changeRenderTimeline(timelineId: Id64String | undefined): Promise<void>;
// @internal (undocumented)
static get className(): string;
get contextRealityModelStates(): ReadonlyArray<ContextRealityModelState>;
// @internal (undocumented)
protected createRealityModel(props: ContextRealityModelProps): ContextRealityModelState;
// @internal
detachMapLayerByIndex(index: number, isOverlay: boolean): void;
// @internal (undocumented)
detachMapLayerByNameAndSource(name: string, source: string, isOverlay: boolean): void;
Expand All @@ -2476,7 +2470,6 @@ export abstract class DisplayStyleState extends ElementState implements DisplayS
get displayTerrain(): boolean;
dropSubCategoryOverride(id: Id64String): void;
equalState(other: DisplayStyleState): boolean;
// @internal (undocumented)
findMapLayerIndexByNameAndSource(name: string, source: string, isOverlay: boolean): number;
forEachRealityModel(func: (model: ContextRealityModelState) => void): void;
// @internal (undocumented)
Expand All @@ -2492,7 +2485,6 @@ export abstract class DisplayStyleState extends ElementState implements DisplayS
} | undefined;
// @internal (undocumented)
getIsBackgroundMapVisible(): boolean;
// @internal (undocumented)
getMapLayerRange(layerIndex: number, isOverlay: boolean): Promise<MapCartoRectangle | undefined>;
// @internal (undocumented)
getMapLayers(isOverlay: boolean): MapLayerSettings[];
Expand All @@ -2508,15 +2500,12 @@ export abstract class DisplayStyleState extends ElementState implements DisplayS
get hasSubCategoryOverride(): boolean;
is3d(): this is DisplayStyle3dState;
load(): Promise<void>;
// @internal (undocumented)
// (undocumented)
mapLayerAtIndex(index: number, isOverlay: boolean): MapLayerSettings | undefined;
get monochromeColor(): ColorDef;
set monochromeColor(val: ColorDef);
// @internal
moveMapLayerToBottom(index: number, isOverlay: boolean): void;
// @internal
moveMapLayerToIndex(fromIndex: number, toIndex: number, isOverlay: boolean): void;
// @internal
moveMapLayerToTop(index: number, isOverlay: boolean): void;
get name(): string;
readonly onOSMBuildingDisplayChanged: BeEvent<(osmBuildingDisplayEnabled: boolean) => void>;
Expand Down Expand Up @@ -5562,7 +5551,7 @@ export class MapBoxLayerImageryProvider extends MapLayerImageryProvider {
get tileWidth(): number;
}

// @internal
// @public
export class MapCartoRectangle extends Range2d {
constructor(west?: number, south?: number, east?: number, north?: number);
// (undocumented)
Expand All @@ -5580,7 +5569,7 @@ export class MapCartoRectangle extends Range2d {
fractionFromCartographic(carto: Cartographic): Point2d | undefined;
// (undocumented)
getCenter(result?: Cartographic): Cartographic;
// (undocumented)
// @internal (undocumented)
getTileFractionRange(tilingScheme: MapTilingScheme): Range2d;
// (undocumented)
get globalLocation(): GlobalLocation;
Expand Down Expand Up @@ -5814,13 +5803,13 @@ export interface MapLayerOptions {
MapboxImagery?: MapLayerKey;
}

// @internal
// @public
export class MapLayerSource {
// (undocumented)
baseMap: boolean;
// (undocumented)
formatId: string;
// (undocumented)
// @internal (undocumented)
static fromBackgroundMapProps(props: DeprecatedBackgroundMapProps): MapLayerSource | undefined;
// (undocumented)
static fromJSON(json: MapLayerSourceProps): MapLayerSource | undefined;
Expand Down Expand Up @@ -5867,25 +5856,19 @@ export class MapLayerSources {
static removeLayerByName(name: string): boolean;
}

// @beta (undocumented)
// @public
export enum MapLayerSourceStatus {
// (undocumented)
InvalidCredentials = 1,
// (undocumented)
InvalidFormat = 2,
// (undocumented)
InvalidTileTree = 3,
// (undocumented)
InvalidUrl = 4,
// (undocumented)
RequireAuth = 5,
// (undocumented)
Valid = 0
}

// @beta (undocumented)
// @public (undocumented)
export interface MapLayerSourceValidation {
// (undocumented)
// @beta (undocumented)
authInfo?: MapLayerAuthenticationInfo;
// (undocumented)
status: MapLayerSourceStatus;
Expand Down
Loading