RSS weather 3D layer


Purpose
This sample illustrates a comprehensive real-life scenario for creating a new layer to consume a Web service and display the information in a three-dimensional (3D) environment using a direct OpenGL plug-in.
This sample shows implementation of the following:
  • Simple editing capabilities
  • Selection by attribute and location
  • Persistence
  • Identify

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample.

Data has been provided for your use with this sample. It can be found at <Your ArcGIS Developer Kit Install directory>/Samples/data/USZipCodeData/US_ZipCodes.shp and <Your ArcGIS Developer Kit Install directory>/Samples/data/USZipCodeData/ZipCode_Boundaries_US_Major_Cities.shp.
If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Start Visual Studio, open the solution file, and build the project.
  2. Open a GlobeControl application or ArcGlobe.
  3. From the toolbars list, select the Weather toolbar to add to the application.
  4. Click Load Layer to connect to the Yahoo RSS weather service.

Additional information

The following items are covered in this sample:
  • Implementing a GlobeCustomLayer through inheritance of a BaseClass.
  • Consuming Web services (Yahoo really simple syndication [RSS] service).
  • Executing a lengthy ArcObjects task on a background thread.
  • Sharing resources between multiple threads.
  • Updating user interface (UI) components from a background thread to keep responsiveness.
  • Creating OpenGL display lists.
  • Mapping a bitmap into OpenGL texture and binding the texture to a geometry.
  • Technique to filter items that are outside the viewport.
  • Technique to billboard items.
  • OpenGL selection buffer (to perform select by area).
  • Implementing identification.
  • Implementing commands and tools to interact with a custom layer.
  • Implementing a toolbar for GlobeControl and ArcGlobe.


RSSWeatherLayer3DClass.cs Implementation file of the custom layer.
GlobeWeatherIdentifyObject.cs Implementation file of IIdentifyObject required to support standard identification.
IdentifyDlg.cs Identify dialog box used by the Identify object.
AddWeatherLayerCmd.cs Command that connects and disconnects the layer from RSS Web service.
RefreshLayerCmd.cs Command that produces the update thread of the layer.
AddWeatherItemCmd.cs Command that allows adding weather items by a given ZIP Code.
ZipCodeDlg.cs Dialog box where users type a ZIP Code to add new weather items.
AddWeatherItemTool.cs Tool that allows adding weather items by clicking a location on the Globe.
SelectByCityNameCmd.cs Allows selection of weather items from a list according to the city name.
WeatherItemSelectionDlg.cs Selection dialog box for the SelectByCityName command.
SelectItemsTool.cs Selection tool that allows select by location.
WeatherLayerToolbar.cs Toolbar that hosts the layer's commands and tools.
GlobeCustomLayerBase.cs Abstract base class implementing essential interfaces required to implement an ArcGIS layer for ArcGlobe and GlobeControl.
Download the C# files

Download the files for all languages

See Also:

How to get and install an OpenGL wrapper for .NET
How to draw a geographical object on the globe using direct OpenGL plug-in
Implementing custom globe layers with dynamic feed
How to draw mouse feedback on the globe using direct OpenGL plug-in
Writing multithreaded ArcObjects code




Additional Requirements
  • This sample can only be done in C# (and not in VB .NET). This is because "unsafe" is not supported in VB .NET, and it is needed here because pointers need to be used with this third party library.

Development licensing Deployment licensing
Engine Developer Kit Engine: 3D Analyst
ArcGIS for Desktop Basic: 3D Analyst ArcGIS for Desktop Basic: 3D Analyst
ArcGIS for Desktop Standard: 3D Analyst ArcGIS for Desktop Standard: 3D Analyst
ArcGIS for Desktop Advanced: 3D Analyst ArcGIS for Desktop Advanced: 3D Analyst