-
Notifications
You must be signed in to change notification settings - Fork 33
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
Geocoding/search plugin/widget/control #681
Comments
Geocoding needs some sort of service running in the background, so it's unclear if we want that as part of the native Lonboard JS app. By having it separate, the user can decide which geocoder they want to use, and supply an API key if necessary. You can have a separate widget and then set the You could make your own anywidget-based widget with a little bit of JavaScript, and then wire up an event to set lonboard state. If you wanted to have a pure-python widget, you could do something like this: https://stackoverflow.com/a/62015276 Because this is generic, it could be used with any widget-based map that lets you set the view state. |
yeah for this to work as part of the exported html, there needs to be a way for the html to access an external service (could be anything from places autocomplete or some other search endpoint), I guess I am just looking for a least intrusive way to get this to work.
A pure-Python widget should be sufficient for using within Jupyter. But if this can be part of the html, this will be more useful to the users who just want the visualization without having to deal with Python or JS. Actually, I just found #203 which is probably the other control I would need as well. Do you see any potential changes for lonboard to make it easier for users to add such controls (e.g. write less widget code)? |
Well, the ideal solution would be to have some sort of This means that users could use something off the shelf, but it wouldn't add to the complexity of the JS side of Lonboard. |
I managed to get something working using anywidgets. However, it is only working for one provider, since I don't have a good solution yet for accepting provider options (minimally I think at least two JS functions will be needed for every provider - one for sending the request, and one for formatting the result). Ideally this could also be extended to support server-side queries against local data layers. |
Oh that looks great! |
Is your feature request related to a problem? Please describe.
Lonboard is great for visualizing large datasets, but sometimes I need to zero into a particular location so a search widget/control would be handy.
Describe the solution you'd like
Some means of building/integrating a search/geocoding control (that takes in textual input, turn it into location coordinates for the map to zoom/center to). User to provide JS event handling code for the respective search/geocoding service they prefer to use. But a sample can be provided for Nominatim/Mapbox etc
Describe alternatives you've considered
N/A. Might have to dig deeper into the widget internals if I had to do it myself
Additional context
I have some previous code done for folium (https://github.com/prusswan/folium/tree/multiple-and-generic-geocode-providers) - which is now able to support multiple geocoding services, although the custom geocode support (allowing users to define geocoding and event handling functions) was not incorporated due to maintenance reasons. (python-visualization/folium#1851)
The text was updated successfully, but these errors were encountered: