Hartnack
Hartnack

Reputation: 1

C# MapControl How to prevent image from changing size while zooming?

I added image to MapControl but while zooming map in and out, image is changing size.

        Image img = new Image();
        img.Source = new BitmapImage(new Uri("ms-appx:///Assets/weii.png"));
        img.Opacity = 0.1;
        img.Stretch = Stretch.None;


        MapControl.SetNormalizedAnchorPoint(img, new Point(0.5, 0.5));
        MapControl.SetLocation(img, new Geopoint(new BasicGeoposition() { Latitude = 51.236852, Longitude = 22.548944 }));

        mapa.Children.Add(img);

How can I made image to not change size?

Upvotes: 0

Views: 62

Answers (1)

rbrundritt
rbrundritt

Reputation: 17954

I believe you are seeing an optical illusion that may be caused by an incorrect anchor point. When the anchor point is not positioned in the correct location, the pushpin image will appear to drift and possibly look like it might be changing size slightly. Your current code is anchoring the image on the center of the image. Take a look at this blog post for information on how to properly anchor pushpins: https://rbrundritt.wordpress.com/2014/10/02/correcting-anchoring-pushpins-to-the-map/

Upvotes: 1

Related Questions