Page view counter
Virtual Earth Image Download Problem Subscribe to this thread
Last post 10-11-2007 12:14 PM by szviktor. 3 replies.
Sort Posts:
08-27-2007 12:01 AM
Virtual Earth Image Download Problem

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 System;

using System.IO;

using System.Windows;

using System.Windows.Controls;

using System.Windows.Media;

namespace UntitledProject14

{

public partial class Page : Canvas

{

public Page()

{

this.Loaded += this.Page_Loaded;

}

private void Page_Loaded(object sender, EventArgs args)

{

// Required to initialize variables. Needs to be done from loaded event so FindName works properly.

InitializeComponent();

// Insert code required on object creation below this point.

image1.Source = new Uri("http://tiles.virtualearth.net/tiles/r021230030203033.png?g=1", UriKind.RelativeOrAbsolute);image2.Source = new Uri("http://tiles.virtualearth.net/tiles/r021230030203031.png?g=1", UriKind.RelativeOrAbsolute);

}

}

}

ercercerc

Loading...
Joined on 06-24-2007
Posts 36
08-29-2007 5:03 PM
Re: Virtual Earth Image Download Problem

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.

swirlingmass

Loading...
Joined on 05-02-2007
Posts 385
08-29-2007 10:58 PM
Re: Virtual Earth Image Download Problem

 

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.

 Enrique

ercercerc

Loading...
Joined on 06-24-2007
Posts 36
10-11-2007 12:14 PM
Re: Re: Virtual Earth Image Download Problem

I have similar problem with google map images:

<Canvas>

<Image Source="http://mt2.google.com/mt?n=404&amp;v=w2.61&amp;x=0&amp;y=0&amp;zoom=13" Canvas.Left="11" Canvas.Top="21" Visibility="Visible" ></Image>

</Canvas>

 

 

szviktor

Loading...
Joined on 10-11-2007
Posts 1
Microsoft Communities