ESRI Widget, Flex Application, PDC Active Hazards

Home » Solutions

PDC Active Hazards Widget

Flex Developers - Enhance Your Disaster Management Apps with PDC Real-time Hazards

Demo for PDC Active Hazards Widget
See this simple demo on how the PDC Active Hazards widget may be applied to your map applications.

The PDC Active Hazards Widget can be easily dropped into your ESRI Flex API application. It provides self-contained functionality to display real-time hazard features. These hazard data are issued by authoritative sources and processed by the PDC DisasterAWARE decision support system, used by disaster management professionals worldwide. PDC's Active Hazards layers include data from sources such as USGS, NOAA, PTWC, NWS, and JTWC.

The instructions below describe how to add the Widget to your ESRI ArcGIS Server Flex API application (presently only supports version 1.3). This document is for anyone who already knows how to compile the Flex viewer from ESRI and deploy it to a web server.

  1. Download the Widget

    1. Visit the Widget's page on the ArcGIS Resource Center Code Gallery.
    2. Download the zip file from the code attachment on the widget's code gallery page. Save it to your hard drive and unzip it.
  2. Copy the files into your application

    1. Put PDC.swf and PDC.xml from the zip file into the folder VIEWER_ROOT/com/esri/solutions/flexviewer/widgets (VIEWER_ROOT is the location of your viewer).
    2. Create a folder VIEWER_ROOT/org/pdc/flexviewer/widgets/assets/images and put "i_pdc_about.png" and "i_pdc_active_hazards.png" files inside the folder. These are the icons for PDC widget.
  3. Configure the application to use the Widget

    The Global viewer configuration xml is VIEWER_ROOT/config.xml. You must add 2 XML nodes to this file in order to make PDC widget work:
    1. In <widget> node, add:
      <widget label="PDC Active Hazards" preload="maximized"
      icon="org/pdc/flexviewer/widgets/assets/images/i_pdc_active_hazards.png"
      menu="menuWidgets"
      config="com/esri/solutions/flexviewer/widgets/PDC.xml">com/esri/solutions/flexviewer/widgets/PDC.swf</widget>
      • Label - the label of widget in main menu.
      • Preload - the initial state of widget - minimized/maximized.
      • Icon - the icon path for both menu item and widget panel.
      • Menu - destination main menu item. They are defined in node.
      • Config - the path for widget's configuration XML.
      • Node value - the path for the widget's SWF.
    2. If there is no <livemaps> node in the <map> node, you should create it. Otherwise read next.
      In <livemaps> node, add:
      <mapservice label="PDC Active Hazards" type="dynamic" visible="true" alpha="1">http://ags.pdc.org/rest/services/GHIN/PDC_Active_Hazards/MapServer</mapservice>
      • This is the current workaround for esa.widgets.IdentifyWidget. Just leave it as is (change MapServer URL if needed) so far. We will tune it when ESRI fix their code in the next API release.
  4. Configure the Widget's PDC.xml

    The Widget will work without this step, but you can follow these instructions to customize the Widget by editing the PDC.xml file (see step 2). Furthermore, if the underlying PDC mapservice changes (e.g. change in layer name), then it may be necessary to edit this file (this should be a very rare occurrence).
    1. <mapservice> - sets the mapservice URL
    2. <metadata> - sets the base URL for metadata
    3. Layers are presented in the <layers> node. Each layer has a child node that is similar to this:
      <layer>
      <id>0</id>
      <title>Hazards</title>
      <visible>true</visible>
      <fields>HAZARD_NAME,TYPE,STATUS,SEVERITY,CATEGORY</fields>
      <legend>
      <description><![CDATA[User-defined hazards created in the
      Hazards and Products (H&P application)]]></description>
      <metadataID>125</metadataID>
      <items><![CDATA[Tsunami,High Surf,Storm,High Wind,Wildfire,Flood,Drought,Earthquake,Volcano,Marine,Cyclone]]></items>
      </legend>
      </layer>

      1. ID - the layer id from the mapservice.
      2. Title - the layer's title in the Widget's TOC.
      3. Visible - initial visibility of the layer (on or off).
      4. Fields - the fields to display in the pop-up MapTip.
      5. Legend - configures legend for this layer.
      6. Description - the layer description in the legend.
      7. MetadataID - the ID for the layer's metadata. It will be joined with the root <metadata> value.
      8. Items - This is used for the titles of the entries to display in the legend.
  5. Keep the Widget Up To Date

    1. In the future, PDC will release new versions of the widget. The configuration file may also require updates to take advantage of new layers or changes in the underlying mapservices (e.g. layers, fields, deployment URLs). In order to keep users informed of breaking changes and other updates, PDC uses a listserv mailing list to notify subscribers in advance. These notifications are posted to the list, usually accompanied by an opportunity to test the updates on a backup server before the changes are made live. The list is moderated (to prevent spam) and is extremely low volume. To subscribe/unsubscribe, please visit PDC Service Updates. It is recommended that application administrators subscribe to this list before adding the Widget to an application.
    2. The ESRI resource center page has a comments section, which is available as an RSS feed. PDC will post relevant updates and breaking changes as comments, so it may be useful to subscribe to this in the RSS reader of your choice. That said, other users may post to this list, so PDC cannot control the quantity or content of posts to this area.