PorkChopPenfold
PorkChopPenfold

Reputation: 111

Rotating Pictures on WP8 Nokia Map

My class is making a WP8 app with many (Nokia) mapping components, I am programming a map with pictures defined on overlays on the map. I have, in my program (C# WP8), a map with the ability to change the heading with a slider. on the map there are several images, when the map is rotated the images move location because they are defined by the top left corner rather than the center. If anyone knows how to center the image so that it stays in the same place or another way to avoid this dilemma please slap the solution my way.

Map1

Map2

Upvotes: 0

Views: 222

Answers (1)

anderZubi
anderZubi

Reputation: 6424

Set the PositionOrigin property of the MapOverlay element containing the image to the center of the element.

For example:

    var overlay = new MapOverlay();
    overlay.Content = yourImage;
    overlay.PositionOrigin = new Point(0.5, 0.5);

Or in XAML:

    <maps:MapOverlay PositionOrigin="0.5,0.5">
        <Image Source="yourImage"/>
    </maps:MapOverlay>

Upvotes: 1

Related Questions