I am presently in the process of building an R package that allows users to make custom souvenir maps of their flights, road trips and the cities they visit.
I am in the process of trying to figure out how to add a custom title and frame to a leaflet map.
What I have so far
library(leaflet)
library(htmltools)
library(htmlwidgets)
# Custom CSS
tag.map.title <- tags$style(HTML("
.leaflet-control.map-title {
transform: translate(-30%,850%);
position: fixed !important;
left: 50%;
text-align: center;
font-weight: bold;
font-size: 60px;
font-family: 'Brush Script MT'
}
"))
# Adding a title
title <- tags$div(
tag.map.title, HTML("New York, New York!")
)
# Using my custom package
# devtools::install_github("benyamindsmith/mapBliss")
mapBliss::plot_city_view("New York City",
#mapBoxTemplate ="mapbox-template-link",
zoomControl = c(0.15, 0.05, 0.04, -0.003)) %>%
addControl(title, position = "topright", className="map-title")
What I want
I am wondering what is the CSS required if I want to have frames like these? Ideally they would maintain their position when resized also.
(For now, ignore the MapBox theme)