ym.modules.provider.LatLngBounds
Overview
Represents a rectangular geographical area on a map.
var southWest = ym.latLng(40.712, -74.227),
northEast = ym.latLng(40.774, -74.125),
bounds = ym.latLngBounds(southWest, northEast);
All leaflet methods that accept LatLng
objects also accept them in simple array and object form (unless otherwise specified). The example above can be written like this:
map.fitBounds([
[40.712, -74.227],
[40.774, -74.125]]);
Initialization
Factory: ym.latLngBounds(southWest, northEast)
Creates a latLngBounds
object by defining the southwest and northeast corners of the rectangle.
Parameter
Name | Description | Data type | Default value |
---|---|---|---|
southWest |
[erforderlich] | LatLng |
|
northEast |
[erforderlich] | LatLng |
Factory: ym.latLngBounds(latlngs)
Creates a latLngBounds
object that is defined by the geographic points it contains. Very useful for zooming the map to fit a certain number of locations with fitBounds.
Parameter
Name | Description | Data type | Default value |
---|---|---|---|
latlngs |
[erforderlich] | LatLng[] |
Methoden
extend(latlng) ab v3
Extends the boundaries so that they contain the specified point or boundaries.
Parameter
Name | Description | Data type | Default value |
---|---|---|---|
latlng |
LatLng oder LatLngBounds |
Return
this
getSouthWest() ab v3
Returns the southwestern point of the border.
Return
LatLng
getNorthEast() ab v3
Returns the northeast point of the border.
Return
LatLng
getNorthWest() ab v3
Returns the northwest point of the border.
Return
LatLng
getSouthEast() ab v3
Returns the southeast point of the border.
Return
LatLng
getWest() ab v3
Returns the western length of the boundaries.
Return
double
getSouth() ab v3
Returns the southern length of the boundaries.
Return
double
getEast() ab v3
Returns the eastern length of the boundaries.
Return
double
getNorth() ab v3
Returns the northern length of the boundaries.
Return
double
getCenter() ab v3
Turns the popup previously bound by the bindPopup method on and off.
Return
LatLng
contains(otherBounds) ab v3
Returns true if the rectangle contains the specified rectangle.
Parameter
Name | Description | Data type | Default value |
---|---|---|---|
latlng |
LatLng |
Return
bool
intersects(otherBounds) ab v3
Returns true if the rectangle intersects the specified boundaries.
Parameter
Name | Description | Data type | Default value |
---|---|---|---|
otherBounds |
LatLngBounds |
Return
bool
equals(otherBounds) ab v3
Returns true if the rectangle matches the specified limits (within a small error limit).
Parameter
Name | Description | Data type | Default value |
---|---|---|---|
otherBounds |
LatLngBounds |
Return
bool
toBBoxString() ab v3
Returns a string with bounding box coordinates in a format specified as 'southwest longitude,southwest latitude,northeast longitude,northeast latitude'.
Return
string
pad(bufferRatio) ab v3
Returns larger limits created by extending the current limits by a certain percentage in each direction.
Parameter
Name | Description | Data type | Default value |
---|---|---|---|
bufferRatio |
double |
Return
LatLngBounds
isValid() ab v3
Returns true if the limits are correctly initialized.
Return
bool