Maui.GoogleMaps icon indicating copy to clipboard operation
Maui.GoogleMaps copied to clipboard

ToScreenLocation throws null reference on iOS but works on Android

Open GreenleafDk opened this issue 5 months ago • 1 comments

VERSIONS

  • Maui.GoogleMaps - 6.0.0
  • .NET SDK - 8.0

IDE

  • [ ] Rider
  • [x] Visual Studio
  • [ ] Visual Studio for Mac

PLATFORMS

  • [ ] Android
  • [x] iOS, physical device iphone 14 iOS 17.6.1

ACTUAL BEHAVIOR

ToScreenLocation(some Position) throws NullReferenceException because the delegate is not set, but is null, here

public Point ToScreenLocation(Position position) { if (OnToScreenLocation == null) { throw new NullReferenceException("ToScreenLocation"); }

return OnToScreenLocation(position);

}

EXPECTED BEHAVIOR

Expect the screen position for the given Position on the map, which is what happens on android. This error is only seen on iOS

HOW TO REPRODUCE

Make a map and call the method on an iOS device

GreenleafDk avatar Sep 06 '24 11:09 GreenleafDk