1

I'm trying to add objects from an ObservableCollection to my map, but for some reasons the objects are shown in top left corner instead of their real coordinates.

<maps:MapItemsControl ItemsSource="{Binding MyObjects}">
    <maps:MapItemsControl.ItemTemplate>
        <DataTemplate>
            <Image Source="../Assets/UI/myIcon.png"
                   maps:MapControl.Location="{Binding Geoposition,
                                              Converter={StaticResource EmptyConverter}}"
                   maps:MapControl.NormalizedAnchorPoint="0.5,1"
                   Stretch="Uniform"
                   Height="48"
                   Width="48" />
        </DataTemplate>
    </maps:MapItemsControl.ItemTemplate>
</maps:MapItemsControl>

(of course this snippet is inside my MapControl).

As you can see there's that EmptyConverter, and I'm using it to help me debugging: placing a breakpoint in the converter shows that each object has the correct coordinates, still it gets placed in the wrong spot (it's not even in maps' perspective, it feels like it has been pasted on that top corner).

Any hints on this?

IInspectable
  • 46,945
  • 8
  • 85
  • 181
StepTNT
  • 3,867
  • 7
  • 41
  • 82

1 Answers1

0

Ok, for your own sanity bind to a Geopoint and not to a BasicGeoposition as I did. It's odd because that binding didn't cause any error, I'm lucky that I decided to try this as my last chance.

StepTNT
  • 3,867
  • 7
  • 41
  • 82
  • 2
    Since you're on Windows 10, you should try `x:Bind` in place of `Binding`. `x:Bind` is resolved at compile time, giving you better error diagnostics, and earlier, too. – IInspectable Jul 23 '16 at 19:01