Open jmlondon opened 6 years ago
... cross the 180 longitude line. I have long hoped for a reliable, simple solution based
on web mercator. But, I've yet to find anything satisfactory.
I believe this is still the case for standard leaflet. I found a plugin here: https://github.com/briannaAndCo/Leaflet.Antimeridian . This would need a PR to this repo to be incorporated.
ESRI has recently released Arctic Ocean Basemap which is in the Alaska Polar
Stereographic projection. I've managed to sort out all the parameter details for the
`tile_url` and `leafletCRS()` function
There is a third package: leaflet.esri
. It contains a method called addEsriTiledMapLayer()
. You can use it like:
leaflet() %>%
leaflet.esri::addEsriTiledMapLayer(
"https://services.arcgisonline.com/arcgis/rest/services/Polar/Arctic_Ocean_Base/MapServer"
)
The projection is still off, so you will still have to use the leafletCRS()
method as you did.
I would also be interested in how I might contribute this
leaflet-providers has ESRI maps and would be a good place to submit a PR to add the map location. Eventually, it will trickle into leaflet R package.
I believe a leaflet.providers package needs to be made due to how quickly providers are added.
I have been searching for a viable solution that would allow use of leaflet (and, also, mapview) with points, lines, polygons and rasters that cross the 180 longitude line. I have long hoped for a reliable, simple solution based on web mercator. But, I've yet to find anything satisfactory.
Leaflet's support of additional projections is a great solution except for the lack of tile options available. That said, ESRI has recently released Arctic Ocean Basemap which is in the Alaska Polar Stereographic projection.
I've managed to sort out all the parameter details for the
tile_url
andleafletCRS
function. Here, I present an example that others who are interested in the US Arctic may find useful.I would also be interested in how I might contribute this to either leaflet or, maybe leaflet-providers or leaflet-extras, so the full configuration doesn't have to be specified each time. I imagine something similar could be specified for ArcticConnect and other tile sources (e.g. Antarctica).