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

Define custom marker images with Composables #41

Closed
alexvanyo opened this issue Feb 18, 2022 · 10 comments · Fixed by #355
Closed

Define custom marker images with Composables #41

alexvanyo opened this issue Feb 18, 2022 · 10 comments · Fixed by #355
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. released type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@alexvanyo
Copy link

For cases where info windows aren't flexible enough, or the marker images need to be dynamic in some way, it'd be great to be able to use a @Composable to render the marker images.

With Views, this was possible by creating a view and using View.drawToBitmap, which should roughly also be possible with a ComposeView (with caveats, due to the use of software rendering).

@alexvanyo alexvanyo added triage me I really want to be triaged. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Feb 18, 2022
@PedroARuiz
Copy link

if were possible to load an url image would be amazing 🤩

@arriolac arriolac added priority: p2 Moderately-important priority. Fix may not be included in next release. and removed triage me I really want to be triaged. labels Mar 1, 2022
@bubenheimer
Copy link
Contributor

https://issuetracker.google.com/issues/220892485

@bubenheimer
Copy link
Contributor

bubenheimer commented Jun 18, 2022

IconGenerator from android-map-utils provides a recipe that looks helpful to take inspiration from, combined with (Abstract)ComposeView and View.drawToBitmap as @alexvanyo suggests. (In case someone is looking for a more spelled out approach.)

@wangela wangela assigned DSteve595 and unassigned arriolac Feb 7, 2023
@DSteve595
Copy link
Contributor

@alexvanyo: I've proposed a pattern for this in #258. That PR adds it to Clustering markers, but I'm considering bringing the same approach to regular Markers as well (a Composable content arg instead of a BitmapDescriptor). Would greatly appreciate your feedback (does it work the way you expect?).

@wangela wangela changed the title Define custom marker images with Composables RFC: Define custom marker images with Composables Feb 8, 2023
@wangela wangela pinned this issue Feb 8, 2023
@spiral123
Copy link

Using the Clustering class works really well for rendering Markers from Composables....except how should we set the anchor, infoWindowAnchor, flat and draggable MarkerOptions?

@DSteve595
Copy link
Contributor

The goal isn't to use Clustering for all markers, but we're testing the Composable marker rendering on that first. Barring any major issues, we'll try porting that over to regular Markers, which is where you'll be able to use anchor, infoWindowAnchor, etc.

@andlopru
Copy link

Any news on this issue?

@kikoso kikoso unpinned this issue Jul 28, 2023
@wangela wangela changed the title RFC: Define custom marker images with Composables Define custom marker images with Composables Aug 17, 2023
@googlemaps-bot
Copy link
Contributor

🎉 This issue has been resolved in version 2.14.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@wangela
Copy link
Member

wangela commented Aug 17, 2023

Thank you @mosmb for contributing the # 2 most popular feature request in this project!

@mosmb
Copy link
Contributor

mosmb commented Aug 18, 2023

Thank you to both of you @wangela & @kikoso
Can't wait to deprecate my homemade solution at work and use this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. released type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
10 participants