You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on an interactive learning app and I've encountered a tricky use case.
My app uses SVGs projected on a Leaflet map for various reasons.
I'm trying to reconcile features of my map data, namely Russia and Oceania, that have features spanning both sides of the image so I can have all the features visible in one area for the user. This forces me to transpose these features to the other side of the map, but they're left hanging off the standard frame. Unfortunately, when I project the map these features outside the limit are clipped entirely off the data.
I've tried rearranging my commands around this constraint, but Leaflet requires me to use pre-projected data that I can't generate after I've projected and transposed. This also leads me to a lot of big code duplication.
So I guess my question is two-fold:
Is there a way to preserve features outside the limits after a projection?
If that's not the case, is there a way to reproject the coordinates back to the original format?
The text was updated successfully, but these errors were encountered:
I guess I'm looking for a native solution since there's a great round utility function.
For anyone wondering, I decided to -require a custom function that uses the proj4 npm package to convert these values on demand. It's a bit verbose but gets the job done.
Hey mbloch,
I'm working on an interactive learning app and I've encountered a tricky use case.
My app uses SVGs projected on a Leaflet map for various reasons.
I'm trying to reconcile features of my map data, namely Russia and Oceania, that have features spanning both sides of the image so I can have all the features visible in one area for the user. This forces me to transpose these features to the other side of the map, but they're left hanging off the standard frame. Unfortunately, when I project the map these features outside the limit are clipped entirely off the data.
I've tried rearranging my commands around this constraint, but Leaflet requires me to use pre-projected data that I can't generate after I've projected and transposed. This also leads me to a lot of big code duplication.
So I guess my question is two-fold:
The text was updated successfully, but these errors were encountered: