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

Camera position different from the current location #50

Closed
FabianGrob opened this issue Feb 21, 2020 · 5 comments
Closed

Camera position different from the current location #50

FabianGrob opened this issue Feb 21, 2020 · 5 comments

Comments

@FabianGrob
Copy link

I am trying to edit an entity that has a pair of Latitude and Longitude, so i edit it through this widget. I want it to show in the map the old location and not my current location. I am setting the automaticallyAnimateToCurrentLocation: as false, but this centers the camera tu a remote island idkwhere. Is there a way to set the camera at a certain LatLng?

My code is the following:

Widget build(BuildContext context) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
RaisedButton(
onPressed: () async {
LocationResult result;
if (initialLat != 0 || initialLong != 0) {
result = await showLocationPicker(
context,
'AIzaSyD8_lvGEpZodiVIfNTBE5sOzgRfeVHpFe4',
initialCenter: LatLng(initialLat, initialLong),
myLocationButtonEnabled: true,
automaticallyAnimateToCurrentLocation: false,
);
} else {
result = await showLocationPicker(
context, 'AIzaSyD8_lvGEpZodiVIfNTBE5sOzgRfeVHpFe4',
myLocationButtonEnabled: true);
}
setState(() => _pickedLocation = result);
setLat(_pickedLocation.latLng.latitude);
setLong(_pickedLocation.latLng.longitude);
},
child: Text('Mark your location!'),
),
],
),
);

Thanks in advance!

@humazed
Copy link
Owner

humazed commented Mar 1, 2020

yes you need to set initialCenter

@humazed humazed closed this as completed Mar 1, 2020
@FabianGrob
Copy link
Author

FabianGrob commented Mar 2, 2020 via email

@humazed
Copy link
Owner

humazed commented Mar 2, 2020

could you try with the example app and if you can reproduce it there

@humazed humazed reopened this Mar 2, 2020
@FabianGrob
Copy link
Author

FabianGrob commented Mar 3, 2020 via email

@humazed
Copy link
Owner

humazed commented Mar 3, 2020

regarding the unnamed places please take a look at #16

@humazed humazed closed this as completed Mar 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants