Closed strangebit closed 1 year ago
Nice catch @strangebit! Thx for reporting.
Hey @strangebit yes great catch, you are exactly right - I was aware of this and handle it already for the map but I didn't think to handle ways and relations for the other areas of the app. I will fix this soon and thanks for reporting this!
@strangebit this should be fixed now - if you want to test it and report back then we can close this issue.
Thanks again for the super detailed bug report (you solved the problem yourself :P). In the future you could even put a PR in if you would like, but this method also works fine.
Do you have some lightning info you can share? I'll send you some sats for this great edge-case bug catch and report! :)
Thanks! It does appear to be working now on the live site.
I appreciate that. I've been doing a bit of tagging under Pilirani Kayin as well, so you could send me some tips on there if you like!
On the activity page and the tagger page, entries that are tagged from 'Ways' on OSM — as opposed to from 'Nodes' — do not link properly to the appropriate location on the map. The lat/long is undefined, so it ends up creating a link like this:
https://btcmap.org/map?lat=undefined&long=undefined
I believe this is because in the API, from what I can see, there is no direct
.lat
and.lon
for way types, only for node types. For way types, there is.maxlat
,.minlat
,.maxlon
,.minlon
.So I believe the problem can be fixed here in
/src/routes/activity/page.svelte
:https://github.com/teambtcmap/btcmap.org/blob/7524f7bacb04047ba5e5eca303e739603d063a93/src/routes/activity/%2Bpage.svelte#L43-L44
And here in
/src/routes/tagger/[id]/+page.svelte
:https://github.com/teambtcmap/btcmap.org/blob/7524f7bacb04047ba5e5eca303e739603d063a93/src/routes/tagger/%5Bid%5D/%2Bpage.svelte#L214-L215
By calling this code instead, which calculates the midpoint for ways, and uses that as the lat/long coordinates:
https://github.com/teambtcmap/btcmap.org/blob/7524f7bacb04047ba5e5eca303e739603d063a93/src/lib/map/setup.js#L249-L255
The tagger page already uses this code to decide where to draw the tagger's markers on the embedded map:
https://github.com/teambtcmap/btcmap.org/blob/7524f7bacb04047ba5e5eca303e739603d063a93/src/routes/tagger/%5Bid%5D/%2Bpage.svelte#L311-L329
I came to this conclusion just by reading the code. I haven't ran or tested any of it, so apologies if this is incorrect information.