[go: nahoru, domu]

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

Option to center camera on current location on map load #184

Open
carterhudson opened this issue Jul 24, 2022 · 3 comments
Open

Option to center camera on current location on map load #184

carterhudson opened this issue Jul 24, 2022 · 3 comments
Assignees
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@carterhudson
Copy link
carterhudson commented Jul 24, 2022

Is your feature request related to a problem? Please describe.
I'd like to be able to configure the map to start with the camera on my current location without having to press a button. It seems like a waste of time to do it all manually, pulling in the dependency for the fused location provider, abstracting it, etc., when the SDK already has the current location, and can show it if isMyLocationEnabled is true.

Describe the solution you'd like
Perhaps a property in MapProperties called startAtCurrentLocation.

Describe alternatives you've considered
Requesting the user's current location, then setting it as a camera update on map load.

@carterhudson carterhudson added triage me I really want to be triaged. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Jul 24, 2022
@Priyankkjain
Copy link
Contributor

If you want to start the map at a particular location you can use rememberCameraPositionState's position argument.

For example

val cameraPositionState = rememberCameraPositionState {
   position = CameraPosition.fromLatLngZoom(currentUserLocaiton, 17f)
}

Pass this position state in the GoogleMap composable function and the map will start at that particular location.

@carterhudson
Copy link
Author
carterhudson commented Aug 2, 2022

If you want to start the map at a particular location you can use rememberCameraPositionState's position argument.

For example

val cameraPositionState = rememberCameraPositionState {
   position = CameraPosition.fromLatLngZoom(currentUserLocaiton, 17f)
}

Pass this position state in the GoogleMap composable function and the map will start at that particular location.

Yes, I'm aware of this. As this is a feature request, I'm not looking for you to tell me how to do it (unless this feature already exists in some fashion).

As far as I can tell, there shouldn't be a need for me to go through the process of pulling in the fused location provider dependency, and fetching the user's current location, if the maps SDK already has the user's current location.

It's also possible that the location I get from the fused client differs slightly from what the map displays as the user's current position.

Essentially, I'm looking for the same functionality the "My Location" button provides, without needing the user to manually press it.

@konradzuse
Copy link

I would also find this a useful feature

@kikoso kikoso added priority: p3 Desirable enhancement or fix. May not be included in next release. and removed triage me I really want to be triaged. labels Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

5 participants