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

should add_CouncilStyle() for non-council boundaries? #16

Open
romartinez-nycc opened this issue May 31, 2023 · 4 comments
Open

should add_CouncilStyle() for non-council boundaries? #16

romartinez-nycc opened this issue May 31, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@romartinez-nycc
Copy link
Contributor

Running into the issue of not being able to use addCouncilStyle() for precinct map but would like the leaflet option presets, and labels presets ....

if(add_dists) {
map <- map %>%
leaflet::addPolygons(data = dists, fill = FALSE, weight = 1,
color = "#2F56A6", opacity = .5, smoothFactor = 0,
group = "Council Districts") %>%
leaflet::addLabelOnlyMarkers(data = dists, lat = ~lab_y, lng = ~lab_x, label = ~coun_dist,
labelOptions = leaflet::labelOptions(permanent = TRUE, noHide = TRUE,
textOnly = TRUE,
textsize = 12,
direction = "center",
style = list(color = "#23417D",
"font-family" = "'Open Sans', sans-serif",
"font-weight" = "bold")))
if (length(highlight_dists) > 0) {
map <- map %>%
leaflet::addLabelOnlyMarkers(data = dists[dists$coun_dist %in% highlight_dists, ],

@nmontalbanocouncil
Copy link
Contributor

Was this resolved with a power cycle or does it still occur?

@romartinez-nycc
Copy link
Contributor Author

Nope, strange. I get this now when running

library(leaflet)
library(councildown)

The legacy packages maptools, rgdal, and rgeos, underpinning this package
will retire shortly. Please refer to R-spatial evolution reports on
https://r-spatial.org/r/2023/05/15/evolution4.html for details.
This package is now running under evolution status 0

Attaching package: ‘councildown’

The following object is masked from ‘package:leaflet’:

addPolygons

leaflet() %>% addCouncilStyle()

Blank output

@nmontalbanocouncil
Copy link
Contributor

I don't think it will show anything unless you put use the add_dists parameter or add other polygons.
leaflet() %>% addCouncilStyle(add_dists = TRUE)

Not sure about that legacy packages part. I didn't get that on mine.

@romartinez-nycc
Copy link
Contributor Author

Oops your right, so it doesn't work when running it at the end instead of the beginning, like I had it above...

leaflet() %>%
addPolygons(data = shootings_06_12.shp, weight = 1, fillColor = ~palPct(shootings_per_100K), #color="#cdd9f1", color= "white", stroke = TRUE, fillOpacity = 1, popup = ~map_labels) %>%
addCouncilStyle() %>%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants