UNPKG
@wayz/react-gl
Version:
latest (0.9.16)
0.9.16
0.9.15
0.9.14
0.9.13
0.9.12
0.9.11
0.9.10
0.9.9
0.9.8
0.9.7
0.9.6
0.9.5
0.9.4
0.9.3
0.9.2
0.9.1
0.9.0
0.8.0
0.7.3
0.7.2
0.7.1
0.7.0
0.6.1
0.6.0
0.5.18
0.5.17
0.5.16
0.5.15
0.5.14
0.5.13
0.5.12
0.5.11
0.5.10
0.5.9
0.5.8
0.5.7
0.5.6
0.5.5
0.5.4
0.5.3
0.5.2
0.5.1
0.5.0
0.4.0
0.3.0
0.2.6
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.10
0.1.9
0.1.8
0.1.7
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
React Component for DeckGL, Base on AMap, Mapbox GL
fe.newayz.com/react-gl
@wayz/react-gl
/
lib
/
components
/
geohash-layer
/
geohash-util.js
19 lines
(18 loc)
•
457 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import Geohash
from
'./latlon-hash'
;
export function
getGeoHashPolygon
(
hash
)
{
// 西南, 东北点坐标
if
(!hash ||
typeof
hash !==
'string'
)
return
;
var
_a = Geohash.bounds(hash), sw = _a.sw, ne = _a.ne;
if
(!sw || !ne)
return
;
return
[ [ [
sw.lon, sw.lat
], [
sw.lon, ne.lat
], [
ne.lon, ne.lat
], [
ne.lon, sw.lat
], [
sw.lon, sw.lat
], ], ]; }