Condividi tramite


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

  • Anonymous
    August 21, 2011
    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.

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

  • Anonymous
    September 20, 2011
    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++; numPtr[0] = (byte) num10; numPtr++; numPtr[0] = (byte) num9; numPtr++; numPtr[0] = (byte) num8; hence at the end it oversteps the memory bounds by 1 byte, causing a memory access violation exception.

  • Anonymous
    September 26, 2011
    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.

  • Anonymous
    July 16, 2013
    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 VE3D_Unchained.zip sample?

  • Anonymous
    July 17, 2013
    Gabriel:  I've updated the link.  Thanks for pointing that out!

  • Anonymous
    July 20, 2013
    Thank you Nikolai. The sample works like a charm!

  • Anonymous
    December 05, 2013
    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.

  • Anonymous
    May 06, 2014
    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 Thanks Ram

  • Anonymous
    November 17, 2015
    Is there an archived version of the documentation somewhere? That would be very useful for those of us maintaining legacy applications.

  • Anonymous
    November 19, 2015
    The comment has been removed