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

leafgl not rendering using examples in package #98

Open
nevilamos opened this issue Jul 5, 2024 · 2 comments
Open

leafgl not rendering using examples in package #98

nevilamos opened this issue Jul 5, 2024 · 2 comments

Comments

@nevilamos
Copy link

Using the example script the background map renders but there are no glpoints or gl lines added
viewer console state that leafletwidgedt is not defined

library(leaflet)
library(leafgl)
library(sf)

storms = st_as_sf(atlStorms2005)

cols = heat.colors(nrow(storms))

leaflet() %>%
addProviderTiles(provider = providers$CartoDB.Positron) %>%
addGlPolylines(data = storms, color = cols, popup = TRUE, opacity = 1)

library(leaflet)
library(leafgl)
library(sf)

n = 1e5

df1 = data.frame(id = 1:n,
x = rnorm(n, 10, 1),
y = rnorm(n, 49, 0.8))
pts = st_as_sf(df1, coords = c("x", "y"), crs = 4326)

cols = topo.colors(nrow(pts))
leaflet() %>%
addProviderTiles(provider = providers$CartoDB.DarkMatter) %>%
addGlPoints(data = pts, fillColor = cols, popup = TRUE)

no error in rtudio console - just background map plotted in viewer and the following in the viewer console:
addGlifyPoints.js:1 Uncaught ReferenceError: LeafletWidget is not defined
at addGlifyPoints.js:1:1
(anonymous) @ addGlifyPoints.js:1
addGlifyPolygons.js:1 Uncaught ReferenceError: LeafletWidget is not defined
at addGlifyPolygons.js:1:1
addGlifyPolylines.js:1 Uncaught ReferenceError: LeafletWidget is not defined
at addGlifyPolylines.js:1:1
leaflet.js:2752 Unknown method addGlifyPolylines
DevTools failed to load source map: Could not parse content for http://localhost:17977/glify-browser.js.map: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

@tim-salabim
Copy link
Member

Is this the CRAN or the dev version from here? If CRAN, please try dev

@fricour
Copy link

fricour commented Oct 13, 2024

Hi,

Had the same issue, using the github version solved the issue.

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

No branches or pull requests

3 participants