/** * Properties used to create the IntegrationExtension. */ interface IntegrationExtensionProperties { /** * Scale which is applied on point geometries when zoomTo is called without a scale. */ defaultScale?: number; /** * Indicates if "defaultScale" property should be applied. Default is true. */ useDefaultScale?: boolean; } /** * Options used to zoom to a given geometry. */ interface ZoomOptions { /** * target zoom level e.g. 5 */ zoom?: number; /** * target scale e.g. 5000 */ scale?: number; /** * target rotation e.g. 180 */ rotation?: number; } /** * Extension of IntegrationAPI. */ interface IntegrationExtension { /** * Wait until the map is ready. * Please use this method before calling methods like {@link zoomTo} or {@link highlight}. * @param callback function to be informed when map is ready for change * * @example wait until map is ready * ```ts * api.whenMapReady(function () { * api.zoomTo(geom); * }); * ``` */ whenMapReady(callback: () => any): Promise; /** * Zoom to given geometry. * @param geom an geometry expressed as JSON described * [here](https://developers.arcgis.com/documentation/common-data-types/geometry-objects.htm). * @param options Options used to zoom * * @example zoom to point * ```ts * api.zoomTo( * { * x: 7, * y: 52 * }, * { * scale: 5000 * } * ); * ``` */ zoomTo(geom: any, options?: ZoomOptions): Promise; /** * Highlight a geometry on the map. * The previous highlight will be removed. * * The given geometry can be extended by a * [symbol](https://developers.arcgis.com/documentation/common-data-types/symbol-objects.htm) * and a * [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) property. * * @param geomOrGraphic An geometry or graphic described as JSON. See samples. * * @example Highlight geometry * * ```ts * api.highlight({ * x: 7, * y: 52 * }); * ``` * * @example Highlight geometry with custom symbol * * ```ts * api.highlight({ * geometry: { * x: 7, * y: 52 * }, * symbol: { * type: "simple-marker", * color: [0, 255, 255, 0.25], * size: 16, * outline: { * color: [0, 255, 255, 1], * width: 2 * } * } * }); * ``` * * @example Highlight geometry with custom popupTemplate * * ```ts * api.highlight({ * geometry: { * x: 7, * y: 52 * }, * popupTemplate: { * title: "My City" * } * }); * ``` */ highlight(geomOrGraphic: any): Promise; /** * Remove currently highlighted item from the map. */ clearHighlight(): Promise; } export type { IntegrationExtension, IntegrationExtensionProperties, ZoomOptions };