LatLngBounds.js

  • LatLngBounds()

    LatLngBounds's constructor

  • LatLngBounds.from()

    Converts the two given parameters to a LatLngBounds instance

  • extend()

    Extends the current instance bounds so that it contains the given coordinates or bounds

  • getNorthEast()

    Returns the north-east coordinates of the instance

  • getNorthWest()

    Returns the north-west coordinates of the instance

  • getSouthEast()

    Returns the south-east coordinates of the instance

  • getSouthWest()

    Returns the south-west coordinates of the instance

  • center()

    Returns the coordinates of the center of the current instance

  • getWest()

    Returns the west coordinates of the instance

  • getSouth()

    Returns the south coordinates of the instance

  • getEast()

    Returns the east coordinates of the instance

  • getNorth()

    Returns the north coordinates of the instance

LatLngBounds()


constructor

LatLngBounds class is used to define a boundary based on south-west and north-east coordinates

Parameter Type Description
southWest LatLng The south-west coordinates of the boundary
northEast LatLng The north-east coordinates of the boundary

LatLngBounds.from()


method
static

Converts the two given parameters to a LatLngBounds instance

Parameter Type Description
p1 LatLngBounds | Array The first parameter, it can be an array containing two other arrays with latitude and longitude values, or it can be an array containing two LatLng instances
p2 Array If p1 is not a LatLngBounds instance, p2 is used as the north-east coordinates of the boundary
returns
LatLngBounds - The converted LatLngBounds instance

extend()


method

Extends the current instance bounds so that it contains the given coordinates or bounds

Parameter Type Description
obj LatLng | LatLngBounds The coordinates or the bounds to which to extend
returns
LatLngBounds - The current instance

getNorthEast()


method

Returns the north-east coordinates of the instance

returns
LatLng - The north-east coordinates

getNorthWest()


method

Returns the north-west coordinates of the instance

returns
LatLng - The north-west coordinates

getSouthEast()


method

Returns the south-east coordinates of the instance

returns
LatLng - The south-east coordinates

getSouthWest()


method

Returns the south-west coordinates of the instance

returns
LatLng - The south-west coordinates

center()


method

Returns the coordinates of the center of the current instance

returns
LatLng - The coordinates of the center

getWest()


method

Returns the west coordinates of the instance

returns
LatLng - The west coordinates

getSouth()


method

Returns the south coordinates of the instance

returns
LatLng - The south coordinates

getEast()


method

Returns the east coordinates of the instance

returns
LatLng - The east coordinates

getNorth()


method

Returns the north coordinates of the instance

returns
LatLng - The north coordinates