leafem icon indicating copy to clipboard operation
leafem copied to clipboard

removeMouseCoordinates does not return a `mapview` class

Open cysouw opened this issue 1 year ago • 1 comments

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)
}

cysouw avatar Aug 13 '24 16:08 cysouw

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.

tim-salabim avatar Aug 14 '24 05:08 tim-salabim