xamarin/Xamarin.Forms

[Bug] Customized Map Pin Sample UWP will display same info window for all tapped pins

Aperta

#6039 aperta il 29 apr 2019

 (0 commenti) (0 reazioni) (0 assegnatari)C# (1926 fork)batch import
e/3 :clock3:help wantedinactivep/UWPs/unverifiedt/bug :bug:up-for-grabs

Metriche repository

Star
 (5644 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

[Bug] Customized Map Pin Sample UWP will display same info window for all tapped pins

Description

https://github.com/xamarin/xamarin-forms-samples/tree/master/CustomRenderers/Map/Pin sample. The UWP sample will display the info window contents of the first tapped pin for any pin tapped after the first. The info window content is not being reset after being selected. There is a simple fix to make the UWP CustomMapRenderer as useful as the Android version.

Steps to Reproduce

  1. I used the CustomRenderers/Map/Pin sample which displays a single pin
  2. I added a second pin
  3. I tapped one pin on the map, then tapped a second pin. The second pin displayed an info window with the same contents as the first.

Expected Behavior

Expected to see the contents of the second pin info window change to its defined info window contents. The Android version works as expected.

Actual Behavior

Once the first pin is tapped, all subsequent tapped pins will display the info window contents of the first tapped pin. The same info windows contents are displayed for all pins. To get the UWP CustomMapRenderer to run correctly as does the Android CustomMapRenderer, simply add the line (mapOverlay = null;) following line 92 (xamarinOverlayShown = false;) in the UWP CustomMapRenderer.cs.

Basic Information

  • Version with issue:
  • Last known good version:
  • IDE:
  • Platform Target Frameworks:
    • iOS:
    • Android:
    • UWP:
  • Android Support Library Version:
  • Nuget Packages:
  • Affected Devices:

Screenshots

Reproduction Link

Guida contributor