angular2-yandex-maps icon indicating copy to clipboard operation
angular2-yandex-maps copied to clipboard

Подключение скрипта карт

Open RoundArh opened this issue 7 years ago • 1 comments
trafficstars

Каждая инициализация карты добавляет строку

RoundArh avatar Apr 18 '18 08:04 RoundArh

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()
    }
  }

kodermax avatar May 21 '18 08:05 kodermax