Answer the question
In order to leave comments, you need to log in
How to insert your own 2gis zoom buttons?
I can’t understand in the documentation how to apply the methods, maybe someone has worked with api 2gis or will understand.
api.2gis.ru/doc/maps/ru/manual/base-classes#dgcontrol
Here the getContainer() method is very similar to the fact that you can insert your own layout instead of the standard control.
mounted() {
DG.then(function() {
var map = DG.map("map", {
center: [54.98, 82.89],
zoom: 13,
zoomControl: false,
fullscreenControl: false
});
DG.control.zoom({ position: "topright", }).addTo(map).getContainer('test');
});
},
Answer the question
In order to leave comments, you need to log in
Make a zoom method:
zoom(change) {
this.map.setZoom(this.map.getZoom() + change);
},
<div @click="zoom(+1)">zoom in</div>
<div @click="zoom(-1)">zoom out</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question