** @ Paramdouble $ x longitude @ paramdouble $ y latitude @ paramdouble $ d distance from the unit of meters @ returnarray * functiongetrange ($ x, $ y, $ d, $ x indicates the longitude of a vertex $ y indicates the latitude of a vertex $ d returns the latitude and longitude range from the distance from the vertex /**
@ Param double $ x longitude
@ Param double $ y latitude
@ Param double $ d Distance unit/Meter
@ Return array
*/
Function getrange ($ x, $ y, $ d ){
}
The above function,
$ X indicates the longitude of a vertex.
$ Y indicates the point latitude
$ D distance from this point
Returns the longitude and latitude range.
Reply content:
/**
@ Param double $ x longitude
@ Param double $ y latitude
@ Param double $ d Distance unit/Meter
@ Return array
*/
Function getrange ($ x, $ y, $ d ){
}
The above function,
$ X indicates the longitude of a vertex.
$ Y indicates the point latitude
$ D distance from this point
Returns the longitude and latitude range.
Go to Google and "calculate the distance between two points by latitude and longitude"
If the precision requirement is not high, you can calculate it by yourself. Do you know the radius of the earth? Longitude divides the earth's surface into 360 equals points, and latitude is divided into 180 equals points. In this way, the longitude and latitude ranges that span are calculated based on the distance and the given center point.
If the precision requirement is high, you 'd better check whether there are any third-party professional interfaces available (such as Google Maps, AMAP maps, Baidu maps)
Isn't that a mathematical problem?