Mapsui: Rotating a Forms map that contains a Pin crashes app

Adding a single pin using code from PinSample.cs, the pin shows up on the map as expected. Zooming and panning the map works fine. But about 75% of the time, rotating the map hangs the app with very little interesting debug output (debug build). The other 25% of the time the map rotates around the pin as expected. Map rotation always works without the pin. Same behavior on Android and iOS. I’m rotating the map using touch, not programatically.

Position p = new Position(41.0f, -116.0f);
var pin = new Pin(mapView)
{
  Label = $"PinType.Pin {markerNum++}",
  Address = p.ToString(),
  Position = p,
  Type = PinType.Pin,
  Color = new Color(rnd.Next(0, 255) / 255.0, rnd.Next(0, 255) / 255.0, rnd.Next(0, 255) / 255.0),
  Transparency = 0.3f,
  Scale = rnd.Next(50, 130) / 100f
};
mapView.Pins.Add(pin);

Xamarin.Forms 3.5.0.129452 Mapsui.Forms v2.0.0-beta.22 Nokia 6.1 running Android 9 iPhone 6S running iOS 12.1.4

Debug output (Android): at System.Threading.ThreadHelper.ThreadStart () [0x00014] in <58604b4522f748968296166e317b04b4>:0 at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) [0x0004f] in <58604b4522f748968296166e317b04b4>:0

“Thread Pool Worker” “Thread Pool Worker” “Thread Pool Worker” “Thread Pool Worker” “Thread Pool Worker” “Thread Pool Worker” “Debugger agent” “Thread Pool Worker” “Thread Pool Worker” “Thread Pool Worker” “Finalizer” “<threadpool thread>” “Thread Pool Worker” “Thread Pool Worker” “Thread Pool Worker” Thread finished: <Thread Pool> #18 The thread 0x12 has exited with code 0 (0x0). 03-10 01:12:27.039 I/libc (29967): Requested dump for tid 29967 (ripping.CTForms) Thread finished: <Thread Pool> #5 The thread 0x5 has exited with code 0 (0x0).

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

That fixed it. I haven’t had to remove the obj and bin folders in awhile…

This problem appears to be fixed! Will give another go at callouts next.

It is the same problem as #606. Have to think about this.

Here’s a project that repros the problem on Android: MapsuiFormsSample. It’s based on the VS Master-Detail project template. It doesn’t repro on iOS, I think because for whatever reason the map doesn’t rotate in this sample. Probably I’m not configuring it correctly. Pretty sure once the map is configured to rotate the problem will repro on iOS too.