|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
import { AutocompleteSearchCallback, AutocompleteSelectCallback, ClickOptions, DrivingSearchCallback, EventCallback, HtmlRender, IAutocomplete, ICircle, IDriving, IInfoWindow, ILayer, ILngLat, IMap, IMapOptions, IMarker, IMarkerCluster, IMarkOptions, IMouseTool, IPixel, IPlaceSearch, IRenderClusterMarker, ISelf, ITileLayer, PixelRender, PlaceSearchCallback } from './map' |
|
|
|
|
import { AutocompleteSearchCallback, AutocompleteSelectCallback, ClickOptions, DrivingSearchCallback, EventCallback, HtmlRender, IAutocomplete, ICircle, IDriving, IInfoWindow, ILayer, ILngLat, IMap, IMapOptions, IMarker, IMarkerCluster, IMarkOptions, IMouseTool, IPixel, IPlaceSearch, IRenderClusterMarker, ISelf, ITileLayer, MarkerClusterCallback, PixelRender, PlaceSearchCallback } from './map' |
|
|
|
|
import { SearchDownList } from './component/SearchDownListPlugins/SearchDownList'; |
|
|
|
|
import { SearchService } from '@src/app/searchComponent.service'; |
|
|
|
|
import * as ObjectID from 'bson-objectid'; |
|
|
|
@ -495,14 +495,39 @@ export class KedaCircle extends KedaBasic implements ICircle { //圆形 图层
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export class KedaMarkerCluster extends KedaBasic implements IMarkerCluster { //Marker 聚合物
|
|
|
|
|
public map:KeDaMap |
|
|
|
|
public id:string |
|
|
|
|
constructor(map: IMap, list: Object[], options: any) { |
|
|
|
|
super(); |
|
|
|
|
} |
|
|
|
|
on(eventName: string, callback: Function): void { |
|
|
|
|
throw new Error('Method not implemented.'); |
|
|
|
|
this.map = map |
|
|
|
|
} |
|
|
|
|
on(eventName: string, callback: MarkerClusterCallback, component?: any): void { |
|
|
|
|
// 绑定聚合事件时获取信息
|
|
|
|
|
this.map.self.addEventOnLayerObject({ |
|
|
|
|
layerId: this.id, |
|
|
|
|
event: eventName, |
|
|
|
|
handler: (e, info) => { |
|
|
|
|
//查询聚合详情
|
|
|
|
|
if (info.type === 'aggs') { |
|
|
|
|
this.map.self.queryClusterDetail({ |
|
|
|
|
queryOptions: info, |
|
|
|
|
serviceName: 'service_tzn_test7', |
|
|
|
|
maxCount: 999, |
|
|
|
|
callback: function (res) { |
|
|
|
|
console.log(res, '聚合详情'); |
|
|
|
|
callback.call(component,res) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} else if (info.type === 'details') { |
|
|
|
|
console.log(info.data,'聚合详情'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
setData(list: any[]) { |
|
|
|
|
throw new Error('Method not implemented.'); |
|
|
|
|
if (!list.length) { |
|
|
|
|
this.map.self.removeLayer({layerId: this.id}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|