Open trafficonese opened 3 weeks ago
I can reproduce this, but I have no clue what's causing this. All I know is that it used to work...
Ok, this is weird. The xyArray
error only comes when the DevTools
are opened and the user interacts (zoom/pan) with the map. This happens in Brave, Chrome, Edge.
In Firefox it doesnt work at all and throws another error, although the example from flatgeobuf works in Firefox.
Uncaught (in promise) TypeError: t is null
Maybe this https://github.com/flatgeobuf/flatgeobuf/issues/245 is related?
And I am seeing much more console messages compared to the flatgeobuf example..
Yeah, it's really strange. In this document from September 2022 everything works as expected, even in firefox (though there are pmtiles related errors when there's no tiles for a zoom level - but that's a different issue)
https://cn-vector-data-vis.s3.eu-central-1.amazonaws.com/cn-vector-data-vis.html
This app will throw an error in the console. It happens with the CRAN and dev version.
APP
``` library(leafem) library(leaflet) library(shiny) library(terra) library(sf) ## Transform Data to FGB ############ linesdf <- st_as_sf(leaflet::atlStorms2005) shp <- vect(linesdf) shp_ext <- unname(as.vector(ext(shp))) fgb_path <- tempfile(fileext = ".fgb") writeVector(shp, fgb_path, filetype = "FlatGeobuf") ## UI ################## ui <- fluidPage(leafletOutput("map", height = 700)) ## SERVER ################## server <- function(input, output){ output$map <- renderLeaflet({ leaflet("map") %>% fitBounds(shp_ext[1], shp_ext[3], shp_ext[2], shp_ext[4]) %>% leafem::addMouseCoordinates() %>% addTiles(group = "Streets") %>% addFgb(fgb_path, minZoom = 5, fill = FALSE ) }) } shinyApp(ui = ui, server = server) ```
If I change
minZoom = 2
then the layer will initially be loaded and visible, but as soon as you zoom in, the same error appears.