Enabling Additional Territories in a Leaflet Map

In this section:

How to:

InfoAssist provides a number of territories, out of the box, for Leaflet maps, which are provided through Leaflet Open Source API. These pre-packaged territories are listed in Default Territories and are contained in JavaScript Object Notations (.json) files.

Note: This functionality is only available for maps built with the Leaflet API.

In addition to the out of the box territories that are available, you can also enable other territories for use in creating custom maps. These additional territories are contained in .json or .csv files.

Note: Files in .csv format can be used for latitude and longitude data values. This could be for an exact point or for the centroid of a location. When using .csv files, there is a csvfields field class that is used to specify latitude and longitude values. For example, csvfields='country,lat,lng'. The .csv must have at least latitude and longitude specified. In addition, all fields require the use of quotes and a comma-delimited format.

You can also use GeoJSON files if you have access to location files in GeoJSON format. For more information, see the following webpages:

In order to enable a new territory, you must copy the .json, .csv, or .geojson file to the appropriate directory and then modify the CustomUIMaps.xml file to reference it, as described in the following procedure.

Procedure: How to Enable Additional Territories in a Leaflet Map

Note: This functionality is only available for maps built with the Leaflet API.

  1. To enable one of the location files installed with WebFOCUS, identify the pre-packaged .json file that you want to enable in the following directory:

    drive:\ibi\WebFOCUS82\webapps\webfocus\tdg\jschart\distribution\map

  2. Copy the selected .json file to the following directory:

    drive:\ibi\WebFOCUS82\config\web_resource\map

    Note:

    • If you want to use a .geojson or .csv file, copy it to this directory.
    • If you are using a .json file, a layer must be defined, as .json files can contain multiple layers. The specification of layers is not required for .geojson files.
    • In this example, the primary layer = regions must be set in the .json file. You can verify this by opening the .json file in a standard text editor, such as Notepad or Textpad.
  3. In the drive:\ibi\WebFOCUS82\config\web_resource\map directory, open the CustomUIMaps.xml file using a standard text editor.
  4. Remove the commenting characters from the line that you wish to create. Specifically, remove <!-- from the beginning of the line of code and remove --> from the end. This activates the .json file that you are including.
  5. Specify the following criteria within the <Json> tag for each territory that you want to enable:
    • Map file: This is the .json or .csv file name. For example, uszip3.json.

    • Name: The label, or identifying name, that displays in the Territory drop-down list when using the Lightweight Mapping functionality. For example, Zip 3.

    • Layer: Files may have multiple layers in them, such as landmarks and the actual item you want to symbolize. If they do, you must specify which layer to use. In the following example, regions is used.

  6. Save the CustomUIMaps.xml file.
  7. Restart your application server.

    The name of the territory that you enabled displays in the Territory drop-down list when you create a map chart.

Default Territories

InfoAssist comes pre-packaged with a number of default territories. These include:

Note: A full list of maps is available in your local installation directory:

drive:\ibi\WebFOCUS82\webapps\webfocus\tdg\jschart\distribution\map