Go to primary content
Oracle® Application Express Application Builder User's Guide
Release 5.0
E39147-04
  Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
 
Next
Next
 

12.2 Creating Maps

Application Builder includes built-in wizards for generating map charts on pages with a Desktop user interface. How you create a map chart depends upon whether you are adding the map to an existing page, or adding a map on a new page.

12.2.1 About Map Chart Support

Map chart support in Oracle Application Express is based on the AnyChart AnyMap Interactive Maps Component. AnyMap is a flexible Macromedia Flash-based solution that enables developers to visualize geographical related data. Map charts are rendered by a browser and require Flash Player 9 or later. For more information about AnyChart, go to

http://www.anychart.com

AnyChart stores map data in files with a *.amap extension, and supports 300 map files for the United States of America, Europe, Asia, Europe, Africa, Oceania, North America, and South America. To render a desired map, you select the map source in the wizard (for example, Germany) and the map XML automatically references the desired map source .amap file, germany.amap. To browse through the available maps, see "Map Reference" in AnyChart User's Guide:

http://6.anychart.com/products/anymap/docs/

12.2.2 About Creating SQL Queries for Maps

You define a map in Application Builder using a wizard. You select a map type, map source, and provide a SQL query using the following syntax:

SELECT link, label, value
FROM   ...

Where:

  • link is a URL.

  • label is the text that identifies the point on the map with which you want to associate data. The Region ID or Region Name of the map will be used as the label.

  • value is the numeric column that defines the data to be associated with a point on the map.

Consider the following example when creating a new page:

  1. On the Workspace home page, click the Application Builder icon.

  2. Select an application.

  3. Click Create Page.

  4. Select Map Chart and click Next.

  5. For Map Type, select United States of America and click Next.

  6. For Map Source, expand Country Maps and select States.

    Description of map_chart1.png follows
    Description of the illustration map_chart1.png

  7. For Page Attributes specify the appropriate attributes and click Next.

  8. For Navigation Preference, specify the type of navigation to include on this page and click Next. The navigation options (for example, navigation menu or tabs) depends upon the current application theme.

  9. For Map Attributes, select the appropriate attributes and click Next.

    The Query page appears.

  10. Scroll down and expand and review the May Query Example and Map Reference Information regions.

  11. Scroll down and expand and review the Map Reference Information region at the bottom of the page.

    Description of map_chart2.png follows
    Description of the illustration map_chart2.png

  12. Specify a SQL query by either:

    • Entering a SQL query in the field provided. See "About Creating SQL Queries for Maps".

    • Clicking the Build Query button. When the Build Chart Query Wizard appears, follow the on-screen instructions.

    When you create your query, you must incorporate the region name information as described in the Map Reference Information region. The following example includes information for Florida and Alaska:

    SELECT null link, region label, value Populations
    FROM (
    SELECT 'Florida' region, 18328340 value FROM dual
    UNION ALL
    SELECT 'Alaska' region, 686293 value FROM dual)
    

    Note:

    If you are referencing geographical information stored in a database table, the information must correspond with the Region information associated with the map source. For more information, see AnyChart User's Guide:

    http://6.anychart.com/products/anymap/docs/


  13. Click Next.

  14. Click Finish.

12.2.3 Adding Map Charts to a New Page

To add a map chart on a new page:

  1. On the Workspace home page, click the Application Builder icon.

  2. Select an application.

  3. Click Create Page.

    The Create Page Wizard appears.

  4. For Create a Page:

    1. User Interface - Select a user interface for the page.

    2. Select a page type - Select Map Chart.

    3. Click Next.

  5. Select a map type (for example, Europe), and click Next.

  6. For Map Source, a Tree lists the map source files for the selected Map Type. Click the Map Source you want to use (for example, Denmark).

  7. For Page Attributes:

    1. Page Number - Select a page in which the chart object is to appear.

    2. Page Name - If creating a new page, enter a page name.

    3. Page Mode - Select a page mode.

    4. Region Template - Select a region template for the region in which this map is to appear.

    5. Region Name - Enter a name for the region.

    6. Navigation List - New pages can be added to an existing navigation list, either as top level entries, or as links in the navigation list hierarchy. Click Configure to add your page to the navigation list.

    7. Breadcrumb - Select whether you want to use a breadcrumb navigation control on your page, and which breadcrumb navigation control you want to use.

      To learn more about an attribute, see field-level Help. See "Viewing Field-Level Help."

    8. Click Next.

  8. For Navigation Preference, specify the type of navigation to include on this page and click Next. The navigation options (for example, navigation menu or tabs) depends upon the current application theme.

  9. For Map Attributes, select the appropriate attributes and click Next.

    To learn more about an attribute, see field-level Help. See "Viewing Field-Level Help."

  10. Specify a query by either:

    • Entering a SQL query in the field provided. See "About Creating SQL Queries for Maps."

    • Clicking the Build Query button. When the Build Chart Query Wizard appears, follow the on-screen instructions.

    Specify relevant attributes. To view map reference information associated with your selected Map Source, expand the Map Reference Information region at the bottom of the page.

    To associate data with geographical locations, you must incorporate information from the Region Name or Region ID columns into the Map query. See "About Creating SQL Queries for Maps."

  11. Click Next.

  12. Click Create.

