Closed alexmuro closed 4 years ago
If anyone is curious you do it like this
let start = [-73.7562317,42.6525793]
let end = projections['mercator'].invert(projections['albersUsa'](start))
console.log('end', end)
// end [ 16.575216007966475, 5.868032606028572 ]
let startAgain = projections['albersUsa'].invert(projections['mercator'](end))
console.log('start again', startAgain)
// start again [ -73.7562317, 42.6525793 ]
Having successfully created a lovely AlbersUsa map that I can use in a web map, I now want to take coordinates from that map, and transform them back into the standard mercator projection so I can use map clicks to fetch data based on location.
I was hoping the following code would give me the initial coordinates, however it does now.
Is there a correct way to get your initial coordinates by transformation?