Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
315
xam map with image overlay
posted

Hi,

I need to map a substantial number of elements on a map (ie approx 50,000). Although this works, it's obviously very slow.

Instead I've developed a system which will create an image, and place dots on the image in the relevant location based on lat/long. I can then overlay this transparent image over the map.

This works fine if I have the map set to a default zoom, however as soon as I zoom in or out, the image overlayed resizes, so then all my points are out of position.

How do I change this so effectively it works in the same way as the map background, ie so when I zoom in or out, my image zooms accordingly?

Currently I'm just adding the image as an element to the map;

        Dim origin As Point = MapTest.MapProjection.ProjectToMap(New Point(0,0)) 'Add image to centre
        Dim element As New SymbolElement()

        element.SymbolOrigin = origin
        element.Caption = "MyImage"
        element.SymbolType = MapSymbolType.None
        element.IsClickable = True

        element.Value = 1 --use first image from the layer

        MapTest.Layers("symbolLayer").Elements.Add(element)
        Dim worldRect As Rect = MapTest.Layers("symbolLayer").WorldRect
        worldRect.Union(element.WorldRect)
        MapTest.Layers("symbolLayer").WorldRect = worldRect

The front end has the following layer, with the image built in;
                <ig:MapLayer x:Name="symbolLayer">
                    <ig:MapLayer.ValueTemplate>
                        <DataTemplate>
                            <Image Width="3000" Height="2000" Source="i/MyPointsLayer.png" />
                        </DataTemplate>
                    </ig:MapLayer.ValueTemplate>
                </ig:MapLayer>

Any help appreciated.