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 was working on integrating tmap and leaflet this week in a package so that I can use tmap to create a static map then convert to leaflet when necessary & add any extra interactive elements on top. This is achievable with tmap_leaflet (although there were some annoyances such as the default converted Leaflet always showing 3 basemaps and then having to define the 1 basemap I want separately with tmap_options(basemaps).
I thought it would be great to define any layers that could be static in tmap and then convert to leaflet when I need to. This would reduce duplication of effort across tmap and leaflet.
However, one problem I came across is that I want to be able to use the layers I defined in leaflet with a proxy map. If I convert with tmap_leaflet I get a full leaflet map, not layers I can then add to a proxy map.
Is there any way to convert individual layers from tmap to leaflet format? Or extract layers from the output of tmap_leaflet and add them to another leaflet map.
I'm guessing this is not possible to do with the current version of tmap but maybe such an ability could be added in future?
Ultimately, I'd like to be able to define a tm_lines then convert to leaflet and attach it so that the lines and legend appear correctly on the leaflet map.
The text was updated successfully, but these errors were encountered:
I still have to migrate the tmapProxy/shiny integration in v4.
Your input is welcome, so thanks for that. However, I don't understand exactly what you mean yet. Are you looking for something like tmap_leaflet(tm, layers = c(1,3,5))? If so, why don't you just create a tmap with those layers?
Could you perhaps share a minimal use case / example, of something you want to achieve?
I was working on integrating
tmap
andleaflet
this week in a package so that I can usetmap
to create a static map then convert toleaflet
when necessary & add any extra interactive elements on top. This is achievable withtmap_leaflet
(although there were some annoyances such as the default converted Leaflet always showing 3 basemaps and then having to define the 1 basemap I want separately withtmap_options(basemaps)
.I thought it would be great to define any layers that could be static in
tmap
and then convert toleaflet
when I need to. This would reduce duplication of effort acrosstmap
andleaflet
.However, one problem I came across is that I want to be able to use the layers I defined in leaflet with a proxy map. If I convert with
tmap_leaflet
I get a full leaflet map, not layers I can then add to a proxy map.Is there any way to convert individual layers from
tmap
toleaflet
format? Or extract layers from the output oftmap_leaflet
and add them to anotherleaflet
map.I'm guessing this is not possible to do with the current version of
tmap
but maybe such an ability could be added in future?Ultimately, I'd like to be able to define a
tm_lines
then convert to leaflet and attach it so that the lines and legend appear correctly on the leaflet map.The text was updated successfully, but these errors were encountered: