plepe / overpass-layer

Show a Leaflet layer using OpenStreetMap data from Overpass API via OverpassFrontend.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

generic overpass query

Dirk-- opened this issue · comments

how about adding a generic query (like the 'question mark functionality' at lower right side of https://www.openstreetmap.org)?

This would be a nice add-on at my site https://brouter.grade.de/#map=5/54.618/23.533/CARTO,CEMT

You mean for the demo application? Sure, why not, that's a good idea.

I don't think this should be available for all applications that use this library, though.

I'm sure you can integrate this into your site right now :-)

I don't think this should be available for all applications that use this library, though.

why not? Query just

  • within a small radius
  • keys probably preselected
  • result in a popup

Because it's against the UNIX philosophy. Do one thing, but do this one thing great.

For example: In my application OpenStreetBrowser, I'm using multiple layers. Should this query be available on each layer? If I add it, which query should it use? The same which this layer is configured for? Which style(s) for displaying results should be used?

I don't say, this is a bad idea, and you can still use overpass-layer for this. The only thing which might not be possible right now, is to force the bounding box (or rather bounding area if you want a circle). So: If a user clicks a location, add a new layer with your custom query (e.g. 'nwr;' for everything), with a forced bounding box (the underlying overpass-frontend accepts GeoJSON polygons as bbox, so this shouldn't be a problem) - and done.

I will check, if I can add a forced bounding area easily.

Sorry for not coming back to you earlier. I found a few issues adding the "forced bounding box" functionality. But I'm making good progress: plepe/overpass-frontend#21

Also, I added a lot more tests to be more stable in the future.

I added some examples how to use the module in the README file. Also, I added a link to a short screencast: https://www.youtube.com/watch?v=JTzVa9E0Yo8

I hope, you find this useful!