Answer the question
In order to leave comments, you need to log in
What could be the problem with 2gis map initialization for vue?
API is registered in head
<script src="https://maps.api.2gis.ru/2.0/loader.js?pkg=full"></script>
<div ref="cap" style="width:100%; height:100%"></div>
import DG from '2gis-maps'
export default {
data(){
return{
map: null
}
},
mounted(){
this.map = new DG.map(this.$refs.cap, {
center: [36.165658, 51.801861],
zoom: 13,
minZoom: 10,
fullscreenControl: false
});
DG.marker([36.165658, 51.801861], {
}).addTo(this.map);
},
beforeDestroy () {
if (this.map) this.map.remove()
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question