import { HpaasEventKeyMap } from "./types"; import { MapMode, IPickMode } from "./types"; // import "@/utils/logtime"; import EventEmitter from "eventemitter3"; import WFSApi from "./api/wfs"; import IBaseUnit from "./baseUnit/IBaseUnit"; import IHPaaSScene from "./scene/IScene"; export interface IHpaasOptions { mode?: MapMode; //黑白主体,默认 light initPitch?: number; center?: [number, number]; zoom?: number; pickMode?: IPickMode; // 鼠标拾取模式,当生效时,点击对应对象会触发事件及对象信息 mapType?: "gaode" | "mapbox"; // 底图图源,通常公网选择 gaode,内网用 mapbox(无底图) wmsBaseUrl: string; wmsLayers?: { grey: string; dark: string; }; // 自定义的 wmsLayers,如果不传入,则采用默认值 wfsBaseUrl: string; // todo xyzSourceURI?: string; // xyz 类型底图地址 show100meters?: boolean; // 是否显示百米桩图层 showBaseUnit?: boolean; // 是否显示底层路网结构,包括路段+控制点 showBaseUnitMinZoom?: number; // 显示底层路径结构的最小 zoom } export type HPaaSType = "L7" | "OL" | "DECKGL"; interface IHPaaS { type: HPaaSType; /** * Scene实例是否加载完成 */ sceneLoaded: boolean; /** * eventbus,从此处绑定事件 */ events: EventEmitter; /** * 以 传入的 wfsBaseUrl 生成的 wfs 实例,请尽量使用此实例获取 wfs 数据 */ wfsApi: WFSApi; options: IHpaasOptions; baseUnit?: IBaseUnit; scene: IHPaaSScene; /** * 设置底图的主题 */ setDisplayMode: (mode: MapMode) => void; /** * 移动视图到某个区域 */ fitToArea: (areaUid: string) => void; /** * 销毁底图的实例 */ destroy: () => void; } export default IHPaaS;