Sree
Sree

Reputation: 391

SetAnchor for MapOverlay

In the map control[wp8] i have used a mapoverlay for plotting the GeoCoordinate. The issue i'm facing is that while zoom-in and zoom-out the overlay moves out of it's location to some where else. Is there any way we can anchor it to that particular position like the "SetAnchor" property used for anchoring the pushpin. I have tried the PostionOrigin property without getting any desired result.Thanks in advance...

Upvotes: 4

Views: 181

Answers (1)

Nitha Paul
Nitha Paul

Reputation: 1401

Try something similar to this,

        var containerCanvas = new Canvas { Height = 100, Width = 100 };
        _dragMarker = new MapOverlay();
        var dragMarkerLayer = new MapLayer();
        var image = new Image
        {
            Source = DContext != null ? new BitmapImage(new Uri(DContext.DragImagePath, UriKind.RelativeOrAbsolute)) : new BitmapImage(),
            Height = 100,
            Width = 100,

        };


        containerCanvas.Children.Add(image);
        _dragMarker.Content = containerCanvas;
        _dragMarker.PositionOrigin = new Point(0.5, 0.75);

It works fine for me... :)

Upvotes: 2

Related Questions