this.myMap.events.add('boundschange', (e) => {
setMapCenter() {
if (this.myMap) {
this.myMap.setCenter(this.getCenterCoord());
}
}
methods: {
getCenterCoord() {
var town = JSON.parse(localStorage.getItem('town'));
return [ town.lat, town.lng ];
},
setMapCenter() {
this.myMap.setCenter(this.getCenterCoord());
}
...
mapShops() {
ymaps.ready(() => {
this.myMap = new ymaps.Map("map", {
center: this.getCenterCoord(),
zoom: 15,
});
})
}
updated() {
this.setMapCenter();
}
Object.assign({}, date, { activities: date.activities.filter(n => n.type_id == types.id) })