How to: |
Before binding maps to a WebFOCUS source, you must predefine marker fields in a source file. The source can be a URL, XML file, or external procedure.
Markers are presented at run time on the map by placing an image at specific geographical points. Clicking on the map marker can result in a drill down to a source file, and optionally, a Tooltip can be presented when pausing on a map marker.
Markers are defined by the following:
Marker fields are displayed by an image, drill down, and/or Tooltip in the map.
Note: The following procedures are applicable for using Google Maps, Bing Maps, and ESRI JavaScript API Maps.
In order to plot points on the map, you must define each point by its latitude and longitude coordinates and associate a marker, or group assignment, to each point. The Source file must be XML format and must contain fields called LATITUDE, LONGITUDE and MARKER. Additional fields can be included for Tooltips or image icon information.
Note: The following example creates a source file for a map by:
Tip: The Century Sales and Locale data sources are available from the Master Files folder in the IBI Demonstration project of Developer Studio. You may copy these source files to the project directory of your choice.
or
The Add Procedure dialog box opens.
The Procedure Viewer opens.
The Open dialog box appears.
The Join dialog box opens.
The File Description List for Join dialog box opens.
Developer Studio automatically creates a Join between the data sources if they both have fields with the same formats. The Join tool displays both data sources and the default Joins, as shown in the following image.
For more information about using the Join tool, see the Creating Reporting Applications With Developer Studio manual.
The Join is added to the Procedure Viewer.
The Open dialog box appears.
The Report Painter opens.
If fields in your source are not called Latitude, Longitude, or Marker, you can:
Each location (Latitude and Longitude) has been grouped to LINEPRICE for the report.
The following image is an example of a report with Latitude and Longitude coordinates.
The map Latitude and Longitude coordinates have been set. This source file will be selected as the source file from the HTML Composer later on. For more information about selecting source files for a map, see Customizing the Map Properties.
Marker and Tooltip fields can be computed fields, or any field from your data source.
Note: If you are using a field from your data source as the Marker field, the field name must be renamed Marker.
A COMPUTE field is a calculated value in the source file that is used as the Marker field in the map. A COMPUTE field uses an expression that can be used to assign a value to a field. You create a COMPUTE field by using the Computes tab of the Report Options dialog box.
Note: If the HTML page where your map resides is created in the Repository area and the marker images also reside in the Repository area, then a fully qualified path to the image files (starting with /WFC) is needed, if using a DEFINE/COMPUTE to determine the marker image. For example: IMAGE/A75='/WFC/repository/images/cust_'||IMAGE_COLOR||IMAGE_SIZE;
The following example creates marker fields and Tooltips fields by:
The Report Painter gmlayer.fex is still open. Create a COMPUTE field to assign an integer value determined by row-based values.
The Report Options dialog box opens at the Computes tab.
LINEPRICE |
Integer |
Marker |
---|---|---|
0 - 999,999 |
2 |
redicon |
1,000,000 - 9,999,999 |
3 |
yellowicon |
10,000,000 - 49,000,000 |
1 |
greenicon |
50,000,000 or higher |
0 |
blueicon |
Enter the syntax, as shown in the example image below, to use LINEPRICE to group the data:
COMPUTE LINEPRICE_CLASS/I5 = IF LINEPRICE GE 50000000 THEN 0 ELSE IF LINEPRICE GE 10000000 THEN 1 ELSE IF LINEPRICE LE 1000000 THEN 2 ELSE 3
Create a new COMPUTE field that sets the Marker field with a DECODE statement to convert the numerical grouping into icon names.
Note: A Marker field can also be any value field from your data source, but must be renamed Marker.
COMPUTE MARKER/A10 = DECODE LINEPRICE_CLASS( 0 'blueicon' 1 'greenicon' 2 'redicon' ELSE 'yellowicon') ;
Optionally, if you want to include a Tooltip, create an additional COMPUTE field to assign fields as Tooltips.
Note: A Tooltip field can also be any value field from your data source.
COMPUTE REVENUE_RANGE/A10 = DECODE LINEPRICE_CLASS( 0 'OVER 50M' 1 '10M to 50M' 2 'UNDER 1M' ELSE '1M TO 10M') ;
The fields are added to the Computed fields folder in the Object Inspector and are automatically added to the report as LINEPRICE_CLASS, MARKER, and REVENUE_RANGE.
The Report Options dialog box opens at the Output tab.
Note: The XML output format is available from the Unstyled formats folder.
The following image is an example of a report with Marker fields and Tooltip fields set.
In addition to creating the Latitude or Longitude coordinates and associating markers, you must set the center view of the map to a bound geographical point at run time. Center values can be set dynamically or by a constant value.
Note: The following example creates a report that sets the starting point of your map by:
Tip: The Century Sales and Locale data sources are available from the Master Files folder in the IBI Demonstration project of Developer Studio. You may copy these source files to the project directory of your choice.
or
The Add Procedure dialog box opens.
The Procedure Viewer opens.
The Open dialog box appears.
The Join dialog box opens.
The File Description List for Join dialog box opens.
Developer Studio automatically creates a Join between the data sources if they both have fields with the same formats. The Join tool displays both data sources and, the default Joins, as shown in the following example image.
The Join is added to the Procedure Viewer.
The Open dialog box appears.
Note: If fields in your source are not called Latitude, Longitude, or Marker, you can:
The Expression Builder opens.
CITY EQ 'Nashville'
In this example, Nashville is set as the center value starting point for your report.
WebFOCUS |