Skip to content
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

Style area-pins differently #1474

Closed
tordans opened this issue Jun 30, 2024 · 4 comments
Closed

Style area-pins differently #1474

tordans opened this issue Jun 30, 2024 · 4 comments
Labels
considering Not actionable: Still deciding if we want to add this. duplicate This issue or pull request already exists

Comments

@tordans
Copy link

tordans commented Jun 30, 2024

Description

I was quite confused just now when I tried to select this bicycle pin inside the area:

image

It turns out, this is the pin that symbolizes the area, not a separate pin.

I think those should be styled differently, to make it easier to understand their meaning.

Btw: The placement is also a bit weird, I was expecting it in the center or maybe as a pattern, but not where it is ATM. When edit the shape, the pin moves around quite far, which was also weird.

Area: https://www.openstreetmap.org/way/718205697#map=19/52.48309/13.44155&layers=N

@tordans tordans changed the title Style pins in area different Style area-pins different Jun 30, 2024
@tordans tordans changed the title Style area-pins different Style area-pins differently Jun 30, 2024
@bhousel
Copy link
Contributor

bhousel commented Jul 1, 2024

Oh yeah this is a duplicate of #958 - can also look at #534 also for examples of where this rendering is better than what Rapid v1 and iD used to do.

We didn't really talk about it much there, but I'm kind of weakly against the idea of making the virtual points look different. If people really insist on it, I'd probably change the pin somehow, but then users will open issues to ask "why is this point different" and we'd have to explain them about areas and it's still not clear to me why a mapper would care about this detail.

If I'm trying to edit a POI, I shouldn't need to think about whether that POI is mapped as a point or as an area - this is really just a quirk of OSM. And it is really useful to be able to see and edit these mapped features at lower zooms where the area polygons are tiny.

Btw: The placement is also a bit weird, I was expecting it in the center or maybe as a pattern, but not where it is ATM. When edit the shape, the pin moves around quite far, which was also weird.

I agree in the screenshot the placement of the pin is weird. We use the Polylabel library to calculate the "pole of inaccessibility" see comment here. I don't totally understand the algorithm, but it is supposed to put the point somewhere within the large part of the shape, even if it's an 'L' shape or has holes. When you edit the shape it will adjust the point around to different places - this is expected.

@bhousel bhousel added the considering Not actionable: Still deciding if we want to add this. label Jul 1, 2024
@bhousel
Copy link
Contributor

bhousel commented Jul 1, 2024

I agree in the screenshot the placement of the pin is weird. We use the Polylabel library to calculate the "pole of inaccessibility" see comment here. I don't totally understand the algorithm, but it is supposed to put the point somewhere within the large part of the shape, even if it's an 'L' shape or has holes. When you edit the shape it will adjust the point around to different places - this is expected.

Quick update: I did investigate the placement a bit - https://rapideditor.org/edit#map=21.82/52.48309/13.44156&id=w718205697

It looks like this issue is also mapbox/polylabel#33

  • If you square the shape with Q a few times, it will move the point more towards the center.
  • This means that the long rectangular shape actually starts out slightly trapezoidal, and the point wants to gravitate towards the slighty wider end.
  • maybe we'll switch to one of the Polylabel forks mentioned on Gravitate to Centroid mapbox/polylabel#63

@tordans
Copy link
Author

tordans commented Jul 2, 2024

…but I'm kind of weakly against the idea of making the virtual points look different. If people really insist on it, I'd probably change the pin somehow, but then users will open issues to ask "why is this point different" and we'd have to explain them about areas and it's still not clear to me why a mapper would care about this detail.

I think the way iD handels this case is good: It shows the type but there is no confusion between the "pin-icon in area" vs. "area with type-icon" case.

iD Rapid
image image

This styling did not come up in any issues that I remember on the iD side.

@bhousel
Copy link
Contributor

bhousel commented Jul 2, 2024

This styling did not come up in any issues that I remember on the iD side.

The old area styling has been causing issues in iD going back years.

  • the position is at the centroid, which sometimes places it outside of the shape
  • the icon disappears when the shape is small or zoomed out
  • the icon is not clickable

All issues that have been raised in the past.

@bhousel bhousel closed this as completed Jul 2, 2024
@bhousel bhousel added duplicate This issue or pull request already exists labels Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
considering Not actionable: Still deciding if we want to add this. duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants