Welcome to MSDN Blogs Sign in | Join | Help

New Version of VE3D

You may have noticed that we have not blogged recently, and that’s because we’ve been hard at work on the next version of Virtual Earth 3D.  The new version features some rendering improvements for the general user, but the most exciting part is for devs (well, that's what we think, but we ARE devs).  We have enabled partial trust plug-ins, which means you can put your plug-in on the web, create a page that references it, and users can go see it without having to install anything more than the basic VE3D control.

 

Behind the scenes, we load your plug-in’s dll to the client and execute it with a limited set of permissions.  For example, the plug-in cannot access the file system on its own, but you can still do custom rendering and control like you could before.  We’ve updated all the samples you’ve seen so far to run like this, except for the x file loader and the shortcut key (which was an example of how to install one, and is still a valid scenario in some cases).  We’ve also added a few new samples to show some new functionality and demonstrate some stuff that’s been there for awhile but we hadn’t gotten a chance to show yet.

 

Existing code built against VE3D will need to be recompiled, and in some cases we’ve moved a few properties around.  The samples should cover most of these changes, but please comment or send us feedback on items that you have trouble with.

 

Get the new version!

 

Get the new samples!

Published Thursday, September 25, 2008 6:03 PM by NikolaiF
Filed under: ,

Comments

# New Version of VE3D : EasyCoded

Thursday, September 25, 2008 1:18 PM by New Version of VE3D : EasyCoded

# re: New Version of VE3D

Friday, September 26, 2008 9:48 AM by pmont

Very nice!

I really, really like the reduction in memory footprint.  Is this anywhere near what you are going to be at release?  Or is it going to bet better still?

How does one enable traffic and weather on a Winform based app? I see some methods, but I dont see a sample using them. Also, when is the WPF version going to hit?  <grin>

So many questions. <grin>

Mark Merchant was going to get in touch with you about our interest in using this.

Thanks

Paul from THD.

# re: New Version of VE3D

Friday, September 26, 2008 12:58 PM by NikolaiF

Weather is easy (and trees too):

           Guid[] gA = this.loader.LoadPlugIn(@"http://go.microsoft.com/fwlink/?LinkID=109495"); // trees

           this.loader.ActivatePlugIn(gA[0], @"http://maps.live.com//Manifests/SM.xml");

           gA = this.loader.LoadPlugIn(@"http://go.microsoft.com/fwlink/?LinkID=124120"); // clouds

           this.loader.ActivatePlugIn(gA[0], @"http://maps.live.com//Manifests/WE.xml");

Traffic is a little trickier, because it's a complex data feed.  The short answer is:  use the Javascript API.  But you can get basic traffic flow imagery, without incident reports, by looking at the TerrainImages sample (it's the "TR" datasource).  Mark may be able to help you with the rest of the traffic data.

It is possible for VE3D to play nice with WPF.  However we haven't ironed out all the kinks.  When we have the full story you'll probably see it here.

We're always working on memory and perf.  :)

# re: New Version of VE3D

Monday, September 29, 2008 7:18 AM by pmont

Nikolai,

Thanks, Remember, I am playing with a WinForm app, using the VE3D control, so Javascript is right out. :)

I tried to load the plugins (trees and weather ) you specified above, but I saw no visual changes.  Are they specific to a particular region?  I tried it in both my test app, and the SimpleForm in the Samples downloads.

Thanks again.

Paul

# re: New Version of VE3D

Monday, September 29, 2008 1:33 PM by NikolaiF

The trees and clouds are limited to certain cities, but there are a good number of them.  Las Vegas has both.  The weather is real-time, so if it is a clear day in a given city you will not see clouds.  You can also try Tampa, and there are more but I can't recall them off the top of my head.

The web services that supply the rest of the traffic data may be accessible from other clients, but I do not know how.  Sorry.

# re: New Version of VE3D

Monday, September 29, 2008 2:04 PM by TorreyS

Great, thanks for the samples.

