S
S
Svyatoslav Ogievich2020-07-20 14:26:06
JavaScript
Svyatoslav Ogievich, 2020-07-20 14:26:06

Guys, how to delay the initialization of the map?

How to make a delay before 2gis initialization?
I want to do a lazy load.

function map2Gis(){
  DG.then(function() {
    map = DG.map("map", {
        center: [55.72083, 37.637142],
        zoom: 15
    }), DG.marker([55.72083, 37.637142]).addTo(map)
})
}
setTimeout(map2Gis, 12);


But this code doesn't work, please help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
ArtJH, 2020-07-20
@LordDk

setTimeout(map2Gis, 5000);
Delay for 5 seconds

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question