-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
attribution button with bar #248
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
There is, it'd be the same technique used to stop following on user gesture in the camera follow demo, though it's not reliable yet on the JS side. It has caveats that should be fixed in the future (see #77). #230 should make this API robust.
Maybe an underline by default? No strong opinion here, though it'd be nice if the links were visibly clickable
if such wrapping is unlikely with common map styles and common displays, sounds good to me
I agree having an unobtrusive button is best, but perhaps we can still include the background when the text is expanded? So it starts with the attribution text and button, then on gesture the text collapses into the button and the background collapses + fades. |
I'll look into it |
Implemented both suggestions. The issue with Screen_recording_20250115_015845.mp4
Tried it out. While still for each attribution the whole link is clickable, this looks odd. Also, I've looked into M3 guidelines, and they don't loose a word about in-text links (and TextButtons have a different appearance). |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Yup, it would be good to have it work through State, similar to camera position and camera move reason. That's #164 |
So merging this is actually blocked by #164, because when a user just naively employed this, no attribution would be shown. |
Yeah I think so. Still, thanks for doing this! Will review in a bit |
Regarding #250: Maybe it would make sense to allow the button to be align towards any corner. However, I didn't do this because I have not idea how to do it. When you review the code, you'll see that several things are aligned to the bottom right within the widget:
It could be parametrized, but the issue is that it is a wild mix of |
I'll try out an idea how to implement this. |
I've done this elsewhere in the library by just asking the Alignment instance to align a 1x1 box in some convenient rect. For an example, check how I map Alignment to Android gravity or the iOS bit mask for the SDK ornaments. |
I'm not sure if the material 3 library has tooltip or popup menu components, but if it does we could probably look at how they work too |
…tion-button # Conflicts: # lib/maplibre-compose-material3/src/commonMain/kotlin/dev/sargunv/maplibrecompose/material3/controls/AttributionButton.kt
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Fixes #174
Screen_recording_20250113_231257.mp4
I deviated from my suggestion in #174 because:
AnnotatedString
swhich will enable to (correctly) have only parts of the attribution text link to the attribution source, as it should be and as it is done in MapLibre JS.
IconButtonColors
? (didn't try)I briefly tried out to give the info button 1px white halo, like the scalebar has, but in my eyes, this looked a bit disruptive, even though one would think it would look consistent with the scalebar.
Question:
TODO: