IBM Business Analytics Proven Practices: Implementing an Interactive Map Widget in IBM Cognos Workspace

Product(s): IBM Cognos 10; Area of Interest: Infrastructure

This document provides the steps required to implement an Interactive Map Widget for use with IBM Cognos Workspace 10.2.1 and 10.2.2.

Share:

Craig Statchuk, Software Architect, IBM

Craig has been a software developer, architect and inventor for more than thirty years. He has worked in a variety of disciplines, including development, consulting and research. Craig is currently responsible for application architecture and design in the IBM Business Analytics division.



12 February 2015 (First published 12 February 2013)

Introduction

Purpose of this document

This document provides the steps required to implement an Interactive Map Widget for use with IBM Cognos Workspace 10.2.1 and 10.2.2. Earlier versions of IBM Cognos Workspace will not work with this version of Interactive Map Widget.

Applicability

The technique outlined in this document was validated using the:

  • IBM Cognos Workspace 10.2.1 using the GO Data Warehouse(query) package shipped with the samples
  • IBM Cognos Workspace 10.2.2 using the GO Data Warehouse(query) package shipped with the samples

Caveats

This document assumes that the IBM Cognos Business Intelligence (BI) content and file structure has been backed up using a tried and tested method prior to any attempt to implement the interactive map widget.

Exclusions and exceptions

The technique outlined in this document requires the use of undocumented and unsupported capabilities in IBM Cognos BI. As a result the technique and its associated files are provided “as is” and are not considered supported.

Map vendors used by the Interactive Map Widget

The Interactive Map Widget is able to utilize online maps from the following popular vendors:

Each of the vendors listed above have licensing terms that restrict usage of their respective services. Be sure to adhere to each vendor's terms and conditions before attempting to implement this technique. The default configuration of the Interactive Map Widget uses only publicly available service URLs. No access key or other information is passed to these services until you modify the configuration settings.


Installing the Interactive Map Widget

The attached archive InteractiveMap.zip copies the required files to your IBM Cognos 10 BI install location. The steps outlined below will need to be performed on each IBM Cognos BI server and gateway install location within the IBM Cognos BI environment.

Doing the installation step by step

The following steps will install the Interactive Map Widget:

  1. Stop the IBM Cognos 10 BI service if one exists.
  2. Copy the correct version of the InteractiveMap.zip to your IBM Cognos 10 BI installation directory. In this case the IBM Cognos 10 BI installation is a 64-bit Windows installation which was installed on the C:\ drive with the following installation path:
    C:\Program Files\IBM\cognos\c10
  3. Double-click InteractiveMap.zip and unpack to your IBM Cognos 10 BI installation directory.
  4. Start the IBM Cognos 10 BI service.

When completed, the installation procedure will have added new files to the ./configuration and ./webcontent folders. No other files are added, deleted or modified.

Confirming a proper installation

Upon successful installation of the InteractiveMap.zip file, an Interactive Map Widget should now be available within the IBM Cognos Workspace tools pane. To confirm the existence of this new Tools object:

  1. Use the Launch menu within IBM Cognos Connection to open the IBM Cognos Workspace.
  2. Click the Create New button to create a new, empty workspace.
  3. Click the Toolbox tab. When the Tools pane displays, an Interactive Map object should now be visible between the Image and My Inbox objects. This is illustrated in Figure 1.
    Figure 1. IBM Cognos Workspace Tools pane displaying the Interactive Map Widget
    IBM Cognos Workspace Tools pane displaying the Interactive Map Widget

The Interactive Map Features

The following section describes the features available for the Interactive Map object.

Map panel

The Map panel shows a live base map and plotted points. As shown in Figure 2, the Interactive Map widget was used to create a widget which displays a map of North America. The data points for the number of customers are displayed as green circles with a size that is proportional to the value being represented.

Figure 2. Interactive Map Widget displaying North American and data points for customers within North America
Interactive Map Widget displaying North American and data points for customers within North America

Standard scrolling, panning and zooming map operations are enabled. Filter sliders are shown in the bottom left corner. These sliders control symbol filter ranges based on different column values. The column names shown control disk size and color range respectively. Different columns can be selected in each drop list.

Customization

The map can be customized in several ways. All customizations are saved by clicking the Save icon on the workspace toolbar.

Options panel

The Options panel is opened and closed by clicking the Toggle control on the left side of the map. This is illustrated in Figure 3.

