- Feature Attribute Editing
- Geojson Precision
- Mulitlinestring Editing
- Crosstalk Integration
- Shiny async
- Conclusion and Thanks
Back in September 2016, leaflet.js went
1.0 (see Meet Leaflet
1) with a
massive changelog from
0.7.0 released three years earlier. Meanwhile,
the Leaflet R ecosystem had grown to be very powerful, but also
extremely interwoven and quite complex with significant efforts from Joe
Cheng and the RStudio team on leaflet core, Bhaskar Karambelkar on
mapview, and many
other open source contributors. Upgrading Leaflet R to leaflet.js >
1.0 would prove to be a massive undertaking. The
mapedit team devoted
some RConsortium hours to launching the effort, but the entire effort
proved well beyond the scope of this initial contribution. Fortunately
for the R geospatial community, RStudio very generously provided Barret
Schloerke to complete the daunting remaining tasks.
10, 2018, Barret posted Leaflet
2.0.0 on the
RStudio blog with not only an upgrade to leaflet.js > 1.0 but also a
full upgrade to all
leaflet.extras dependencies and very important
infrastructure improvements including a test suite to more easily keep
up with a quicker leaflet.js release cadence.
mapedit is entirely dependent on Leaflet, so we postponed activity on
mapedit until the new Leaflet R release. We are pleased to announce
mapedit is entirely compatible with the new Leaflet and even more
pleased to get back to work implementing new features and tackling
In this post, we will highlight the next steps for
mapedit in order of
feature attribute editing
multiline string editing
shiny async integration.
We cannot stress enough that the success of achieving these depends greatly on feedback and ideas from the geospatial community, so we highly encourage participation at issues.
As mentioned a lot has changed recently, so we recommend updating
mapedit. The newest
is not required, but while we are at it, we should probably update it
install.packages(c("sf", "leaflet", "leaflet.extras", "mapview", "mapedit"))
Feature Attribute Editing
mapedit launched with three objectives:
drawing, editing, and deleting features,
selecting and querying of features and map regions,
Rather than build on top of geojson.io, we would like to tightly
integrate attribute editing into
mapedit. We will track progress on
this issue and would
love your participation.
Robin Lovelace discovered that at leaflet zoom level > 17 we lose coordinate precision. Of course, this is not good enough, so we will prioritize a fix as discussed in issue. Hopefully, this leaflet.js pull request will make this fix fairly straightforward.
Mike Treglia tweeted an interesting use case for
want to make interactive scatterplot and map (#GIS) in #rstats – ideally where hovering over point/polygon in map highlights corresponding one in scatterplot, & vice-versa. Favorite examples w/ code? thinking of leaflet/plotly/crosstalk probably, but open to alternatives
— Mike Treglia (@MikeTreglia) December 9, 2017
We welcomed the challenge and responded with this example crosstalking mapedit/leaflet with Plotly and DT.
While the example mostly works, there is far too high a burden on the
user. We will try to reduce this down to a couple of lines of code.
Issue 72 will track
mapedit will remain targeted toward Shiny contexts, so
this effort will focus on crosstalk with
Shiny. This plumbing
for crosstalk in
mapedit should provide a foundation for things like
polygon selection in leaflet without Shiny.
RStudio added async support in Shiny as described in the post Shiny
1.1.0: Scaling Shiny with
async and webinar
Scaling Shiny apps with async
No promises here, but async would be very nice for
Conclusion and Thanks
As we progress towards these goals, we will post on
r-spatial.org, and we would love your help..
mapedit and many of its dependency packages are funded by the
RConsortium. Thanks so much to all
those who have contributed to this fantastic organization. Also, thanks
to all those open source contributors in the R community.