publicmap / legacy

An open map by the public, for the public.
https://publicmap.github.io/legacy
The Unlicense
3 stars 1 forks source link

Extract viewbox coordinates for Nominatim search link #1

Closed DaxServer closed 7 years ago

DaxServer commented 7 years ago

Hi Arun,

The coordinates are not extracted properly from the GeoJSON geometry while passing to nominatimLink. Patched it up.

Thanks!

planemad commented 7 years ago

@SrihariThalla thanks for the patch!

We'll need to do some more digging into this, it fixes the link for multlinestring features, but for linestrings its still broken like http://nominatim.openstreetmap.org/search.php?q=N%20Park%20Rd&polygon=1&bounded=1&viewbox=NaN%2CNaN%2CNaN%2CNaN

Can you check if the link works for any single segment road name?

DaxServer commented 7 years ago

That breaks @planemad. I found a library for extracting coordinates in GeoJSON - mapbox/geojson-coords.

Shall we use it as it would save us from reinventing the wheel? I hope it won't make the bundle.js heavy!

DaxServer commented 7 years ago

@planemad Can you check whether bundle.js is properly bundled?

BTW, not all features have names! And the popups display 'undefined'. What shall we do about them? Shall we just not build the Nominatim search link at all for them?

planemad commented 7 years ago

👍 works great. Yes, features without name don't need a nominatim link