Figure 3. Toggle control for the Options Panel
Toggle control for the Options Panel

The Options panel shows the following three contained expansion panels:

  1. View - Display and viewing options
  2. Maps - Map setup options
  3. Data - map data grid

View panel

The View panel has the following fields:

  • Map Actions:
    • Click shows popup - Popup box is displayed when map symbol is clicked.
    • Mouseover shows popup - Popup box is displayed when mouse placed over map symbol.
    • Click filters workspace - Other widget content is filtered when map symbol is clicked. Use Shift-click for multiple selections.
    • No actions (display only) - No mouse events are processed.
  • Data shown with:
    • Pins - Locations shown with push-pin graphics.
    • Size – Controls symbol size with a slider that allows you to select the desired size.
    • Color – Controls symbol color with a palette that allows you to select the desired color.
    • Size and Color – Controls symbol size and color based on specified column values.

Maps panel

The Maps panel has the following fields:

  • Available Maps:
    • A list of available maps is shown. Changing the selection causes the associated map to be displayed in the map panel.
  • Title Column:
    • Controls the title of the fly outs when hovering over the data points on the map.
  • Location defined by:
    • No Column Specified - No symbols will be shown.
    • Latitude and longitude – When this is selected, fields titled Latitude column: and Longitude column: will appear and position values are read from the values in those fields.
    • Country Names - When this is selected, a field titled Country names column: will appear and position values are determined by the selected value in this field.
    • Place Names - When this is selected, a field titled Place names column: will appear and position values are determined by the selected value in this field.
    • (X,Y) coordinates – When this is selected, fields titled X coordinate column: and Y coordinate column: will appear and position values are read from the values in those fields.

Data panel

The Data panel, as shown in Figure 4, shows the underlying items for each plotted symbol.

Figure 4. Data panel showing the underlying data items used to plot the symbols
Data panel showing the underlying data items used to plot the symbols

Selecting an item in the list, selects the associated map symbol.

Checking and un-checking an item shows and hides the associated map symbol.

When an item name is not found in the system lookup table, a warning symbol is shown next to the name (as shown in Figure 5).

Figure 5. Data items list highlighting the items that were not found with a warning symbol
Data items list highlighting the items that were not found with a warning symbol

Using the Interactive Map Widget

The Interactive Maps object shows points and data using a source IBM Cognos list report. The list report must have location references in one of the following formats:

  • Numeric latitude and longitude
  • Name of a country
  • Name of place like a province or state

The following sections will step a user through the creation of the report and the creation of an IBM Cognos Business Insight dashboard that uses the Interactive map widget.

Authoring a map compliant report

The following section outlines the steps required to build a list report within IBM Cognos Business Insight advanced to be used by the Interactive Map widget.

  1. Within the IBM Cognos Connection Launch menu select Cognos Workspace Advanced. When prompted to select a package, locate and select the GO Data Warehouse(query) package.
  2. Within the Workspace Advanced Welcome page click on Create New.
  3. Within the New dialog box, click the List object and then click the OK button.
  4. Click the title and enter Sample Map Report 1.
  5. Drag and drop the following Sales and Marketing (query) > Sales (query) items to the report container:
    • Retailers > Retailer Country
    • Sales Fact > Planned revenue
    • Sales Fact > Revenue
    • Sales Fact > Gross Profit
    When completed, IBM Cognos Workspace Advanced should now display a list report with Retailer country, Planned revenue, Revenue and Gross profit as shown in Figure 6.
    Figure 6. IBM Cognos Workspace List report displaying the data points to be used by the interactive map object
    IBM Cognos Workspace List report displaying the data points to be used by the interactive map object

    Click to see larger image

    Figure 6. IBM Cognos Workspace List report displaying the data points to be used by the interactive map object

    IBM Cognos Workspace List report displaying the data points to be used by the interactive map object
  6. Click the Save button.
  7. Type the name Sample Map Report 1.
  8. Upon clicking the Save, the report can now be used to build an interactive map.

Authoring a new interactive map

