Move map zoom controls to top right

This commit is contained in:
C0d3v committed 2026-02-07 22:34:36 +01:00
1 parent 08e883533f
commit 5700c61421
2 files changed
+9 -3

No files matched your search

+1
View File
@@ -11,6 +11,7 @@ library(ggplot2)
library(ggthemes)
library(stringr)
library(plotly)
library(htmlwidgets)
#große JSON Datei lesen
crime_json <- fromJSON(file="data.json")
+8 -3
View File
@@ -170,7 +170,7 @@ server <- function(input, output, session) {
#div() steht für division und sorgt für das Styling oder Layout von Inhalten, hier: die Inhalte "Bezirk:" und "Stadtteil:"
#bez und req(bez) sowie sdt und req(sdt) (müsste es nicht auch std sein, so wie oben? Nur wegen der Einheitlichkeit und so) führen dazu, dass der richtige Bezirk bzw. Stadtteil, die angeklickt wurden, auch als Auswahl neben der Karte rechts auftauchen
output$hhmap <- renderLeaflet({
leaflet() %>%
leaflet(options = leafletOptions(zoomControl = FALSE)) %>%
addProviderTiles(providers$CartoDB.Positron) %>%
addPolygons(
data = geo_bezirke,
@@ -202,12 +202,17 @@ server <- function(input, output, session) {
bringToFront = TRUE
),
) %>%
setView(
lng = 9.98716634776887,
lat = 53.5488439196432,
zoom = 11
)
) %>%
onRender(
"function(el, x) {
L.control.zoom({
position:'topright'
}).addTo(this);
}")
})
output$txt_map_selection_bezirk <- renderUI({
bez <- currently_selected_bezirk()