Geographic Map Terminology Introduction to Geographic Maps

27-6 Web User Interface Developers Guide for Oracle Application Development Framework ■ Pie slice item dvt:mapPieSliceItem: A child of the dvt:mapPieSliceSet tag. Each pie slice item tag customizes the color of one slice in a map pie graph. ■ Bar graph series set dvt:mapBarSeriesSet: A child of the dvt:mapBarGraphTheme tag. This is an optional tag that you use to wrap dvt:mapBarSeriesItem tags if you want to customize the color of bars in a map bar graph. ■ Bar graph series item dvt:mapBarSeriesItem: A child of the dvt:mapBarSeriesSet tag. Each bar graph series item tag customizes the color of one bar in a map bar graph.

27.2 Understanding Data Requirements for Geographic Maps

The following data requirements apply to the geographic map: ■ Configuration requirements include the following information: – Map Viewer URL: You must provide a URL for the location of the Oracle Application Server MapViewer service. This service is required to run the base map that provides the background for the layers in the ADF geographic map component. OracleAS MapViewer is a programmable tool for rendering maps using spatial data managed by Oracle Spatial. – Geocoder URL: If you want to convert street addresses into coordinates, then you must provide the URL for the Geocoder for the geographic map. A Geocoder is a Web service that converts street addresses into longitude and latitude coordinates for mapping. ■ Base map: You must have a base map created by the Map Builder tool in OracleAS MapViewer. This base map must define polygons at the level of detail that you require for your map themes to function as desired. For example, if you have a map pie graph or bar graph theme that you want to use for creating graphs in each state of a certain region, then you must have a base map that defines polygons for all these states at some zoom level. You can display only one graph in a polygon. ■ Data controls for map themes: Each map theme must be bound to a data control. The data control must contain location information that can be bound to similar information in the base map.

27.3 Customizing Map Size, Zoom Control, and Selection Area Totals

You can customize the map size, zoom strategy, appearance of selected regions, and the initial display of the information window and the scale bar.

27.3.1 How to Adjust the Map Size

You can control the width and height of the map by using the inlineStyle attribute in the dvt:map tag. To adjust the size of a map: 1. In the Structure window, right-click the dvt:map node and choose Go to Properties .

2. In the Style attributes category of the Property Inspector, enter the width and

height in the inlineStyle attribute. For example, to specify a width of 600 pixels and a height of 400 pixels, use the following setting: inlineStyle=width:600px;height:400px. Using ADF Geographic Map Components 27-7 For a width that uses the entire available width of the page and a height of 400 pixels, use the following setting: inlineStyle=width:600px;height:400px.

27.3.2 How to Specify Strategy for Map Zoom Control

Several attributes on the dvt:map tag let you control the initial zoom level, starting location, initial map theme, and zoom strategy. To control the initial zoom and starting location on a map: 1. In the Structure window, right-click the dvt:map node and choose Go to Properties .

2. In the Appearance attributes category of the Property Inspector, enter values for

the following attributes:

a. In AutoZoomThemeID, enter the ID of the first theme that will be displayed.

b. In ZoomBarStrategy, select the default value MAXZOOM to direct the map to

zoom down to the maximum level where all objects in the autoZoomThemeId are visible, or select CENTERATZOOMLEVEL to direct the map to center on the theme in autoZoomThemeId and to set the zoom level to the value in the mapZoom attribute.

c. If you want to change the starting location on the map, enter latitude and

longitude in startingX and startingY respectively.

d. In MapZoom, enter the beginning zoom level for the map. This setting is

required for the zoom bar strategy CENTERATZOOMLEVEL.

27.3.3 How to Total Map Selection Values

You can provide a selection listener that totals the values associated with a map area selected with one of the map selection tools such as the rectangular selection. The total is displayed in an area under the map. Provide a class that takes MapSelectionEvent as an argument in a backing bean method. Example 27–1 shows sample code for a backing bean. Example 27–1 Sample Code in Backing Bean for Selection Listener package view; import java.util.Iterator; import oracle.adf.view.faces.bi.component.geoMap.DataContent; import oracle.adf.view.faces.bi.event.MapSelectionEvent; public class SelectionListener { private double m_total = 0.0; public SelectionListener { } public void processSelectionMapSelectionEvent mapSelectionEvent { Add event code here... Note: The property autoZoomThemeID takes precedence over the property set in mapZoom. 27-8 Web User Interface Developers Guide for Oracle Application Development Framework m_total = 0.0; Iterator selIterator = mapSelectionEvent.getIterator; while selIterator.hasNext { DataContent dataContent = DataContent selIterator.next; if dataContent.getValues = null { Double allData[] = dataContent.getValues; m_total += allData[0]; } } } public double getTotal { return m_total; } public void setTotal double total { m_total = total; } } To provide a selection listener to total map values: 1. In the Structure window, right-click the geographic map node and choose Go to Properties . 2. In the Behavior attributes category, for the SelectionListener field, enter a method reference that points to the backing bean. For example,

27.4 Customizing Map Themes

You can customize each type of map theme using one or more of the following: the map theme binding dialogs, the attributes of the theme tag, or the child tags of the theme tag.

27.4.1 How to Customize Zoom Levels for a Theme

For all map themes, verify that the theme specifies zoom levels that match the related zoom levels in the base map. For example, if the base map shows counties only at zoom levels 6 through 8, then a theme that displays points or graphs by county should be applied only at zoom levels 6 through 8. To customize the zoom levels of a map theme: 1. In the Structure window, locate the map theme tag dvt:mapColorTheme, dvt:mapPointTheme, dvt:mapBarGraphTheme, or dvt:mapPieGraphTheme that you want to customize.

2. Right-click the tag and choose Go to Properties.

3. In the Appearance attributes category of the Property Inspector, enter the desired

low and high zoom values for the MinZoom and the MaxZoom attributes respectively.