I noticed that with a WinForms app using the GlobeControl, I no longer am able to display information in the lower right corner. With 6.1 I could use the globeControl.Host.WorldEngine.ShowXXX properties to control what is displayed. These properties still exist, but don't seem to control what is displayed. Is there a new interface I am missing?

Thanks,

Torrey

# re: New Version of VE3D

Monday, September 29, 2008 2:23 PM by TorreyS

I have another question. I am trying display a set of tiles generated from MapCruncher. Looking at the TerrainImages example, the third method for adding images to the ground seems to fit my needs. I am trying to use the file system rather than IIS to store the tile images. In the connectionParameters for the DataSourceLayerData, I define the tilesource field as:

tilesource\"file://d:\\Layers\Alaska\\%4.png\"

When I add the DataSource I receive an exception stating that "A valid tile request format string was not supplied".

Is it possible to have a tilesource like this that is on the local file system?

If so, how do I format the "tilesource" field of the connectionParameters?

Thanks,

Torrey

# re: New Version of VE3D

Tuesday, September 30, 2008 9:34 AM by pmont

So the clouds only appear when you are looking up?  I see them when I zoom down, and change my viewpoint to look sideways, but I dont see them if I am in the air looking down.

Is there any talk about integrating near real time radar, or storm alerts?  If not, is the assumption that we would need to hook into a tile server to feed the data?

Thanks, Neat stuff

Paul

# re: New Version of VE3D

Tuesday, September 30, 2008 1:06 PM by NikolaiF

pmont:

That cloud behavior is intentional, so as to minimize obstruction of the map.  The behavior is not user (or api)-controllable at the moment.

Torrey:

The tilesource string doesn't work with file system paths.  You will need to write your own DataSource.  Fortunately, reading tiles off the file system is pretty easy.  Start with the Mandelbrot sample.  In QueryPrimitivesInternal, you'll see some commented-out code that shows how to get a TileId from the query.  This can be changed into a RequestCode, which can be used as the %4 part to construct your file path.  Just read each file as a Bitmap, create a RasterPatch2, and return it.

MapCruncher outputs tiles in Mercator, so also switch the RasterPatch2 to use MercatorCRS instead of Wgs84.

# re: New Version of VE3D

Monday, December 29, 2008 4:55 PM by clyde@clydeford.com

Hi, VE3D Team,

I'm trying to bring up the Camera dll sample in a WebBrowser control under a partial trust environment. Have no problem loading and activating the dll from my local machine, but when I issue the Raise Event for the dll to 'jump' the globe to a random location, I get an HRESULT 0x80020101 error from the control.

Any thoughts on what I might be doing wrong?

Thanks,

Clyde

# re: New Version of VE3D

Sunday, January 04, 2009 5:34 PM by NikolaiF

Clyde,

I'm sorry, I'm not very familiar with the WebBrowser control, having essentially just barely started using it with my most recent post.  I _think_ that that error is a generic error from the WebBrowser.  I do not think that VE3D raises it.

