fix: 修复地图动态加载色块的逻辑错误
This commit is contained in:
13
src/utils/geo-utils.js
Normal file
13
src/utils/geo-utils.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import * as turf from '@turf/turf'
|
||||
|
||||
export function generateRectanglePolygon (minLongitude, minLatitude, maxLongitude, maxLatitude) {
|
||||
return turf.polygon([
|
||||
[
|
||||
[minLongitude, minLatitude],
|
||||
[minLongitude, maxLatitude],
|
||||
[maxLongitude, maxLatitude],
|
||||
[maxLongitude, minLatitude],
|
||||
[minLongitude, minLatitude]
|
||||
]
|
||||
])
|
||||
}
|
||||
Reference in New Issue
Block a user