Bounds
AMap.Bounds
Construct a rectangular range object to describe a rectangular range of latitude and longitude on the map
new AMap.Bounds(southWest: LngLat, northEast: LngLat);Parameter
Demo
var southWest = new AMap.LngLat(100.456575, 13.74256); //Latitude and longitude coordinates of the southwest corner
var northEast = new AMap.LngLat(100.518716, 13.762569); //Latitude and longitude coordinates of the northeast corner
var bounds = new AMap.Bounds(southWest, northEast) //Create a latitude and longitude rectangle range for a feature objectMethod
getSouthWest()
Get southwest corner coordinates
return value:(LngLat) Southwest corner coordinates
Demo:
bounds.getSouthWest();getNorthEast()
Get northeast corner coordinates
return value:(LngLat) Northeast corner coordinates
Demo:
bounds.getNorthEast();getNorthWest()
Get northwest corner coordinates
return value:(LngLat) Northwest corner coordinates
Demo:
bounds.getNorthWest();getSouthEast()
Get southeast corner coordinates
return value:(LngLat) Southeast corner coordinates
Demo:
bounds.getSouthEast()contains(obj)
Whether the specified point coordinates are within the rectangle range
Parameter:obj(LngLat) The point coordinates to be specified
return value:(Boolean) Whether it is within the range
Demo:
bounds.contains(new AMap.LngLat(77.193045, 28.59086));getCenter()
Get the latitude and longitude coordinates of the center point of the current Bounds
return value:(LngLat) The latitude and longitude coordinates of the center point of the current Bounds
Demo:
bounds.getCenter();toString()
Returns the rectangular bounds of the map object as a string
return value:(String) rectangular range in string form
Demo:
bounds.toString();