Open RoundArh opened 6 years ago
public createMap(el: HTMLElement, mapOptions: mapTypes.MapOptions): Promise<void> {
const create = () => setTimeout(() => {
if (ymaps.Map) {
if (mapOptions.searchControl) {
const inputSearch = new ymaps.control.SearchControl(mapOptions.searchControl)
mapOptions.controls.push(inputSearch)
}
const map = new ymaps.Map(el, mapOptions)
this._mapResolver(map as mapTypes.YandexMap)
} else {
create()
}
}, 100)
if (this.checkYaSciptLoaded() === null) {
const res = this._loader.load().then(() => {
create()
}).catch((e) => console.log(e))
return res
} else {
create()
}
}
Каждая инициализация карты добавляет строку