Skip to content
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

leaflet performace #1

Open
gstephan30 opened this issue Jan 15, 2021 · 0 comments
Open

leaflet performace #1

gstephan30 opened this issue Jan 15, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@gstephan30
Copy link
Owner

creating leaflet map crashe

library(sormasmap)
library(leaflet)
library(tidyverse)

raster_file <- system.file("extdata", "gadm36_DEU_1_sp.rds", package = "sormasmap")
germany <- readRDS(raster_file)

sormas_test <- load_shp(2) %>% 
  left_join(
    tibble(
      plz = as.character(sample(1:99, 30, replace = FALSE)),
      sormas = "yes"
    )
  ) %>% 
  mutate(sormas = if_else(is.na(sormas), "no", sormas))

sormas_low <- load_shp(2, "low") %>% 
  left_join(
    tibble(
      plz = as.character(sample(1:99, 30, replace = FALSE)),
      sormas = "yes"
    )
  ) %>% 
  mutate(sormas = if_else(is.na(sormas), "no", sormas))

ggplot() +
  geom_polygon(
    data = sormas_test,
    aes(long, lat, group = group, fill = sormas),
    color = 'white') +
  scale_fill_manual(values = c("#d3d3d3", "#0277bd")) +
  geom_polygon(
    data = germany,
    aes(long, lat, group = group),
    colour = "black",
    fill = NA,
    size = 1,
    alpha = 0.4, 
    show.legend = FALSE) +
  theme_void() +
  coord_map() +
  labs(title = "Test graphic SORMAS in Germany", 
       subtitle = "Date 15/1/2021",
       fill = "SORMAS deployed") +
  theme(legend.position = "bottom") +
  guides(fill = guide_legend(title.position = "top"))
@gstephan30 gstephan30 self-assigned this Jan 15, 2021
@gstephan30 gstephan30 added the bug Something isn't working label Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant