Closed joe94113 closed 2 years ago
boundsChanged() {
console.log(
"south:" +
this.$refs.mapRef.$mapObject
.getBounds()
.getSouthWest()
.lat()
);
console.log(
"east:" +
this.$refs.mapRef.$mapObject
.getBounds()
.getNorthEast()
.lng()
);
console.log(
"north:" +
this.$refs.mapRef.$mapObject
.getBounds()
.getNorthEast()
.lat()
);
console.log(
"west:" +
this.$refs.mapRef.$mapObject
.getBounds()
.getSouthWest()
.lng()
);
}
async mounted() {
await this.$gmapApiPromiseLazy();
this.$refs.mapRef.$mapPromise.then((map) => {
const TAIWAN = {
south: 21.682932848786514,
east: 123.51322416331587,
north: 26.007404797220943,
west: 118.28922513987837,
};
map.setRestriction({
latLngBounds: TAIWAN,
strictBounds: false,
});
});
}
What you try to do
Restricting Map Bounds
What is the problem
How to limit map boundaries?
What kind of things have you already treated
Boundary values have been obtained
Steps to reproduce
Os
Mobile
Versions
Package manager
Plugin version