tdk/mapout.R
2023-04-04 19:26:25 +02:00

17 lines
644 B
R

library(leaflet)
library(purrr)
# df2 <- df[sample(1:nrow(df),4000),]
df2 <- df
bins <- c(0, quantile(df$ar/df$ater,probs=c(0.2,0.4,0.6,0.8)), Inf) # Kvintilisek
pal <- colorBin("YlOrRd", domain = df2$ar/df2$ater, bins = bins)
leaflet(df2) %>%
addTiles() %>%
addCircleMarkers(~lon,~lat,popup = df2$cim,radius = 10,fillColor = ~pal(ar/ater),fillOpacity = 0.8,stroke = F) %>%
#addMarkers(~lon,~lat,popup = df2$cim) %>%
addLegend(pal = pal, values = df2$ar/df2$ater, title = "Ft/m2/hó",
position = "bottomright") %>%
addMarkers(metro$lon, metro$lat,popup = metro$name) %>%
addMarkers(vonat$lon, vonat$lat,popup = vonat$name)