Closed CIOData closed 1 month ago
Would you mind sharing a reprex? Also, could you open the error inspector in your web browser and let me know what the error says?
There is no error, the map just fails to render.
library(tidyverse)
library(mapgl)
library(sf)
path = 'usr/bin'
setwd(path)
locs = read.csv('locs.csv', header=T) |>
sf::st_as_sf(coords = c("longitude","latitude"), crs = 4326)
#renders
mapboxgl(style = carto_style('positron-no-labels')) |>
fit_bounds(locs, animate = FALSE) |>
add_circle_layer(
source = subset(locs, Type == 'Toxic Release Inventory Facility'),
id = 'this',
circle_color = 'red',
circle_stroke_width = 1,
circle_stroke_color = 'black'
)
#does not render
mapboxgl(style = carto_style('positron-no-labels')) |>
fit_bounds(locs, animate = FALSE) |>
add_circle_layer(
source = subset(locs, Type == 'Lung Cancer Screening'),
id = 'this',
circle_color = 'red',
circle_stroke_width = 1,
circle_stroke_color = 'black'
)
@CIOData it is rendering for me:
I've tested in both Positron and RStudio.
What operating system are you on, and what IDE are you using? Does the map still fail to render when you pop it out into a web browser?
Hmm, it is rendering fine for me today. I don't know what was going on before. I had even restarted the session and cleared the namespace but still had the issue. I have since restarted my computer, so some process must have been standing in the way.
Thanks for looking.
I wonder if this is related to #43 then and there was some server-side problem going on. I'll keep an eye on it.
I am trying to use
add_circle_layer()
with ~17k points, categorized by type. It fails to render when points are used altogether, but when separated by type, some types render and some types don't. I've tried everything (testing for valid st, removing duplicate geometries, checking for null geometries), but can't find any difference that is causing this behavior. Moreover, everything plots just fine using other methods in R. Having an error message to point out why themapboxgl()
map is failing to render would be helpful.