trafficonese / leaflet.extras

Extra functionality for leaflet R package.
https://trafficonese.github.io/leaflet.extras/
GNU General Public License v3.0
213 stars 74 forks source link

precision argument #152

Open timelyportfolio opened 6 years ago

timelyportfolio commented 6 years ago

As we were working through https://github.com/r-spatial/mapedit/issues/63, I learned from https://github.com/codeofsumit/leaflet.pm/pull/306#issuecomment-399096183 that with https://github.com/Leaflet/Leaflet/pull/5444 leaflet > 1.1 added a precision argument to toGeoJSON(). The new default of 6 is probably enough in most cases, but @schloerke and @bhaskarvk what would you think about adding a precision argument to leaflet.draw to adjust higher or lower?

bhaskarvk commented 5 years ago

I'll be resuming development of leaflet.extras in Dec and will tackle this in that round. Thanks!

trafficonese commented 5 months ago

I was trying to include the precision argument. On the JS side the toGeoJSON respects the argument, but when it is returned to Shiny via Shiny.onInputChange, the coordinates will have maximum 6 digits unless one sets options(digits = 18).

So I am thinking of directly using that option with getOption("digits", 6) and not include a new argument. What do you think @timelyportfolio ?