leafem
leafem copied to clipboard
removeMouseCoordinates does not return a `mapview` class
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)
}
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.