walkerke / mapgl

R interface to Mapbox GL JS v3 and Maplibre GL JS
https://walker-data.com/mapgl
Other
91 stars 5 forks source link

clear_layer() doesnt clear popups #29

Closed ews-grmunjal closed 3 months ago

ews-grmunjal commented 3 months ago

Hi Kyle

in shiny, when using clear_layer("x") with mapboxgl_proxy... the layer x seems to clear but the popup does not.

What I was trying to do was:

-1- render a base map with renderMapboxgl() -2- select a field from a dropdown menu and add_circle_layer using that field with mapboxgl_proxy(). Field is numeric, circle size is based on field.

if i switch to a different numeric field in the dropdown...the old popups stay but read "undefined"

walkerke commented 3 months ago

Do you have a minimal reproducible example I could try out?

ews-grmunjal commented 3 months ago

Thanks for the prompt response. Unfortunately, the whole thing has gotten quite extensive and not straightforward to share. A small reproducible example I tried to make does seem to work fine. In the larger example, I found issue was somewhere related to missing values so just changing NA to "Missing" before mapgl calls seemed to make that one work too.

I was able to make a reproducible small example of a second issue I was having with missings. I'll close this one in favor of that