Map component that adds a minimap in view mode.
tm_minimap(server, toggle, stack, position, group_id, z, ...)name of the provider or an URL (see tm_tiles).
By default, it shows the same map as the basemap, and moreover, it will automatically change when the user switches basemaps.
Note the latter does not happen when server is specified.
should the minimap have a button to minimise it? By default TRUE.
stack with other map components, either "vertical" or "horizontal".
The position specification of the component: an object created with tm_pos_in() or tm_pos_out(). Or, as a shortcut, a vector of two values, specifying the x and y coordinates. The first is "left", "center" or "right" (or upper case, meaning tighter to the map frame), the second "top", "center" or "bottom". Numeric values are also supported, where 0, 0 means left bottom and 1, 1 right top. See also vignette about positioning. In case multiple components should be combined (stacked), use group_id and specify component in tm_comp_group().
Component group id name. All components (e.g. legends, titles, etc) with the same group_id will be grouped. The specifications of how they are placed (e.g. stacking, margins etc.) are determined in tm_comp_group() where its argument id should correspond to group_id.
z index, e.g. the place of the component relative to the other componets
Arguments passed on to leaflet::addMiniMap
mapa map widget object
widthThe width of the minimap in pixels. Defaults to 150.
heightThe height of the minimap in pixels. Defaults to 150.
collapsedWidthThe width of the toggle marker and the minimap when collapsed, in pixels. Defaults to 19.
collapsedHeightThe height of the toggle marker and the minimap when collapsed, in pixels. Defaults to 19.
zoomLevelOffsetThe offset applied to the zoom in the minimap compared to the zoom of the main map. Can be positive or negative, defaults to -5.
zoomLevelFixedOverrides the offset to apply a fixed zoom level to the minimap regardless of the main map zoom. Set it to any valid zoom level, if unset zoomLevelOffset is used instead.
centerFixedApplies a fixed position to the minimap regardless of the main map's view / position. Prevents panning the minimap, but does allow zooming (both in the minimap and the main map). If the minimap is zoomed, it will always zoom around the centerFixed point. You can pass in a LatLng-equivalent object. Defaults to false.
zoomAnimationSets whether the minimap should have an animated zoom. (Will cause it to lag a bit after the movement of the main map.) Defaults to false.
toggleDisplaySets whether the minimap should have a button to minimise it. Defaults to false.
autoToggleDisplaySets whether the minimap should hide automatically, if the parent map bounds does not fit within the minimap bounds. Especially useful when 'zoomLevelFixed' is set.
minimizedSets whether the minimap should start in a minimized position.
aimingRectOptionsSets the style of the aiming rectangle by passing in a Path.Options (https://web.archive.org/web/20220702182250/https://leafletjs.com/reference-1.3.4.html#path-options) object. (Clickable will always be overridden and set to false.)
shadowRectOptionsSets the style of the aiming shadow rectangle by passing in a Path.Options (https://web.archive.org/web/20220702182250/https://leafletjs.com/reference-1.3.4.html#path-option) object. (Clickable will always be overridden and set to false.)
stringsOverrides the default strings allowing for translation.
tilesURL for tiles or one of the pre-defined providers.
mapOptionsSets Leaflet options for the MiniMap map. It does not override the MiniMap default map options but extends them.