8000 NullReferenceException when using animation · Issue #3258 · Mapsui/Mapsui · GitHub
[go: up one dir, main page]

Skip to content

NullReferenceException when using animation #3258

@jthomassensbict

Description

@jthomassensbict

Mapsui Version
5.0.1

Mapsui Platform
Mapsui.Maui

Device
Physical devices with Android 11, Android 14 and Android 16

Describe the bug
In our navigation app during the navigation the map randomly freezes when updating the location with animation. This can occur almost immediatly after the navigation has started or 15 minutes later. When looking at the logging we can see the following exception being thrown:

Object reference not set to an instance of an object. --> System.NullReferenceException: Object reference not set to an instance of an object.
   at Mapsui.Animations.Animation.UpdateAnimations[MapView](MapView target, IEnumerable`1 entries)
   at Mapsui.UI.Objects.MyLocationLayer.UpdateAnimations()
   at Mapsui.Map.UpdateAnimations()
   at Mapsui.Rendering.RenderController.UpdateAnimations(Map map)
   at Mapsui.Rendering.RenderController.InvalidateLoopAsync()
   at Mapsui.Extensions.Catch.<>cDisplayClass3_0.<<TaskRun>b0>d.MoveNext()

Every time a location update in the app is received we update our location on the map. This happens approximately every second.

Expected behavior
The map does not freeze during navigation

Additional context
Ater testing we think the issue is arising from this method
mapView.MyLocationLayer.UpdateMyLocation(currentPosition, true);
When setting the animation to false the issue does not seem to occur.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0