-
Notifications
You must be signed in to change notification settings - Fork 77
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
Add (Overpass based) POI layer #384
Conversation
Just willing to give it a try? I've deployed this to my personal BRouter-Web instance at https://brouter.brokenpipe.de/ |
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.
Thanks for the PR!
Some additional thoughts for potential (later) improvements (not critical for merging):
- The queries only include nodes and ways, which will miss some objects mapped as relations, e.g. this
camp_site
mapped both as site and multipolygon relation. Don't know about performance implications of always using thenwr
shorthand. Otherwise taginfo shows relation usage per tag. - I personally find the default styling of nodes as both CircleMarker and icon Marker superfluous and a bit too much
- My impression is, that the default Overpass instance is slow and overloaded these days, perhaps we should use an alternative instance?
- Some kind of loading indicator would be nice
Choosing relevant layers is hard. From a maintenance perspective I guess more is better (like your current selection), so I don't get frequent requests to add yet another layer.
Not sure. Maybe by putting the current input placeholder as help text below like in the profile options tab and adding an example for Overpass, that can be copied this way (unlike the placeholder). Don't know if something like overpass-wizard would help. edit: clarify "more" doesn't mean more than currently implemented |
I completely agree with the minZoom requirement. Regarding Regarding the marker symbol I also agree, so plain nodes are now depitected by a simple circle marker, and both areas as well as multi polygon relations by their outline. I like the idea to split the custom layers dialog's placeholder into label and helptext parts, especially to keep the helptext visible. So I've just quickly changed that as well. Regarding the loading indicator I need to have a closer look someday. To be honest I've been missing it myself from time to time already. Yet from a brief look into the documentation it doesn't (yet) emit the signals necessary to achieve this. |
Not sure, but I would have tended to do it the other way round and just not show the CircleMarker for nodes, but keep both marker and outline for ways/areas:
Don't know how to do that with overpass-layer though, there seems to be a
In the parks demo I just saw Let me know if you want to leave it as is for now or add some more changes to this PR. I'm fine with merging as is. |
I've just added a simple loading indicator, based on the existing messaging approach. Yet I didn't want to accidentally wipe out possibly visible error messages, hence I've wrapped the And thanks for pointing out those two event handlers exist, I wonder where I was looking at yesterday without noticing them. Whatever ... Regarding multiple Overpass layers, so far I have been thinking of using separate colours instead of icons, so users could control the colour of either markers, circles or polygons. Having a colour picker feels more intuitive then adding some kind of icon selector, and also would be reusable for e.g. imported gpx route layers. |
Thanks for your contribution! |
I made some minor additions in #389.
My idea was not to let the user select, but to extend the overpass layer definitions with icons that would show both in the optional layers tree and in the markers for a selected layer. Ideally some existing icon associations and also translations could be used, e.g. from editor presets, see also #306. Example from id-tagging-schema presets.json: "tourism/camp_site": {
"icon": "maki-campsite", which would be maki campsite-15.svg: |
This adds a (yet pretty simple) Overpass API based POI layer. To achieve this it integrates the MIT-licensed overpass-layer module, which runs overpass queries for the full bounding box (i.e. no "search along the route"), and uses a map marker quite like the existing POI marker (but with
fa-search
icon instead offa-star
). The popups list the OSM-style key/value pairs without much interpretation.Overpass layers can be added in two ways:
Regarding the default layers I was wondering how many of those layers should be added (or if any at all), and how specific they should be e.g. to cycling needs (e.g. water sources of different kinds) or general purpose (one special kind of amenity per layer). This PR is currently leaning towards the latter and just adds a whole lot of amenities, shops & tourism osm features --- likely too many.
With the custom layers dialog I was also wondering, how things can be achieved in a user friendly way ... so far it's pretty cryptic (mainly since I refrained from just putting documentation into it or adding actual labels to the inputs). So instead of an URL you can put a Overpass Query (like e.g.
(node[shop]['diet:vegan']['diet:vegan'!=no]; way[shop]['diet:vegan']['diet:vegan'!=no];);
) in the URL input field, provide a layer name and click "add overpass query".Both kinds of layers then can be checked on and off in the layer control like normal.
For the moment I'd consider this a minimal baseline, on which sub-sequent features could be built -- like choosing a color for the layer (which could be of interest to the gpx import layers as well)
refs #106