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

removeMouseCoordinates does not return a mapview class #88

Open
cysouw opened this issue Aug 13, 2024 · 1 comment
Open

removeMouseCoordinates does not return a mapview class #88

cysouw opened this issue Aug 13, 2024 · 1 comment

Comments

@cysouw
Copy link

cysouw commented Aug 13, 2024

The function removeMouseCoordinates returns only part of the mapview object. Maybe better something like this?

removeMouseCoordinates = function(map) {
  if (inherits(map, "mapview")) leaf = map@map

  rc = leaf$jsHooks$render
  rc_lnlt = grepl("lnlt", rc) #lapply(rc, grepl, pattern = "lnlt")
  leaf$jsHooks$render = leaf$jsHooks$render[!rc_lnlt]

  map@map <- leaf
  return(map)
}
@tim-salabim
Copy link
Member

All functions provided by leafem are intended to work with native leaflet objects. If anywhere, this should be implemented in mapview as a method for mapview objects.

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

2 participants