xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.64k stars 1.88k forks source link

[Bug] Registering for CameraMove event in Android MapRenderer subclass stops Map.VisibleRegion being updated #15683

Open benlings opened 1 year ago

benlings commented 1 year ago

Description

Steps to Reproduce

  1. Subclass Android MapRenderer and in OnMapReady, register an event listener with NativeMap.CameraMove.
  2. Subclass Xamarin.Forms.Maps.Map and export the above renderer subclass linked to this.
  3. Show the map in an app
  4. Scroll the map

Expected Behavior

Map.VisibleRegion is updated to match the camera position in the native map

Actual Behavior

Map.VisibleRegion remains on its initial position.

Basic Information

Environment

Show/Hide Visual Studio info ``` ```

Build Logs

Screenshots

Reproduction Link

Workaround

Copy implementation of UpdateVisibleRegion from MapRenderer base class and call it with UpdateVisibleRegion(NativeMap.CameraPosition.Target); from the event handler.