N
N
Nikolay Erofeev2016-09-11 20:00:25
JavaScript
Nikolay Erofeev, 2016-09-11 20:00:25

How to dynamically change coordinates in 2gis?

Hello. In the site settings there is a city coordinates item, the city will be determined by these coordinates, but I did not find how to change coordinates in 2gis in api. Only in advance if you write

map = DG.map('map-company', {
            center: [51.1796,71.4475],
            zoom: 11,
        });

I need to change the center and zoom settings that come from my site

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dom1n1k, 2016-09-11
@dom1n1k

2gis uses a slightly tweaked Leaflet under the hood. To be honest, I'm too lazy to go into the documentation now, but as far as I remember, the card has the setCenter and setZoom methods or something like that.

V
Victor L, 2016-09-12
@Fzero0

Yes, everything seems to be there api.2gis.ru/doc/maps/ru/manual/map
Methods for modifying the state of the map
setView( center, zoom, options?)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question