-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tm_inset / tm_minimap #1048
Comments
|
Good suggestions @Nowosad
As an enhancement of the 'sticking' process I had an idea on my walk back after work: in addition to sticking to one of the corners, we could also use a component-grid-layout, where components (whatever they may be: legends, insets, credits, titles), can be arranged in a regular grid. As for the implementation: the easiest way is to use the So it could be something like this: tm_shape(NLD_muni) +
tm_polygons() +
tm_basemap() +
tm_minimap(position = tm_pos_in_cell(row = 2, col = 1:2)) +
tm_component_grid(nrow = 3, ncol = 3, heights = c(.1, .1, .8))
Just an example with the current implementation: tm_shape(World) +
tm_polygons(fill = "HPI",
col = "economy",
lwd = "pop_est",
lwd.legend= tm_legend(position = tm_pos_in(), width = 13),
col.legend= tm_legend(position = tm_pos_in(), width = 13),
fill.legend = tm_legend(position = tm_pos_in(), width = 13,
resize_as_group = F,
group.frame = F)) +
tm_options(
component.offset = c(inside = 0.3, INSIDE = 0, outside = 0, OUTSIDE = 0),
component.stack_margin = .3) The devil is in many details:
|
Open question from a users perspective: if you see the map above, what would the ideal Also think about/consider these kind of shortcut functions, which haven't had much attention, but should be pretty useful: |
If no basemap is provided -- I would suggest to use the default one.
I am unsure about this whole idea (including the syntax there). I.e., I like the possibility to customize the map, but -- is this actually needed for most of the tmap users? Maybe it would be better to start with working tm_inset, and then consider future steps when/if people will ask for it?
My thinking is that we should be careful about adding shortcut functions, because then the package will be fun of these, and it would make it hard to find the actual "base" functions... |
ls this related to my previous issue, #1046 ? Insert maps and combine separate map look different. Is it possible to implement some basic base methods?
How exactly to implement this, I may have some unclear technical detail. Once a solution approach is discussed and decided upon, I would be glad to contribute to this effort as a newcomer by working on some of the less complex tasks. |
@Nowosad @Xiezhibin thanks for your inputs. Agree in general. First question: how shall we call the 'inset' components? Currently, I can think of these ones, where I mention the input:
Can we harmonize these names, e.g.
Not sure about the name 'minimap'. Aren't all minimaps inset maps? The two things that distinguish a 'minimap' in its current use are: it's global, and it has a locator where the main map is. Perhaps You can add all current components to this list as well, like Also happy to hear your opinions @tim-salabim @Nowosad @olivroy , ... Second: placement. Indeed perhaps What I need as user: distance from the map frame, distance between the components, option to align map frames. For the
|
Spoke with @Nowosad in person before lunch. He had a good idea: Just one |
Struggling myself with inset maps. It is possible with the
vp
argument of print.tmap, but requires a lot of trial and error:tm_minimap
with shows an inset of a world map, either a projected 'flat' one, or a globe, like mapsf does. This is already implemented for the view mode, but not for plot mode.tm_inset
, which takes any (grid-based) plot, and places it in a map component. In that way it is processed in exactly the same way as other components, like legends and scalebars. The user still has to provide a height and width, and specify the position. Use cases: inset maps (also like this tmap_arrange -> patchwork-ish functionality #1046) and ggplot2 plots.What do you think @Nowosad and @olivroy ? Any additional ideas?
The text was updated successfully, but these errors were encountered: