|
|
@ -1,5 +1,8 @@ |
|
|
|
import { AutocompleteSearchCallback, AutocompleteSelectCallback, 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, HtmlRender, IAutocomplete, ICircle, IDriving, IInfoWindow, ILayer, ILngLat, IMap, IMapOptions, IMarker, IMarkerCluster, IMarkOptions, IMouseTool, IPixel, IPlaceSearch, IRenderClusterMarker, ISelf, ITileLayer, PixelRender, PlaceSearchCallback } from './map' |
|
|
|
import * as ObjectID from 'bson-objectid'; |
|
|
|
import * as ObjectID from 'bson-objectid'; |
|
|
|
|
|
|
|
import { SearchDownList } from './component/SearchDownListPlugins/SearchDownList'; |
|
|
|
|
|
|
|
import { ApplicationRef, ComponentFactoryResolver, Injector, ReflectiveInjector } from '@angular/core'; |
|
|
|
|
|
|
|
import { SearchService } from '@src/app/searchComponent.service'; |
|
|
|
declare var KMap: any; |
|
|
|
declare var KMap: any; |
|
|
|
|
|
|
|
|
|
|
|
class KedaBasic implements ISelf { |
|
|
|
class KedaBasic implements ISelf { |
|
|
@ -314,12 +317,20 @@ export class KedaAutocomplete extends KedaBasic implements IAutocomplete { //Aut |
|
|
|
constructor(options: any, component: any) { |
|
|
|
constructor(options: any, component: any) { |
|
|
|
super(); |
|
|
|
super(); |
|
|
|
this.component = component |
|
|
|
this.component = component |
|
|
|
|
|
|
|
const injector = Injector.create({ |
|
|
|
|
|
|
|
providers: |
|
|
|
|
|
|
|
[{provide: SearchService, deps: [ComponentFactoryResolver,ApplicationRef,Injector]}] |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
injector.get<SearchService>(SearchService).appendComponentToBody(SearchDownList); |
|
|
|
if (options && options.input != undefined) { //绑定input框搜索事件
|
|
|
|
if (options && options.input != undefined) { //绑定input框搜索事件
|
|
|
|
//KedaSearchComponent.instance.addDOMEvent(options.input)
|
|
|
|
this.inputListen(options.input); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
on(eventName: string, callback: AutocompleteSelectCallback) { |
|
|
|
on(eventName: string, callback: AutocompleteSelectCallback) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
inputListen(elementId:string){ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
search(address: string, callback: AutocompleteSearchCallback) { |
|
|
|
search(address: string, callback: AutocompleteSearchCallback) { |
|
|
|
(this.component.map as KeDaMap).self.queryInfoByType({ |
|
|
|
(this.component.map as KeDaMap).self.queryInfoByType({ |
|
|
|