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

Example code for MapboxMap Compose to support loading multiple 3D models #2339

Open
AndrewGe opened this issue Apr 11, 2024 · 2 comments
Open
Assignees
Labels

Comments

@AndrewGe
Copy link

AndrewGe commented Apr 11, 2024

New Feature

Would the team provide some example code for MapboxMap Compose to support loading multiple 3D models?

The existing sample listed here still uses non-compose MapView to load 2 3D models. We couldn't find similar examples.

Why

As Compose is universally applied in Android development nowadays, we need to apply MapboxMap compose in our app. It is also consistent with Mapbox's own efforts of 3D map, which we use to include our own 3D models too.

We'd appreciate some estimated timeline so that we can plan accordingly for our development.

cc: @peng.liu@mapbox.com

@AndrewGe
Copy link
Author

AndrewGe commented Apr 11, 2024

Also, for the current compose function

@Composable
@MapboxExperimental
public fun MapboxMap(... )

It looks like that we should be able to create another Composable which would accepts a "MapView" or rememberMapViewWithLifecycle (similar to this code) argument. Of course, we need to handle its state after passing it to the new Composable.

The benefits: we should be able to re-use most existing MapView features easily in the new Composable, in contrast to MapboxMap which creates MapView internally.

@pengdev
Copy link
Member

pengdev commented Apr 12, 2024

Hey @AndrewGe thanks for the interest in the compose extension, we are actively working on bringing style composition to the compose extension, in the latest release https://github.com/mapbox/mapbox-maps-android/releases/tag/v11.3.0 , we have introduced experimental layer composable functions with source states, we are planning to add full runtime styling API support for compose extension, please stay tuned.

It looks like that we should be able to create another Composable which would accepts a "MapView" or rememberMapViewWithLifecycle (similar to this code) argument. Of course, we need to handle its state after passing it to the new Composable.

Please refer to our document, you can already use MapEffect within MapboxMap content to get the raw map controller(mapView) and use all the existing APIs, you can render the 3D models just like non-compose MapView example within MapEffect with existing APIs.

@pengdev pengdev self-assigned this Apr 12, 2024
gj-loitp pushed a commit to gj-loitp/lib_mapbox-maps-android that referenced this issue May 4, 2024
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