Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Virtual Earth Image Download Problem
3 replies. Latest Post by szviktor on October 11, 2007.
(0)
ercercerc
Member
92 points
36 Posts
08-27-2007 12:01 AM |
I have a very strange problem with image downloads form Virtual Earth's tile server.
I have a Silverlight application that downloads image tiles to create a map. Everything works fine but I noticed some tiles would consistently not download and show a black image instead. The missing tiles are those that are all blue, as shown by VE on a large body of water - like a lake - in Road map style. If the tile has anything other than the blue pixels it all works fine. This was driving me crazy as I thought I was doing something very stupid so I wrote a test program on Blend 2 August Preview as shown below. The only thing I modified was 1) add the Image statements in the XAML, and 2) add the code to set the image sources in the Page_Loaded event.
When I run this code the images with source http://tiles.virtualearth.net/tiles/r021230030203033.png?g=1 display correctly but those with http://tiles.virtualearth.net/tiles/r021230030203031.png?g=1 do not, simply displaying a black square. This happens both for the images with Source defined in the XAML and those with the Source set in Page_Loaded.
To complete the strangeness, Blend's XAML editor properly shows both images when in the Design mode.
Any clues???
Enrique
First the Page.xaml file:
<Canvas xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:UntitledProject14="clr-namespace:UntitledProject14;assembly=ClientBin/UntitledProject14.dll" Width="640" Height="480" Background="Blue" x:Class="UntitledProject14.Page;assembly=ClientBin/UntitledProject14.dll" x:Name="Page" > <Image x:Name="image1" Canvas.Left="10" Canvas.Top="0" Width="256" Height="256" /> <Image x:Name="image2" Canvas.Left="300" Canvas.Top="0" Width="256" Height="256" /> <Image x:Name="image3" Canvas.Left="10" Canvas.Top="260" Width="256" Height="256" Source="http://tiles.virtualearth.net/tiles/r021230030203033.png?g=1" /> <Image x:Name="image4" Canvas.Left="300" Canvas.Top="260" Width="256" Height="256" Source="http://tiles.virtualearth.net/tiles/r021230030203031.png?g=1" /></Canvas>
Now the Page.xaml.cs file:
using
{
}
InitializeComponent();
swirling...
Participant
1348 points
385 Posts
08-29-2007 5:03 PM |
Looks like a bug to me. I can download that image, and view it with any picture viewing program, such as Paint, but when I try to use it as an image source, I get the black box as well. I don't know how Virtual Earth works. Is this particular image responbile for all your black spots? If so, maybe you can substitute your own tile whenever it's trying to use this particular one.
08-29-2007 10:58 PM |
Yes, it only seems to fail on this particular all-blue image. I can work around it in my application for now assuming this is in fact a Silverlight bug.
szviktor
2 points
1 Posts
10-11-2007 12:14 PM |
I have similar problem with google map images:
<