How to Make Virtual Earth 3D Live Forever

Hello all,

When we announced that we’re “discontinuing investment” in VE3D earlier this year, many of you expressed concern that this would mean you can’t use VE3D anymore.  I deal with technical issues, so let me address those.  There’s certainly nothing time-bomby in the code, so it’ll keep right on functioning as it always did.  The obvious concern is that VE3D is very much a web-connected bit of code, and what happens if the servers we run get turned off?

Well, the first thing to say is that we really have no reason to turn them off.  Most of the data VE3D uses is also used in our other products, and that which isn’t doesn’t represent a significant cost in server capacity.  But that’s not a technical thing to say, is it?  And I said I deal with technical issues, so what DOES happen if the servers get turned off?

If you’re using the built-in default data sources, VE3D stops working.  It won’t crash or anything, but it’ll be pretty boring:  no data, nothing to see.  But, as you know, you can replace those data sources quite readily.  So it should be easy to just point it somewhere else, right?

Well, slight complications, then good news and bad news.  The complications stem from the fact that we never designed the system from the ground up to be completely separated from the mothership.  So, the system does make some assumptions about what servers it can see.  Fortunately, using Reflection you can do just about anything, and I’ve put together a Windows Forms sample that controls (or removes) those assumptions on a flag-by-flag basis.

The good news is that by using the right combination of flags, you can have the code run only against servers you control, or even against no servers at all, using only locally stored/generated data.  In these configurations you no longer care if our servers are on or off, and the code is easily copy/pastable into your own projects (just pay attention to where each flag is implemented in the startup process).

The bad news is that Weather, DEM, and Model data is a bit tricky.  I haven’t spelled out precisely how to supply your own data, because unlike web mapping imagery data there really isn’t a standard, even a de facto one.  So I provide pointers in the code to where you need to look to write your own sources, but you’ll need to do the lifting on your own.

Here’s where you can find the code.

Have fun, and please contact me with questions and comments.  Thanks, it’s been great!

Comments (11)

  1. natelawrence says:

    Nikolai, is there any chance that your team could open source your code to the Read/Write World community, since their team is planning to release open source RML viewers anyway?

    I know that the VE3D code would need to be modified to work with RML, but it seems like building a Direct3D RML viewer would go much more quickly if the community had the VE3D code to start from.

  2. John Stewien says:

    Thanks for this sample. I assume this stops VE3D from trying to fetch…/WinIntPCA.crl on its first run, which seems to be a required step to get custom terrain working on an isolated network.

  3. John Stewien says:

    The API for VE3D is great and spoils me with regard to other APIs, so I'm not saying goodbye to it until I have to. I did however have to fix a bug with the DemTile class today when I wanted to use the ToBitmap() method.

    Initializing the pointer to the bitmap data is done like this:

    byte* numPtr = (byte*) ((byte*)bitmapdata.Scan0.ToPointer() + (i * bitmapdata.Stride));

    but before it's used it's incremented


    numPtr[0] = (byte) num10;


    numPtr[0] = (byte) num9;


    numPtr[0] = (byte) num8;

    hence at the end it oversteps the memory bounds by 1 byte, causing a memory access violation exception.

  4. Should you still be able to add polygon geometries to the map with this setup?  I modified the WinForms test app to add a PolygonGeometry on a VM that did not have Internet access and it didn't show up.

  5. Gabriel Moreira says:

    I need to use the Bing Maps 3D globe offline, only for upper levels tiles.

    But the code sample link is broken.

    How could I get the sample?

  6. NikolaiF says:

    Gabriel:  I've updated the link.  Thanks for pointing that out!

  7. Gabriel Moreira says:

    Thank you Nikolai.

    The sample works like a charm!

  8. Jeremy says:

    New code doesn't seem to live forever though.  I've upgraded our solution from VS2008 to 2012 and all the map tiles are green.

  9. want to place a 3d model on the globe says:

    hi Nikolai

    I am trying to place a 3d model on the globe been working since 2 days couldnt manage to make xfile sample working please help with the documentation or something to move forward



  10. Zac Burns says:

    Is there an archived version of the documentation somewhere? That would be very useful for those of us maintaining legacy applications.