上海预案管理平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

201 lines
5.0 KiB

export interface ISelf {
self: any;
discriminator: string;
}
export class ClickOptions {
lnglat: ILngLat
pixel: IPixel
type: string
target: { id: string }
}
type EventCallback = (event?: ClickOptions) => void;
export interface IMap extends ISelf {
on(eventName: string, callback: EventCallback, component?: any);
add(obj: IMarker | ITileLayer | any);
remove(obj: IMarker | ITileLayer | any);
clearMap();
containerToLngLat(e: IPixel): ILngLat; //地图容器像素坐标转经纬度
setCity(city: string);
getCity(callback: Function): any;
setZoom(zoom: number);
setZoomAndCenter(zoom: number, pos: number[]);
getZoom(): number;
setCenter(pos: number[] | ILngLat);
getCenter(): ILngLat;
getBounds(): any;
distance(a: number[], b: number[]): any;
setAdministrativeAreaStyle(component: any, getData?: Function, setData?: Function): any; //自定义 行政区划 样式
}
export interface IMapOptions {
zoom?: number;
zooms?: number[];
}
export interface IMarker extends ISelf {
id: string;
_position: number[];
on(eventName: string, callback: EventCallback, component?: any);
setPosition(x: ILngLat | number[])
setContent(html: string)
setMap();
getLngLatByMarkerEvent(map: IMap, e: any): ILngLat;
}
export class MarkerClusterOptions { //聚合物 click 数据类型
cluster: any[]
clusterData: any[]
lnglat: ILngLat
target: any
markers: IMarker[]
}
type MarkerClusterCallback = (event: MarkerClusterOptions) => void;
export interface IMarkerCluster extends ISelf {
on(eventName: string, callback: MarkerClusterCallback, component?: any): void;
setData(list: any[]);
setMaxZoom(zoom: number)
}
type HtmlRender = (...args) => string | HTMLElement;
type PixelRender = (...args) => IPixel;
export interface IRenderClusterMarker {
getFirstImages(context: any): string;
contentRender: HtmlRender;
contentNonRender: HtmlRender;
pixelRender: PixelRender;
pixelNonRender: PixelRender;
}
export class IMarkOptions {
position?: ILngLat | number[];
content?: string;
offset?: IPixel;
map?: IMap;
draggable?: boolean
}
export interface IPixel extends ISelf {
x: number
y: number
getArray(): number[]
}
export interface ILngLat extends ISelf {
typeName: string
lng: number
lat: number
KL: number
kT: number
offset(x: number, y: number): ILngLat
getArray(): number[]
}
export interface ILayer extends ISelf {
}
export interface IIconOptions {
size?: ISize;
imageSize?: ISize;
image?: string;
}
export interface IIcon extends ISelf {
}
export interface ISize extends ISelf {
}
export interface ITileLayer extends ISelf {
Satellite();
RoadNet();
}
export interface IDrivingOptions {
map?: IMap;
policy?: string
showTraffic?: boolean
isOutline?: boolean
}
export class DrivingSearch { //Driving Search() 数据类型
distance: number
time: number
tolls_distance: number
steps: DrivingSearchSteps[]
routes: any[] //伪代码
}
export class DrivingSearchSteps { //Driving Search() Steps 数据类型
instruction: string
orientation: string
road: string
distance: number
time: number
tolls_distance: number
}
type DrivingSearchCallback = (status: string, searchData: DrivingSearch) => void;
export interface IDriving extends ISelf {
clear();
search(component: any, posStart: ILngLat, posEnd: ILngLat, callback: DrivingSearchCallback);
}
export class AutocompleteSearch { //Autocomplete Search() 数据类型
info: string
count: number
tips: AutocompleteSelect[]
}
export class AutocompleteSelect { //GaoDe POI 数据类型
id: string
name: string
adcode: string
district: string
location: ILngLat
type: string
poi: { location: ILngLat }
}
type AutocompleteSearchCallback = (status: string, searchData: AutocompleteSearch) => void;
type AutocompleteSelectCallback = (event: AutocompleteSelect) => void;
export interface IAutocomplete extends ISelf {
search(address: string, callback: AutocompleteSearchCallback)
on(eventName: string, callback: AutocompleteSelectCallback)
}
export class PlaceSearchSearch { //PlaceSearch Search() 数据类型
info: string
poiList: PlaceSearchSearchTips
}
export class PlaceSearchSearchTips { //PlaceSearch Search() 数据类型
pois: AutocompleteSelect[]
pageIndex: number
pageSize: number
count: number
}
type PlaceSearchCallback = (status: string, searchData: PlaceSearchSearch) => void;
export interface IPlaceSearch extends ISelf {
search(text: string, callback: PlaceSearchCallback);
}
export interface IMouseTool extends ISelf {
rule(options: any)
measureArea(options: any)
close(isTrue: boolean)
}
export interface IInfoWindow extends ISelf {
open(map: IMap);
listen(html: any, event: string, callback: Function)
}
export interface ICircle extends ISelf {
setRadius(num: number);
setCenter(pos: number[])
setMap(map: IMap)
}