-
Notifications
You must be signed in to change notification settings - Fork 507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to Leaflet v1.x #453
Conversation
…do intersection with simple features (sf)
… editable spot for feature attributes
…non-standard styling as begin rewrite
… to use ControlStore
…with layerControl (viewRGB); cc @tim-salabim
The default zIndex for TileLayer and GridLayer is now 1. In Leaflet 0.7 it was null. In our R code, the default was NULL, which we pass to the Leaflet code. Therefore, in Leaflet 1.x we actually override the default zIndex of 1 and change it to "auto". However, for addRaster, we've never allowed the zIndex to be set, so we don't override the new default zIndex of 1. So we end up with a tile layer with zIndex "auto" and a grid layer with a zIndex of 1. For "stacking context" reasons that I do not understand, auto always renders in front of non-auto. Setting the default for tiles to 1 fixes the problem.
The getImageData(callback) function as previously written would invoke the callback immediately if image data was already loaded, or asynchronously if image data was not. (I knew this was weird so I noted this in the function's comment.) This turns out to be a problem with Leaflet 1.x because it expects createTile's callback (done) function to only be invoked after createTile has returned. If done is called too soon, then it's ignored, because done first checks the GridLayer's tile cache to see if the tile that's done is even still wanted. Since createTile hasn't returned the tile isn't in the cache yet, and done becomes a no-op.
@jcheng5 thanks so much for putting this together. I am excited to get Leaflet (R) > 1.0, since the cadence for Leaflet (JS) is so much quicker now. I'll test and help in any way I can. Let me know if you want me to tackle anything specifically. |
For leaflet.extras I will need to go thru each and every plugin and make sure it's up to date and works with 1.x. So I need some time. My suggestion is to keep this Github only for now, until I make leaflet.extras ready an do a simultaneous release in say 2 or 3 weeks from now. |
Also for the popups, I was thinking may be we should use https://github.com/yafred/leaflet-responsive-popup instead of the default popups coz responsive popups can be very handy. |
@jcheng5 One more thing, it's been some while after @timelyportfolio updated the plugins and now. So it might be worth the efforts to update them one more time and also update leaflet to 1.2.0 instead of 1.0.3 |
I've merged from master, and updated to Leaflet 1.2.0. @timelyportfolio would you have time to upgrade the plugins to their latest versions? |
I will start by assembling a checklist of all the plugins we use. I think I have one somewhere and hope to start chipping away at the list. Are we talking about both
For additional reference, here is the |
@timelyportfolio just leaflet, I'll deal with the leaflet.extras pkg. |
Oh BTW, awesome markersleaflet-awesome-markers' original author had long abandoned the project, so I forked it and updated it with some good PRs that were pending on the original repo I even submitted a PR to the original author of the plugin but he's MIA. Someone else has taken stewardship of the project and made some changes recently and has a PR pending that is essentially my commits copied over. sigma-geosistemas/Leaflet.awesome-markers#8 So for awesome-markers I have 2 suggestions. either way Don't use the original repo. Leaflet.Label to L.TooltipI had also forked Leaflet.Label and merged some pending PRs https://github.com/bhaskarvk/Leaflet.label/commits/master and used that in our package. Unfortunately this is going to be a bit tricky because this plugin exists no more and Leaflet.Label has become Leaflet.Tooltip in the original |
@jcheng5 @bhaskarvk not sure how best to track the plugin updates. #458 updates markercluster, and everything seems to work except for |
@timelyportfolio If you fix the freeze support in #458 I will merge it w/ v1.0 branch. |
freeze support fixed in #458. |
Almost ready https://github.com/bhaskarvk/leaflet/tree/upgrade/leaflet-v1.x, |
Superseded by #476, but keeping open for tracking purposes. |
(Note: @timelyportfolio actually did all the heavy lifting for this PR, I just created the PR itself)
Remaining work items. I would much appreciate any help with these.
master
intov1.x
xxxOptions
functions and the default values foraddXXX
functions. (A difference inzIndex
defaults broke rasters)@bhaskarvk can you also make sure that your
leaflet.extras
don't have anyzIndex = NULL
either?