0

How to set Map Icon to be not moving when zooming and also directly point to precise location? Because from what I see when the map zooming out, it doesn't point to latitude and longitude I set. But when I zooming in it show to the correct latitude and longitude.

Here is some code I try

 var originPoint =
                        new Geopoint(new BasicGeoposition
                        {
                            Latitude = -7.9301346197875446,
                            Longitude = 112.63243081568352
                        });
                    //create POI
                    var originPin = new MapIcon
                    {
                        Location = originPoint,
                        NormalizedAnchorPoint = new Point(0.5, 0.5),
                        ZIndex = 0,
                        Image =
                            RandomAccessStreamReference.CreateFromUri(
                                new Uri(
                                    "ms-appx:///mapicon.png"))
                    };
                    nativeMap.MapElements.Add(originPin);

According to MSDN Documentation I need to set normalized anchor point. But what is the correct point to set? I already try (0,0),(0.5,1),(0.5,0.5)(1,1) and it still need to be zooming in to show the correct position. Look at my image below

Zooming out Zooming in

albilaga
  • 419
  • 1
  • 10
  • 26

1 Answers1

1

The NormalizedAnchorPoint is the correct item to use in this case... it is a point system with 0,0 being upper left corner. And 1,1 being lower right corner.

Seeing your image, we assume your anchor point is the lower left corner... ( the red dot ) so try (1,0) or (0,1) ( I'm not sure at the top of my head what the x axis is, I would think the first point )

Depechie
  • 6,102
  • 24
  • 46