In the following section, the previously created report will be used to create an interactive map.

  1. From the IBM Cognos Connection Launch menu select Cognos Workspace.
  2. Within the IBM Cognos Workspace Welcome page, click on Create New and choose the Blank report template.
  3. Locate and drag the previously created and saved Sample Map Report 1 onto the canvas. Once the canvas refreshes, it will display the Retailer country, Planned revenue, Revenue and Gross Profit list report with its associated values. This is illustrated in Figure 7.
    Figure 7. IBM Cognos Workspace canvas with the List report dragged on to the canvas
    IBM Cognos Workspace canvas with the List report dragged on to the canvas
  4. Within the right hand pane select the Toolbox tab, then locate and drag the Select Value Filter item to the canvas, placing it to the left of the list report.
  5. Within the Properties - Select Value Filter dialog, type the text Select Country for the Show descriptive text: entry at the bottom of the dialog.
  6. Click the OK button to add the value filter to the canvas. When completed, the canvas should now display a value filter displaying all the Retailer country values on the left hand side of the canvas. The right hand side of the canvas will display the List report filtered to the selected value filter values. This is illustrated in Figure 8.
    Figure 8. IBM Cognos Workspace Canvas displaying the value filter and List widget
    IBM Cognos Workspace Canvas displaying the value filter and List widget
  7. Within the right hand Toolbox pane, locate and drag the Interactive Map Tools object and drag it onto the canvas between the value filter and the list object.
  8. When presented with the Properties - Interactive Map dialog, click the Browse and select the previously created Sample Map Report 1 list report. The Interactive Map Widget will now be shown on the canvas between the left hand value filter and the right hand list report object. This is shown in Figure 9.
    Figure 9. IBM Cognos Workspace canvas displaying the value filter, the interactive map and the Report Viewer widgets
    IBM Cognos Workspace canvas displaying the value filter, the interactive map and the Report Viewer widgets

Server configuration options

The section describes how to customize the types of maps displayed by the Interactive Map Widget.

Enabling maps

Maps service URLs are defined in the file:

./webcontent/icd/sage/js/com/ibm/sage/configuration/config.xml

One <map> element is used to define each <map> item shown in the interactive map panel. Items are shown in the order defined in the configuration file. <map> elements can be added or removed as required. <map> sub-elements can also be changed to reference custom URLs or alternate display names.

ERSI maps configuration

The URL for ESRI map services can be changed in the file:

./webcontent/icd/sage/js/com/ibm/sage/configuration/config.xml

Changes can be made to any <map> element with sub-element equal to <provider>ESRI</provider>. Layer overlays can be added an ESRI map using the <Layer1>, <Layer2>, <Layer3> and <Layer4> sub-elements. The <key> sub-element for any <map> element can be used to define a system-wide access key.

Google maps configuration

The system-wide access key for Google services is defined in the file:

/webcontent/icd/sage/js/com/ibm/sage/configuration/google_key.js

The variable var google_key = "" is used to set your required Google key value.

Microsoft Bing maps configuration

The URL for Bing map services can be changed in the file:

./webcontent/icd/sage/js/com/ibm/sage/configuration/config.xml

Changes can be made to any <map> element with sub-element equal to <provider>BING</provider>. The <key> sub-element for any <map> element is used to define your required system-wide key.

License warning

By default, the Interactive Map Widget displays a warning across the bottom of the map reminding the user that they must comply with the respective map vendor’s license terms. This message can be suppressed after an administrator has determined that all the license terms have been met for all users.

To suppress this warning change the <licensed> tag value from False to True in the file:

./webcontent/icd/sage/js/com/ibm/sage/configuration/config.xml

Country names

The Interactive Map Widget uses a server-side lookup table to match country names with average geographic latitude and longitude or the approximate visual center of a given country. This comma separated text file is stored in:

./webcontent/icd/sage/js/com/ibm/sage/configuration/country.csv

This file may be edited as required. The column with heading LOOKUP is used to search for exact name matches. The columns with headings LATITUDE and LONGITUDE are used for positional coordinates.

The data in this file is provided "as-is" and is sourced at the time of publishing from http://www.naturalearthdata.com/ under the Natural Earth Terms-of-Use described at http://www.naturalearthdata.com/about/terms-of-use/.

Place names

The Interactive Map Widget uses a server-side lookup table to match arbitrary place names with average geographic latitude and longitude or the approximate visual center of a given place. It initially contains state and province names for selected countries. This comma separated text file is stored in:

./webcontent/icd/sage/js/com/ibm/sage/configuration/places.csv

This file may be edited as required. Any named place or entity can be added. The column with heading LOOKUP is used to search for exact name matches. The columns with headings LATITUDE and LONGITUDE are used for positional coordinates.

This file may be edited to modify any of the columns provided. to the file as required. The data in this file is provided "as-is" and is sourced at the time of publishing from http://www.naturalearthdata.com/ under the Natural Earth Terms-of-Use described at http://www.naturalearthdata.com/about/terms-of-use/