12.2.4 Managing Map Charts in Page Designer

This section describes how to manage map charts in Page Designer.

12.2.4.1 Adding a Map Chart in Page Designer

To add a map chart to an existing page.

  1. Navigate to the appropriate page in Page Designer. "Viewing a Page in Page Designer."

    Page Designer appears

  2. From the Gallery select the Map Chart region and drag it to the appropriate location in Grid Layout.


    Tip:

    You can also right-click Map Chart region, select Add To, and select the appropriate location.

    Page Designer indicates what actions are required next.

    The Messages tab displays a red or yellow badge indicating messages you need to address. The Message tab displays two types of messages:

    • Errors - Error messages display in red. Selecting an error message displays the associated attribute in red in the Property Editor. You must address errors before a page can be saved.

    • Warnings - Warning messages display in yellow. Selecting a warning message displays the associated attribute in yellow in the Property Editor. You must address errors before a page can be saved. Note you can save a page without addressing warning messages.

  3. In Property Editor - Region, edit the region attributes. Required attributes display a red triangle in the upper left corner next above attribute label.


    Tip:

    To learn more about an attribute, select the attribute in the Property Editor and click the Help tab in the center pane.

    1. Title - Enter a title for the region.

    2. Layout:

      • Sequence - Enter the display sequence for this item.

      • Parent Region - Select the parent region to which this region belongs.

      • Position - Select the template position used to display this region.

    3. Appearance:

      • Template - Select a region template.

      • Item Display Position - Specify where page items display in relation to the main region content.

    4. Layout - Specify the Sequence, Parent Region, and Position.

    5. Appearance - Specify the template.

  4. View the Map Chart attributes. In the Rendering tree, under the map chart title, select the Attributes node.

  5. In the Property Editor, edit the following Map Chart attributes:

    1. Map, Level 1 - Select the map level from the available list (for example Europe).

    2. Map, Level 2 - Select the map level from the available list (for example, Denmark).

    3. Source, SQL Query - Enter the SQL Query for the chart series.

    4. Edit other attributes as appropriate.


      Tip:

      To learn more about an attribute, select the attribute in the Property Editor and click the Help tab in the center pane.

  6. Click Save.

12.2.4.2 Editing Map Chart Attributes in Page Designer

Once you create a map chart, you can alter its display by editing attributes in the Property Editor.

To view the map chart attributes:

  1. Navigate to the appropriate page in Page Designer. "Viewing a Page in Page Designer."

    Page Designer appears.

  2. To edit region attributes:

    1. In the Rendering tree, select the region that contain the map chart.

      The region attributes display in the Property Editor.

    2. Edit the appropriate attributes.

  3. To edit chart map attributes:

    1. In the Rendering tree, under the region title, select the Attributes node.

      The map chart attributes display in the Property Editor.

    2. Edit the appropriate attributes.


    Tip:

    To learn more about an attribute, select the attribute in the Property Editor and click the Help tab in the center pane.

  4. Click Save.

12.2.4.3 Using Custom XML with Map Charts

There are additional map settings that cannot be controlled using the standard attributes on the Map Attributes page. To further control the look and feel of a chart, you can use custom XML.

To use custom XML:

  1. Navigate to the appropriate page in Page Designer. "Viewing a Page in Page Designer."

    Page Designer appears.

  2. In the Rendering tree, under the region title, select the Attributes node.

    The map chart attributes display in the Property Editor.

  3. Expand the Custom XML section.

  4. For Custom XML, Custom, select Yes.

  5. Edit the XML.

  6. Click Save.


Tip:

For more information on supported XML format for maps, see the Online Map XML Reference at:

http://6.anychart.com/products/anymap/docs/


12.2.4.4 Enabling Automatic Updates

You can create map charts that monitor information by enabling the Asynchronous Update attribute on the Map Attributes page. Enabling this attribute updates the map to reflect changes in the underlying data within a specified time interval.