I just now tweaked the popup sample to open a Popup right away, instead of creating a GlobeControl on the form, and instead of calling Navigate with blank I passed the url to the public camera sample page (http://www.veteam.members.winisp.net/Spaceland/Samples/Camera/TestPage.htm).  I also get an error if I hit the jump button, though about a variable being null.  If I wait a bit, it starts working.

I'm guessing that this is something with how I'm hosting the WebBrowser, and I think (unfortunately) I'm going to have to call this an "unsupported scenario".  Sorry.  Have you tried just hosting the globe control directly on your form, and using WebBrowser just for additional html content?

You can still use partial trust on a WinForm by passing a GlobeControlInitializationOptions object to the GlobeControl ctor, using RestrictedAppDomain.GetAppDomain.  However, this involves AppDomain/marshalling fun and is not for the faint of heart.  I hope to post something on it sometime -- short story is that all your business logic should be in either a plug-in or an object that is CreateInstanceAndUnwrap'ed into the new AppDomain.

# re: New Version of VE3D

Thursday, January 08, 2009 1:58 PM by clyde@clydeford.com

Nikolai,

Happy New Year. Thanks for your reply. I have tracked down my problem more and also realized I could have been a bit clearer with my first message. Here's what I'm up against:

1. Creating a WPF application that has to run in partial trust.

2. Currently have VE hosted in a Web Browser control operating in 2D mode only.

3. VE3D needs to be called based on events taking place in controls other than the control VE3D is hosted in.

4. I can instantiate VE in 2D mode, then call against the VE Javascript API using the WebBrowser's InvokeScript method.

5. If I try to instantiate VE in 3D mode from the WebBrowser's onload event the instantiation works fine but subsequent InvokeScript calls fail with an undetermined HRESULT error.

6. If I try to instantiate VE in 3D by using an InvokeScript call from managed code into the WebBrowser the LoadMap function fails on an "unmanaged code" security permission exception.

7. I was trying to use the undocumented plug-in load methods to get around this problem, but I can't seem to get past the unmanaged code security permission exception. I've tried lots of different options to give myself permission to call unmanaged code but nothing seems to work.

8. I thought that by packaging the map control DLLs in my own assembly I could workaround the unmanaged code security restrictions. But I can't seem to find a way.

Any suggestions appreciated.

Clyde

# re: New Version of VE3D

Sunday, January 11, 2009 2:50 PM by NikolaiF

Hello Clyde,

I'm unclear from your description where the error is exactly.  Could you try checking VE3D's logs?

Log files are generated at:

(Vista) C:\Users\{username}\AppData\LocalLow\Microsoft\Virtual Earth 3D

(XP) C:\Documents and Settings\{username}\Local Settings\Application Data\Microsoft\Virtual Earth 3D

If you don't see any logs, the user.config file is located at:

(Vista) C:\Users\{username}\AppData\LocalLow\Microsoft\Virtual Earth 3D

(XP) C:\Documents and Settings\{username}\Application Data\Microsoft\Virtual Earth 3D

Add this to the config file:

     <setting name="Logging" serializeAs="String">

       <value>True</value>

     </setting>

If the errors are originating in VE3D I can probably help.  If it is WPF + WebBrowser then another forum might be better.  VE3D does use unmanaged code (DX), and is not intended to itself be in partial trust, but I can't immediately think of why your calls would fail but onload would be ok.

You might also try seeing if you can catch the error in a debugger.  In VS try turning Just My Code off.

# re: New Version of VE3D

Friday, January 16, 2009 11:54 AM by clyde@clydeford.com

Nikolai,

Again, thanks for getting back to me. I'm still trying to track down my problem which seems to be related to managed code calling into unmanaged code.

(1) I've separated out the user control with the webbrowser control that host VE3D into a separate assembly;

(2) I've given the the assembly APTCA and suppressed unmanaged code security for the calls into the VE3D javascript API.

Here's the error I get from the error log when I use the InvokeScript method of the web browser control to call the map.SetCenter method of VE3D (note this call works in 2D):

Created: 1/16/2009 4:43:53 PM

-

1/16/2009 4:43:53 PM : System.Runtime.Remoting.RemotingException: 'LeaseTime' can only be set once within an AppDomain.

  at System.Runtime.Remoting.Lifetime.LifetimeServices.set_LeaseTime(TimeSpan value)

  at Microsoft.MapPoint.Rendering3D.Host..ctor(Control control, String dataPath, Boolean createGraphicsEngine, AppDomain appDomain)

1/16/2009 4:43:54 PM : Can't open cache, try readonly:  System.IO.IOException: Set in use

  at Microsoft.MapPoint.Data.VirtualEarthTileDataStore.Caching.MiniStitchFileSet..ctor(String path, Boolean usePartialAccess)

  at Microsoft.MapPoint.Data.VirtualEarthTileDataStore.PersistentCache.Open(String path, Boolean withPartialAccess)

  at Microsoft.MapPoint.Data.VirtualEarthTileDataStore.PersistentCache.Open(String path)

  at Microsoft.MapPoint.Rendering3D.Host.InitializePersistentCache()

1/16/2009 4:43:58 PM : Created HiResModelsPlugin

1/16/2009 4:43:58 PM : Activating HiResModelsPlugin

1/16/2009 4:44:13 PM : Unhandled exception from Player.exe

1/16/2009 4:44:13 PM : System.Runtime.InteropServices.COMException (0x80020101): Exception from HRESULT: 0x80020101

  at MS.Win32.UnsafeNativeMethods.IDispatch.Invoke(Int32 dispIdMember, Guid& riid, Int32 lcid, Int32 dwFlags, tagDISPPARAMS pDispParams, Object[] pVarResult, tagEXCEPINFO pExcepInfo, IntPtr[] pArgErr)

  at System.Windows.Controls.WebBrowser.InvokeScript(String scriptName, Object[] args)

  at WpfVirtualEarth.HtmlScriptInvoker.InvokeScript(ScriptFunction function, Object[] parameters)

  at WpfVirtualEarth.HtmlScriptCommand.InternalExecute()

  at WpfVirtualEarth.HtmlScriptCommand.Execute()

  at WpfVirtualEarth.HtmlScriptCommandQueue.ExecuteNext()

  at WpfVirtualEarth.HtmlScriptCommandQueue.Enqueue(HtmlScriptCommand command)

  at WpfVirtualEarth.VirtualEarth.AddPushPin(PushPin pin)

  at WpfVirtualEarth.VirtualEarth.OnPushPinsChanged(Object sender, NotifyCollectionChangedEventArgs e)

  at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)

  at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)

  at System.Collections.ObjectModel.Collection`1.Add(T item)

  at Microsoft.Education.Semblio.Sdk.Samples.Activities.DocumentWithVE.DocumentControl_GeoLinkClicked(Object sender, RoutedEventArgs rea)

  at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)

  at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)

  at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)

  at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)

  at Microsoft.Education.Semblio.Sdk.Samples.Activities.DocumentPane.GenericHandler(Object sender, RoutedEventArgs e)

  at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)

  at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)

  at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)

  at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)

  at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)

  at System.Windows.ContentElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)

  at System.Windows.Input.InputManager.ProcessStagingArea()

  at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)

  at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)

  at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)

  at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

  at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

  at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

  at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)

  at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)

  at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

  at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

  at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)

  at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)

  at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

  at MS.Win32.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)

  at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

  at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)

  at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)

  at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)

  at System.Windows.Threading.Dispatcher.Run()

  at System.Windows.Application.RunDispatcher(Object ignore)

  at System.Windows.Application.RunInternal(Window window)

  at System.Windows.Application.Run(Window window)

  at Microsoft.Education.Semblio.Sdk.App.Main() in C:\Users\admin\Documents\Visual Studio 2008\Grava\SDK\1.0\VE Test\Player\Player\App.cs:line 38

1/16/2009 4:44:13 PM : CLR Terminating: True

# re: New Version of VE3D

Friday, January 16, 2009 7:22 PM by clyde@clydeford.com

Nikolai,

If I read the error log correctly it would appear that the VE3D control is accessed via the .NET Remoting Framework, and that between the time of my first call to LoadMap(...) and the second call to SetCenter(...) the Lease on that Remoting object has expired. Am I understanding this error report correctly?

If this is the case, is there a way to extend the lease on the VE3D control?

Clyde

# re: New Version of VE3D

Friday, January 16, 2009 7:33 PM by clyde@clydeford.com

Nikolai,

I want to revise my last message. It appears that the lease being set more than once, so is there any way to prevent this.

Clyde

# re: New Version of VE3D

Saturday, January 17, 2009 2:06 PM by NikolaiF

The lease message and the cache message are both caused by trying to create VE3D twice in the same process, which is not supported.  I do not know if or how that would affect the second error, which doesn't seem to be directly related to 3D.

Anonymous comments are disabled
 
Page view tracker