Description
The issue
Now that LeafletJS 1.x has been out and stable for a while, it's time to think about upgrading to it. However it's not as simple and as straight forward as it sounds, so I'm creating this issue to capture all information related to the upgrade.
Initial Assessment
The first order of thing is to adapt any existing code to use 1.x API, and the good news is that not much has changed, so most of the code can work as is. The only two things I am aware of are
- L.circle now accepts radius as an option (like L.circleMarker) rather than a second argument
- Labels are not supported by the Leaflet.label plugin anymore, rather they are incorporated in the core dist. and renamed to L.Tooltip
These are both minor changes can can be done only on the JS side w/o having to rewrite the R API.
Now for the hard parts.
The hardest part is going to be upgrading the plugins used. As plugins are individual contributions, it is up to the plugin author to migrate to 1.x and unfortunately not all have done so. We need to review this on a case by case basis. Starting with Proj4Leaflet which is critical in supporting custom projections. Proj4Leaflet hasn't been fully migrated to 1.x, but a branch does exists claiming to support 1.x. The problem is that the maintainer of Proj4Leaflet has not found spare time to work on it in a while and the branch is > 6 months old.
Next are some other plugins we use in the package such as AwesomeMarkers, Measure, Minimap, Terminator, omnivore, leaflet-providers, Easybutton, marker cluster, location filter (for crosstalk).
The repos of all these plugins needs to be examined and we need to determine what efforts will require for each of them.
Lastly we have the leaflet sup-packages, starting with leaflet.extras (by your's truly), and mapview. These two use a lot of leaflet plugins and they too must be examined for the level of efforts required.
The benefits
- 0.7 branch is no longer being developed or fixed.
- 1.x branch has a lot of performance and bug fixes.
- 1.x has support for some really cool stuff like vector tiles, webgl and more.
- Always pays off to stay current.
Action Plan
- I can take a first stab at porting just the leaflet package (along with any plugins it uses) to 1.x
- For preventing any compatibility issues I will call this package leaflet2 (leaflet2 which is based on LeafletJS 1.x, I know how ironic that sounds).
- Once this is in a usable condition, I'll begin to work on leaflet.extras and more.
@jcheng5 @hadley @timelyportfolio @tim-salabim @mdsumner Please provide your inputs on this. This is quite critical in keeping the package up to date and viable for the coming years.
One thing you guys can help out immediately is discussing whether this needs to be a new package (leaflet2), or simply continue with the same name. I don't think compatibility is going to be an issue for users of just this packge, but for sub-package it could lead to problems if we retain the same name. e.g. some plugins in mapview / leaflet.extras may not have been ported to 1.x, and ergo won't work with the latest leaflet package (if we were to retain the same name).