UNPKG
svg-world-map
Version:
latest (1.0.1)
1.0.1
1.0.0
0.2.0
0.1.0
Show a location on a world map.
derhuerst.github.io/svg-world-map/
derhuerst/svg-world-map
svg-world-map
/
projection.js
14 lines
(10 loc)
•
247 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
'use strict'
const
mercator =
require
(
'projections/mercator'
)
const
projection
= (
[lon, lat]
) => {
const
{x, y} =
mercator
({lon, lat}, {
latLimit
:
80
})
return
[ +(x *
100
).
toFixed
(
3
), +(y *
100
).
toFixed
(
3
) ] }
module
.
exports
= projection