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
xamMap layer image background


I've been with some issues related to assign a png image as a layer background.

When zoom in, the image stretch and changed in wrong way. I tested several stretch modes without success.

The result I'm looking at is to assign an image to a layer (as a background) and when map zoom in the image has to zoom in too, (image will loose resolution but that's not a problem now).

Dim myImg As ImageBrush = New ImageBrush()
myImg.ImageSource = New BitmapImage(New Uri("pack://application:,,,/Test;component/Images/img1.png", UriKind.RelativeOrAbsolute))
myImg.AlignmentX = 0
myImg.AlignmentY = 0
myImg.Stretch = Stretch.UniformToFill
myImg.TileMode = TileMode.None

Map.Layers("testLayer").Elements(0).Fill = myImg

<ig:XamMap x:Name="xamMapTest" MapProjectionType="Equirectangular" Background="#FFA0C3FF" IsPannable="True" IsZoomable="True" Focusable="False">
<ig:MapLayer x:Name="testLayer" IsVisible="True" ShadowFill="{x:Null}" ShadowOffset="0,0" Focusable="False" FillMode="None" DataMapping="Name=ShapeId;Caption=Caption;" DataSource="{Binding items, Mode=OneWay}" >
<ig:ShapeFileReader Uri="/ShapeFiles/test" DataMapping="Name=ID" />

Can someone please gives me an example to solve this issue?

Many thanks for all your help.