@vertigis/viewer-spec
Version:
VertiGIS Viewer Specification
169 lines (168 loc) • 5.78 kB
TypeScript
import type { GeometryType } from "@vertigis/arcgis-extensions/support/esri";
import type { AreaMeasurementUnits, LengthMeasurementUnits } from "../../app-config/web/MeasurementModelProperties.js";
import type { Command } from "../Command.js";
import { CommandRegistry } from "../CommandRegistry.js";
import type { Event } from "../Event.js";
import { EventRegistry } from "../EventRegistry.js";
import type { Operation } from "../Operation.js";
import { OperationRegistry } from "../OperationRegistry.js";
import type { CreateGraphicsResult, Geometries, HasMaps, HasSymbol, HasUITarget, Maps, SymbolLike } from "../common.js";
import type { DrawingSymbolConfig } from "./drawing.js";
import type { CaptureGeometryArgs, CaptureGeometryResult } from "./sketching.js";
/**
* Arguments for the measurement.get-symbol operation. Only available in
* VertiGIS Studio Web.
*/
export interface GetDefaultSymbolArgs {
/**
* The geometry type for the default symbol to retrieve.
*/
geometryType?: GeometryType;
}
/**
* Arguments for the measurement events. Only available in VertiGIS Studio
* Mobile.
*/
export interface GeometryModeArgs extends HasMaps {
/**
* The geometry mode that is used to perform operations.
*/
geometryMode: "line" | "area";
}
/**
* Result of the "measurement.create-graphics" operation.
*/
export interface CreateMeasurementGraphicsResult extends CreateGraphicsResult {
}
/**
* Event args for the measurement.started and measurement.stopped events.
*/
export interface MeasurementEventArgs {
/**
* The geometry mode of the measurement.
*/
editorGeometryMode: GeometryEditorGeometryMode;
}
/**
* The Geometry Editor geometry mode.
*/
export type GeometryEditorGeometryMode = "Line" | "Area" | "Point";
export declare class MeasurementCommands extends CommandRegistry {
protected readonly _prefix = "measurement";
/**
* Display the measurements settings dialog. This allows you to configure
* measurements system, area and length units. Web only.
*
* @webOnly
*/
get displaySettings(): Command<HasUITarget>;
/**
* Sets the value of the default point, line, or polygon symbol. The symbol
* can be configured with an instance of the Esri symbol or with the Esri
* WebMap JSON. Web only.
*
* @webOnly
*/
get setDefaultSymbol(): Command<SymbolLike | HasSymbol>;
/**
* Sets the area units used for measurements. Set as undefined for units to
* be intelligently selected based on dimensions. Web only.
*
* @webOnly
*/
get setAreaUnits(): Command<AreaMeasurementUnits | undefined>;
/**
* Sets the length units used for measurements. Set as undefined for units
* to be intelligently selected based on dimensions. Web only.
*
* @webOnly
*/
get setLengthUnits(): Command<LengthMeasurementUnits | undefined>;
/**
* Starts drawing a measurement on the map. If a drawing has previously been
* started and stopped it will be resumed. Mobile only.
*
* @mobileOnly
*/
get start(): Command<Maps | void>;
/**
* Stops drawing a measurement on the map. Graphic remains visible and
* drawing can be resumed. Mobile only.
*
* @mobileOnly
*/
get stop(): Command<Maps | void>;
/**
* Stops drawing and clears graphics from the map. Mobile only.
*
* @mobileOnly
*/
get clear(): Command<Maps | void>;
/**
* Sets the geometry mode in use. Mobile only.
*
* @mobileOnly
*/
get setGeometryMode(): Command<GeometryModeArgs>;
}
export declare class MeasurementOperations extends OperationRegistry {
protected readonly _prefix = "measurement";
/**
* Creates graphics out of geometries with the default symbology set by the
* "measurement.set-default-symbol" command'. Web only.
*
* @webOnly
*/
get createGraphics(): Operation<Geometries, CreateMeasurementGraphicsResult>;
/**
* Allows the user to create geometry by sketching on a map with live
* measurement labels. Returns the geometry that was drawn, along with the
* map that it was drawn on. Web only.
*
* @webOnly
*/
get captureGeometry(): Operation<CaptureGeometryArgs, CaptureGeometryResult>;
/**
* Gets the value of the default point, line, or polygon symbol for the
* provided geometry type. Web only.
*
* @webOnly
*/
get getDefaultSymbol(): Operation<GetDefaultSymbolArgs | GeometryType, DrawingSymbolConfig>;
/**
* Gets the value of the default 3D point, line, or polygon symbol for the
* provided geometry type. Web only.
*
* @webOnly
*/
get getDefaultSymbol3D(): Operation<GetDefaultSymbolArgs | GeometryType, DrawingSymbolConfig>;
/**
* Gets the area units used for measurements. If undefined the units will be
* selected intelligently based on dimensions. Web only.
*
* @webOnly
*/
get getAreaUnits(): Operation<void, AreaMeasurementUnits | undefined>;
/**
* Gets the length units used for measurements. If undefined the units will
* be selected intelligently based on dimensions. Web only.
*
* @webOnly
*/
get getLengthUnits(): Operation<void, LengthMeasurementUnits | undefined>;
}
export declare class MeasurementEvents extends EventRegistry {
protected readonly _prefix = "measurement";
/**
* Raised when a measurement is started. Mobile only.
*
* @mobileOnly
*/
get started(): Event<MeasurementEventArgs>;
/**
* Raised when a measurement is stopped. Mobile only.
*
* @mobileOnly
*/
get stopped(): Event<MeasurementEventArgs>;
}