Xamarin.Forms.GoogleMaps
Xamarin.Forms.GoogleMaps copied to clipboard
AnimationStatus.Finished on a MoveCamera != map rendered
VERSIONS
- Xamarin.Forms.GoogleMaps - 3.0.4
- Xamarin.Forms - 3.3.0.912540
PLATFORMS
- [x] Android
- [ ] iOS
- [ ] UWP
ACTUAL BEHAVIOR
I am trying to automatically save a snapshot after adding points and moving to the bounds.
var bounds = Xamarin.Forms.GoogleMaps.Bounds.FromPositions(map.Polylines.SelectMany(poly => poly.Positions));
var newBoundsArea = CameraUpdateFactory.NewBounds(bounds, 5);
await map.MoveCamera(newBoundsArea);
var stream = await map.TakeSnapshot();
However when I take the snapshot the camera has not moved nor has the map being rendered again. How do I wait for the actual render to be complete before saving the snapshot ?
Yes, await map.MoveCamera/AnimateCamera NOT means move map finished.
You can observe when move map finished using Map.CameraIdled event.
But maybe it NOT means render map completed. I'm not sure to how to observe render map finished in Google Maps SDK.
Thanks, i've not found a way currently. I am waiting on the camera idled now but as you say it is not enough.
I think you should delay any seconds (await Task.Delay(3000ms)) .
How is this closed ? There is still no reliable method
Sorry, but I have no idea to resolve your issue.
Wouldn't using and exposing this work ? https://developers.google.com/android/reference/com/google/android/gms/maps/GoogleMap.OnMapLoadedCallback