New Features in IBM Cognos Workspace 10.2.2

IBM Cognos Workspace 10.2.2 Report Viewer can now filter the Interactive Map Widget allowing dashboards to be optionally built without the requirement for a filter widget. The following sections provide the steps to use the report to filter the map and use the map to filter the report.

Using report to filter map

Report filtering is enabled by clicking the Master filter icon on the viewer toolbar (Figure 10).

Figure 10. Master filter icon displaying the Master filter tooltip
Master filter icon displaying the Master filter tooltip

Upon enabling this feature, the map can be filtered by selecting one or more List values. The map will show items that match the selected item names. In Figure 11 Alberta, Newfoundland, Nova Scotia and Ontario have been selected in the List object. The corresponding Map object has been filtered accordingly display the appropriately sized blue measure circle over the North American provinces.

Figure 11. List report with selected values used to filter the map object
List report with selected values used to filter the map object

Using map to filter report

The map can be configured to filter other widgets by selecting the Map Actions > Click filters workspace menu item, in the map flyout panel. This map flyout panel is depicted Figure 12 showing the available options of Click shows popup, Mouseover shows popup, Click filters workspace and No actions (display only).

Figure 12. Map Actions flyout panel
Map Actions flyout panel

In Figure 13 we see the provinces of Alberta, Newfoundland, Northwest Territories and Ontario were selected within the map widget using a shift-click action. The Report Viewer widget displaying the List has been filtered accordingly and only displays the selected provinces.

Figure 13. Map widget with the selected items filtered in the Report Viewer widget List report
Map widget with the selected items filtered in the Report Viewer widget List report

Interactive Map Widget Logging

Map widget display and data import issues can be debugged using the Trace Output option available in all supported versions of the Firefox and Chrome web browsers. Limited trace options are available in Internet Explorer 9 or higher.

Trace output (interactive)

Interactive trace output can be selected once an Interactive Map Widget is placed on the IBM Cognos Workspace canvas. The trace data display is enabled on the Options Panel > Maps tab as illustrated in Figure 14.

Figure 14. Maps dialog box displaying the Debug mode drop down list
Maps dialog box displaying the Debug mode drop down list

The Debug mode field to selects the following functions:

  • Off (default) - No trace information is generated. This is the most efficient mode of operation and should be used when debug trace information is no longer required.
  • Browser Console - Trace information text is sent to the developer console window in a Firefox, Chrome or Internet Explorer web browser. The appropriate development tools plugin(s) must be installed for the browser prior to selecting this option. The option will not be shown if a debug console is not available.
  • Popup Window – Trace information text is sent to a browser popup window. This is the easiest trace option to enable. It works in all supported Firefox and Chrome web browsers. This option is not enabled for Internet Explorer web browsers.

Trace output (static)

If trace output is desired prior to launching a map widget, the following procedure can be used.

  1. Locate and backup the following file:
    <install location>/webcontent/icd/sage/js/sage/Trace.js
  2. Using a text editor, modify that line that defines variable sage.Trace.Startup. The default value for this variable is sage.Trace.Startup = “off”;.The assigned sage.Trace.Startup value, in quotes, selects the following function:
    • off (default) - No trace information is generated.
    • console - Trace text is sent to the developer console.
    • window – Trace text is sent to a popup browser window in Firefox and Chrome web browsers. Trace text is sent to the developer console in Internet Explorer.
  3. Save the changes and restart the IBM Cognos BI service. The selected trace options will be used the next time a map widget is used within IBM Cognos Workspace. The Trace.js file should be restored to its original state when trace display is no longer needed.

Download

DescriptionNameSize
Code sampleInteractiveMap.zip871KB

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Big data and analytics on developerWorks


  • Bluemix Developers Community

    Get samples, articles, product docs, and community resources to help build, deploy, and manage your cloud apps.

  • Big data and analytics

    Crazy about Big data and analytics? Sign up for our monthly newsletter and the latest Big data and analytics news.

  • DevOps Services

    Software development in the cloud. Register today to create a project.

  • IBM evaluation software

    Evaluate IBM software and solutions, and transform challenges into opportunities.

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Big data and analytics
ArticleID=997361
ArticleTitle=IBM Business Analytics Proven Practices: Implementing an Interactive Map Widget in IBM Cognos Workspace
publish-date=02122015