UNPKG

osm-mini-editor

Version:

osm轻量化编辑器,相比较OSM源代码包

131 lines (129 loc) 3.08 kB
import { Params } from '../Utils/interface'; interface Styles { fillLayout?: Params; fillPaint?: Params; lineLayout?: Params; linePaint?: Params; symbolLayout?: Params; symbolPaint?: Params; } export interface MarkerTags { datatype: string; size?: number; d?: string; iconStyle?: string; style?: string; innerHtml?: string; isTouch?: boolean; uuid?: string; wkt?: string; } export interface MarkerOptions { id?: string; locs: [number, number][]; type: 'node' | 'line' | 'area'; tags?: MarkerTags; } export interface OverlayOptions { id: string; name?: string; type?: 'auto' | 'wms' | 'wfs' | 'tms' | 'wmts'; zoomExtent?: [number, number]; template: string; default?: boolean; order?: number; description?: string; styles?: Styles; isTile: boolean; } export interface ToolCallbacks { end: Function; } export interface ToolInfo { id: string; icon: string; title: string; action: Function; disabled: Function; disabledTitle: string; key: string; className?: string; callbacks?: ToolCallbacks; styles?: Params; } export interface UiOptions { showTop?: boolean; showInformation?: boolean; showTools?: boolean; showModes?: boolean; toolsPlacement?: 'right' | 'left' | 'top'; baseTools?: ToolInfo[]; } export interface BaseStyle { glyphs: string; version?: number; sources?: Params; layers?: Params[]; } export interface MapConfigOptions { assetPath?: string; zoom?: number; center?: [number, number]; uiOptions?: UiOptions; useOsm?: boolean; mapboxOptions?: { background?: OverlayOptions; overlayers?: OverlayOptions[]; baseStyle?: BaseStyle; }; } export interface Callbacks { onSave?: Function; onLoadError?: Function; onCtrlRect?: Function; onSelect?: Function; onUnSelect?: Function; onLoadTiels?: Function; onMode?: Function; } export interface SvgConfigs { areaNameKey?: string; } export type MenuId = 'circularize' | 'continue' | 'copy' | 'delete' | 'disconnect' | 'merge' | 'move' | 'orthogonalize' | 'paste' | 'reflect-short' | 'reflect-long' | 'reverse' | 'rotate' | 'split' | 'straighten'; export interface MapConfigs { id: string; options?: MapConfigOptions; tags?: Params; callbacks?: Callbacks; dMap?: Params; svgConfigs?: SvgConfigs; } export interface EntityTagInfo extends Params { datatype: string; } export interface EntitySvgAttrs { size?: number; x?: number; y?: number; style?: string; isFill?: boolean; isTitle?: boolean; title?: string; } export interface MemberInfo { type?: 'way' | 'node'; role?: 'from' | 'to' | 'node'; id: string; } export interface EntityInfo { id: string; type: 'node' | 'way' | 'area'; loc?: [number, number]; locs?: [number, number][]; members?: MemberInfo[]; wkt?: string; attrs?: EntitySvgAttrs; shapeAttrs?: Params; tags: EntityTagInfo; } export {};