-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Vector tile layer #255
base: master
Are you sure you want to change the base?
Vector tile layer #255
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to get an example of this working on a branch for my project. This includes a simple test of a localhost Tegola server connected to a PostGIS database. I was able to write custom queries in the Tegola config and display the layers in a layer group, which is my desired functionality.
One thing that I had a bit of trouble with was the event handlers. I am trying to access the feature on click (e.g, click on a power line and get back the details of that feature). Not sure if I am doing this right, you will see my eventHandlers
dict in the code.

@Eric-UW-CRL thanks for the feedback! There is nothing wrong with your code - i just didn't get to event handlers in the first take. If you bump to the next rc version, pip install dash-leaflet==1.0.17rc2 your code should work. For reference, I have updated the example in the PR post to use event handlers. Note, I have not added any default event handlers yet (i.e. you don't have e.g. an |
@emilhe I see! I gave the update a try, and my event handler now works on clicks. I was looking at the default event handlers for the GeoJSON components, and maybe it makes sense to add the same defaults for this? I imagine users would primarily want to click on the features or mouse over them to get the properties. My simple attempt using a custom event handler was as follows. This gives me enough control however to get the data from the features that I need.
|
This would be a super welcome addition to this awesome package! :) I have a use case where the tile layer also accepts query parameters (i.e., passed in the url in the form |
Did you try just passing the URL with parameters included? FetchOptions are options passed to the request itself (method, headers, etc.) |
Yes, that works but is not exactly what I'm looking for: I would like to be able to change the value of the query parameter dynamically (e.g., through a dash callback) when a user makes a different selection in a dropdown box. So the |
In that case, I guess if the URL was made dynamic (i.e that it can be changed by a callback), that would support your use case also? |
Yes, absolutely! 👍 I tried modifying it with a callback but that doesn't work currently. Hence my question here. :) |
This feature would also be super helpful for me! 😸 |
@emilhe Do you have any idea when this could be included? This functionality would be really convenient for my own project instead of other workarounds. :) |
This feature would also be super helpful for me! |
The PR introduces a
VectorTileLayer
component, based on this library, which enables rendering of (protobuf) vector tiles.