R/fct_create_precinct_map.R

Defines functions create_precinct_map

Documented in create_precinct_map

#' Create Precinct Map
#'
#' @param d A geojson file
#'
#' @return
#' @export
#'
#' @examples
create_precinct_map <- function(d){
  leaflet::leaflet(data = d) %>%
    leaflet::addTiles() %>%
    leaflet::addPolygons(
      color = "black"
      ,weight = 1
      ,fillOpacity = 0.2
      ,highlightOptions = highlightOptions(
        color = "white"
        ,weight = 2
        ,bringToFront = TRUE
      )
      ,label = ~glue::glue(
        "Precinct: {precinct}"
      )
      ,layerId = ~precinct
    )
}
dss-hmi/nypd-ccrb-2020-shiny documentation built on Jan. 17, 2021, 12:17 a.m.