-
Notifications
You must be signed in to change notification settings - Fork 126
L tooltip #23
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
L tooltip #23
Conversation
@mikeu would you mind taking a look here? I have a feeling that we could do something to simplify the code.. But I really want to ditch Anyhow let me know what you think! |
@DonNicoJs for sure, I should have some time to check it out this weekend, or failing that early in the week. Looking forward to seeing what you've come up with so far! |
@DonNicoJs I agree, I really like the idea of replacing I had a whole thing written about the changes I'd made to the map component, when I finally noticed that the changes were almost, but not quite, in line with what you'd already done in several of the other components, so I refactored my changes to follow the general scheme you already had, and here's a different version of my comments :) I think the biggest change I've made is to explicitly provide methods individually where they are set up, and then to only inject the methods that are needed. This makes for a few more lines of code than providing and injecting the generic The only component that I didn't update in this way was the marker. I wanted to ask you about something first: What do we gain by awaiting delayed imports for the leaflet components inside the Finally, I switched the naming of |
@mikeu Thank you for the review! I've created a PR from the branch to check the differences more easily.
This is the main point that complicates the code, but is also crucial to achieve two things: Easier bundle splitting in ESM modules and out of the box This problem is compounded by few others:
This 3 factors is what lead me to use a I thought about splitting this in different pieces, one for normal methods and one for ones that require leaflet but I think ti became more confusing.
I do like this, but I will go with one name fitting all, so leafletRef and leafletObject is probably the best option in my opinion. I like the concept of over-provide maybe we should wrap this in a utility function to enforce the meaning. My idea would be: let's move on with this PR, let's open a new one to swap mapRef/mapObject for leafletRef/leafletObject But First I would like to know your thoughts! |
Ah OK, thanks! SSR is one thing I have no experience with, so I will happily defer to you on that front :)
Yeah, given that set of requirements, I'm not having any luck thinking of a better alternative either. My only suggestion at this point, which I can throw into a different PR if you like it, would be to define a function (say in
Sounds good to me! |
Remembered I had one other comment. I like this idea, it's similar in spirit to the For example, in Leaflet both layer groups and tile layers have a Unless you had other ideas for the utility function, like maybe it would do some checking or console warning of some sort when in development mode, beyond simply being an explicit indication that something is being overridden on purpose? Or would it just be useful to acknowledge in the code that there is even the possibility that it's happening, and we've made that choice explicitly? |
@mikeu Thanks for all the input! So to not make this PR out of scope too much WDYT if we do like this?
Does this sounds good to you? I'll go along and merge this, and will create a new PR for the utility! do you have time to modify your Pr/Branch to swap mapRef? |
This PR adds support for the tooltip component
Closes #19