M
M
mrfinch272019-11-20 16:25:46
Yandex
mrfinch27, 2019-11-20 16:25:46

Yandex map and HH metro api?

Previously, there was a question Why is the page spinning to the Yandex map?
it turned out that if you remove part of the code

// Создадим панель маршрутизации.
                routePanelControl = new ymaps.control.RoutePanel({
                    options: {
                        // Добавим заголовок панели.
                        showHeader: true,
                        title: 'Расчёт стоимости эвакуации'
                    }
                });

the map is loaded without dots and panels, the page does not rotate - ok
if you remove it
let startingPrice= 2500;
        let routeLength =  null
        fetch('https://api.hh.ru/metro/1').then((resp)=>{
            return resp.json()
        }).then((data)=>{
            // data.lines.map((line)=>{
            //     line.stations.map((station)=>{
            //         _stations.push({
            //             name: station.name,
            //             lat: station.lat,
            //             lng: station.lng
            //         })
            //     })
            // })

the map won't load at all.
tell me, please, what are your ideas?)
when loading the page, it flips to the map, as if there was an anchor

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question