API DOCUMENTATION

Bounds(Fitbounds)
Obtain two coordinate values, north-eastern(ne) and south-western(ne) longitude and latitude, and move them to the center coordinated of the range.

mapInstance.fitBounds( bounds , opt );

Parameter : Fitbounds

Required Parameter Description
bounds Center these bounds in the viewport and use the highest zoom level up to and including Map

Optional Parameter Description
padding The amount of padding in pixels to add to the given bounds.
linear If true , the map transitions using Map#easeTo . If false , the map transitions using Map#flyTo .
maxZoom The maximum zoom level to allow when the map view transitions to the specified bounds.

[ example : fitbounds ]

let fit = {
        sw: {lat: 37.457464, lng: 126.899302},
        ne: {lat: 37.645804, lng: 127.161728}
    }
let opt = {
       top: 10,
       bottom: 10,
       right: 10,
       left: 10
    }
 map.fitBounds(fit,opt);

Bounds(getbounds)
Gets the two coordinate value(north-east, south-west) longitude/latitude) set in ‘fitBounds’.

mapInstance.getBounds( );

[Return : getbounds]
ne / sw coordinate value of LngLatBounds

[ example : getbounds ]

mapInstance.getBounds()
return : ne : {lat: 37.645804, lng: 127.161728}
sw : {lat: 37.457464, lng: 126.899302}