3D Terrain Mapping in a Browser

3D Terrain Mapping in a Browser


Is it really possible to view 3D terrain in a browser? Yes, with the aid of Silverlight, Esri’s Silverlight SDK and Balder, an open source 3D graphics engine. The sample web application pictured above is running live here and the source code can be downloaded from here.


How to use?


After the web application has loaded, pan and zoom to an area of interest and then click the “Switch to 3D View” button. The application will pause slightly as it downloads a new map image and the underlying elevation data. After the map has transformed to a 3D display you can use the left mouse button to tilt and/or pivot the extruded terrain. Click “Switch to 2D” to return to the original 2D map display. Try repeating the steps above for your favorite places around the world (land or sea)!


A quick method to zoom to a specific extent is to hold the shift key down while dragging with the left mouse button. This will render a red rectangle on the screen.  When the left mouse button is released the map will zoom to the extent defined by the rectangle.


To assist, here is a short video demonstration on YouTube.


Where does the data come from?


The imagery, street and topography base maps are sourced directly from Esri’s ArcGIS Online portal for geospatial services, data, applications and communities.


Elevation data is sourced from SRTM, GTOPO30 and GEBCO bathymetry via a new service published yesterday. The service was developed as a custom Server Object Extension for ArcGIS Server.  For more information on this service and how it was implemented please visit this blog post.


Contributed by Richie C.

This entry was posted in Uncategorized and tagged , , , , . Bookmark the permalink.

Leave a Reply

19 Comments

  1. tanoshimi says:

    This looks really interesting for a prototype I’m developing at the moment. Sadly the download link appears to be broken (http://www.arcgis.com/home/item.html?id=7c611fc1eb1c446a8cdfd016dee63cd0)
    Couldn’t find the sourcecode by browsing the resource centre either – any chance of fixing it please? Thanks!

  2. Richie says:

    @Tanoshimi – My appologies, I accidently removed the source code from arcgis.com last week when I was testing another app. The source code for the Terrain Mapper has been republished and the link in this post updated. Here is the new link:
    http://www.arcgis.com/home/item.html?id=507c830e4311410181be5b3d2b695446

  3. tanoshimi says:

    The link is working now – thankyou. I have an existing desktop application similar to yours but using a WPF GeometryMesh3D – I’m looking forward to seeing if Balder will allow me to implement it in Silverlight instead.

  4. weigis2008 says:

    this.BorderControls = ((System.Windows.Controls.Border)(this.FindName(“BorderControls”)))

    Not from text “dataInput: Label” create “System. Type” why?

  5. weigis2008 says:

    over.. thanks

  6. icube says:

    Is it possible to port it to WPF? as i’m developing Microsoft Surface-type application, would like to see this in WPF

  7. icube says:

    Hi, i tried running the source code but the elevations are not applied.. the heightmap just shows a flat plane… not sure what is wrong?

  8. ericoneal says:

    Same here. The source code will not apply the elevations, all I get is a flat surface too…

  9. Richie says:

    @weigis, @icube & @ericoneal,

    Sorry about the delay. I suspect the issues you are having related to the dependancies. To solve this I have uploaded the source code again but this time with all dependancies bundled. Please let know if you continue to have problems.

    Cheers,
    Richie

  10. ericoneal says:

    Its working now, thanks!

  11. dp3lw says:

    I’m wondering how I can modify this app to consume my own ArcGlobe service.
    Also when I try running your existing software I’m getting “icube’s” error which I believe has to do with the “Balder” configuraiion.

  12. minerjoe says:

    @weigis2008

    Could you give some insight into how you solved the error. I am getting this I cannot seem to figure out how to fix. I have checked and everything is pointing to the references Richie included, so not sure what might be missing. Thanks

  13. minerjoe says:

    Seems the issue with this error “Failed to create a ‘System.Type’ from the text ‘dataInput:Label” is that some of the references used by the Theme assembly needs to be referenced by the project. Adding these assemblies:

    System.Windows.Controls.Data.DataForm.Toolkit
    System.Windows.Controls.Data
    System.Windows.Controls.Input
    System.Windows.Controls.Input.Toolkit
    System.Windows.Controls.Layout.Toolkit

    Solved the problem for me. Sometimes in Silverlight when an assembly references another assembly if VS 2010 knows where it is it will just add it in your bin/… folder and puts it in the xap without really letting you know about it, which may be what occured for these on the original development machine and why no direct reference was ever needed.

  14. rafo says:

    how I can create lift with two different map services, need to show both 3D terrain map service as a service as vector data on the base map, but I have separate services, which would be the options to
    do this.

  15. Currently i am using Balder 0.8.8.9. I am able to view the flat 3D view, but the elevation is not getting applied. Any suggestions, for getting the elevation into 3D model being created.

  16. fy19891009 says:

    How to solve the difficulties “icub”encountered~ i’ve got the same error warning ?thank you!!

  17. madormapad says:

    Hey,
    is it possible to work with Balder with the wpf api 2.4?
    or its only for browser?

    thanks,
    Guy.

    • richie says:

      Hi Guy,

      If you are asking if this app can be ported to WPF then the answer is yes. The Balder graphics engine is available for SL3, SL4, SL5, WP7 and WPF. Although for WPF you may have to download and compile the source code yourself.

      It is important to note that the ArcGIS API for Silverlight is not being used to render map tiles or graphics. The ArcGIS API for Silverlight is only used to download ArcGIS Online basemap image tiles.

      Hope this helps.

      Cheers,
      Richie