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

Wide popups usually half off-screen #507

Closed
Famlam opened this issue May 17, 2024 · 4 comments
Closed

Wide popups usually half off-screen #507

Famlam opened this issue May 17, 2024 · 4 comments
Labels

Comments

@Famlam
Copy link
Contributor

Famlam commented May 17, 2024

For very wide popups, you (usually) don't see the full popup.
When opening it it's dependent on the map, but after dragging the map a little bit, it is always half.

Example here

Either it looks like this:
image
Or like this:
image

Occasionally I get it like this, which isn't perfect either, but at least 90% is visible:
image

Ideally, it would limit the popup width to for instance 50% of the "map region" width, either by word-wrapping the text if it's too long, or having a horizontal scroll bar for the tags.

@frodrigo
Copy link
Member

Max width is already implemented, but does not work.

https://github.com/osm-fr/osmose-frontend/blob/master/web/static/map/Osmose.Marker.ts#L24

@frodrigo frodrigo added the bug label May 17, 2024
@Famlam
Copy link
Contributor Author

Famlam commented May 17, 2024

Just a stupid suggestion, but in the defaults I see a unit is specified (https://github.com/maplibre/maplibre-gl-js/blob/0b4688b5c34bfa4dab4e956d0e67d2703bd1ec95/src/ui/popup.ts#L20) while in Osmose it isn't.

If I use 200 for css, nothing happens:
image

If I use 200px for css, I get
image

@frodrigo
Copy link
Member

Good catch! I miss this point when I look at this before.

frodrigo added a commit that referenced this issue May 18, 2024
frodrigo added a commit to frodrigo/osmose-frontend that referenced this issue May 18, 2024
@frodrigo
Copy link
Member

Fixed. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants