Bounds
Bounds for map viewport
fitBounds
mapInstance.fitBounds(bounds, opt);Parameter
Example
let bounds = {
sw: {lat: 37.457464, lng: 126.899302},
ne: {lat: 37.645804, lng: 127.161728}
}
let opt = {
padding: {
top: 5,
bottom: 5,
right: 15,
left: 15
},
linear: true, // true for “easeTo” false for “flyTo”
maxZoom: 10
}
let opt2 = {
padding: 10 // 10 for top, bottom, right, and left.
}
mapInstance.fitBounds(fit, opt);
mapInstance2.fitBounds(fit, opt2);
getBounds
Return
Last updated
Was this helpful?