To enable automatic refresh:

  1. Navigate to the appropriate page in Page Designer. "Viewing a Page in Page Designer."

    Page Designer appears.

  2. In the Rendering tree, under the region title, select the Attributes node.

    The map chart attributes display in the Property Editor.

  3. Expand the Automatic Refresh section.

    1. Automatic Refresh - Select Yes.

    2. Interval - Enter the interval in seconds between chart updates.

      Oracle discourages very small updates intervals, such as 2 seconds, since they may cause serious database performance issues.

  4. Click Save.

12.2.5 Managing Map Charts in Component View

This section describes how to manage map charts in the Component View.

12.2.5.1 Adding a Map Chart in Component View

To add a map chart to an existing page.

  1. Navigate to the page. See "Viewing a Page in Component View."

  2. Create a new region. Under Region, click the Create icon.

    The Create Region Wizard appears.

  3. Select Map Chart and click Next.

  4. For Map Type, select a map type (for example, Europe), and click Next.

  5. For Map Source, a Tree lists the map source files for the selected Map Type. Click the Map Source you want to use (for example, Denmark).

  6. For Display Attributes:

    1. Title - Enter a title for the region. This title displays if the region template you choose displays the region title.

    2. Region Template - Choose a template to control the look of the region.

    3. Parent Region - Define the parent region to which the new region belongs.

    4. Display Point - Identify a display point for this region.To learn more, see field-level Help.

    5. Sequence - Specify the sequence for this component. The sequence determines the order of evaluation.

    6. Click Next.

  7. For Display Attributes, select the appropriate map attributes and click Next.

    To learn more about an attribute, see field-level Help. See "Viewing Field-Level Help."

  8. Specify a query by either:

    • Entering a SQL query in the field provided. See "About Creating SQL Queries for Maps."

    • Clicking the Build Query button. When the Build Chart Query Wizard appears, follow the on-screen instructions.

    Specify relevant attributes. To view map reference information associated with your selected Map Source, expand the Map Region Information region at the bottom of the page.

    To associate data with geographical locations, you must incorporate information from the Region Name or Region ID columns into the Map query. See "About Creating SQL Queries for Maps."

  9. For Conditional Display:

    1. Condition Type - Select a condition type from the list that must be met in order for this component to be rendered processed.

    2. Authorization Scheme - Optionally select an authorization scheme which must evaluate to TRUE in order for this component to be rendered or otherwise processed.

    3. Click Create Region.

12.2.5.2 Editing Map Chart Attributes

Once you create a map, you can alter its display by editing map attributes on the Map Attributes page.

To access the Map Attributes page:

  1. Navigate to the page. See "Viewing a Page in Component View."

  2. Access the Chart Attributes page:

    1. Under Region, select the region name.

      The Region Definition appears.

    2. Click Map Attributes.

  3. Edit the appropriate attributes.

    To learn more about an attribute, see field-level Help. See "Viewing Field-Level Help".

  4. Click Apply Changes.

12.2.5.3 Using Custom XML with Map Charts

There are additional map settings that cannot be controlled using the standard attributes on the Map Attributes page. To further control the look and feel of a chart, you can use custom XML.

To use custom XML:

  1. Create a map chart.

  2. Navigate to the page. See "Viewing a Page in Component View".

  3. Access the Map Attributes page. Under Region, select the region name.

  4. Click Map Attributes.

  5. Scroll down to Map XML.

  6. From Use Custom XML, select Yes.

    If you select to use custom XML, regions with attributes that no longer appear are hidden. To display these regions again, select No for Use Custom XML.

  7. Edit the XML.

  8. Click Apply Changes.


Tip:

For more information on supported XML format for maps, see the Online Map XML Reference at:

http://6.anychart.com/products/anymap/docs/


12.2.5.4 Enabling Asynchronous Updates

You can create map charts that monitor information by enabling the Asynchronous Update attribute on the Map Attributes page. Enabling this attribute updates the map to reflect changes in the underlying data within a specified time interval.

To enable asynchronous updates:

  1. Create a map chart.

  2. Navigate to the page. See "Viewing a Page in Component View".

  3. Access the Map Attributes page.

  4. Under Region, select the region name.

  5. Click Map Attributes.

  6. Scroll down to Refresh.

  7. From Asynchronous Update, select Yes.

  8. In Update Interval (Seconds), enter the interval in seconds between map updates. For optimal performance, select an interval that is greater than 2 seconds.

  9. Click Apply Changes.