Integrating Google Maps with the CMaps plugin

In the Using maps to select data of an area or country recipe in Chapter 3, From a Static to an Interactive Dashboard, we introduced the standard map options that SAP BusinessObjects Dashboards offers. Then, in the Displaying alerts on a map recipe in Chapter 5, Using Alerts, we discussed how to use alerts on these maps. Centigon Solutions raised the bar on this topic and introduced the CMaps plugin for SAP BusinessObjects Dashboards.

With this add-on, we can completely integrate Google Maps in a dashboard in SAP BusinessObjects Dashboards. This means that we can use the graphics we know from Google Maps (map, satellite, hybrid, terrain, and so on) and functionalities such as zooming in or out on a map. Furthermore, the CMaps plugin integrates with other SAP BusinessObjects Dashboards components. We can make selections from a map region and display alerts, single points (such as cities or buildings), and heat maps on the map.

This recipe will introduce you to this add-on and show you how to create a map with alerts and selectable regions.

Getting ready

This recipe needs some preparation. First, go to the CMaps plugin website (http://www.cmapsplugin.com/) and request the CMaps plugin add-on trial. You'll receive an e-mail with a download link and a trial key. Install the add-on with the Add-On Manager.

Next, we need a so-called shapefile. This provides the overlay for a geographical area. There are lots of free SHP files available on the Internet; for example, SHP files can be found at http://centigonknowledge.com/tutorial/shape-data-explorer-and-download-manager/.

Download the ZIP archive of any shapefile you want to use and extract it. The extracted folder includes at least the SHP file, a DBF file, and an SHX file.

In this recipe, we will use a shapefile of Europe, but the steps are the same for shapefiles of other regions.

How to do it...

  1. Open MS Excel and go to Open.
  2. Set Files of type to All Files.
  3. Browse for the DBF file and open it.
    How to do it...
  4. A spreadsheet with a list of countries will appear, including some additional, country-specific data.
    How to do it...
  5. Save the file as an Excel Workbook.
  6. Open SAP BusinessObjects Dashboards and import the Excel file you just created by selecting Import from the Data menu:
    How to do it...

    Or by clicking on the Import button:

    How to do it...
  7. A pop up will appear stating that you will lose everything in your existing spreadsheet. As we opened a blank SAP BusinessObjects Dashboards file, we can click on Yes.
    How to do it...
  8. Insert five rows above the data from the DFB file. Right-click on row 1 and select Insert. Repeat this four times.
    How to do it...
  9. Enter your CMaps trial key in spreadsheet cell C1.
  10. Drag the CMaps Plugin component to the canvas. You will find this component at the bottom of the Maps section.
  11. Bind the Key field of the CMaps plugin to cell C1. The CMaps Plugin component will now change into a real Google Map of the world.
    How to do it...
  12. Enter the location of the SHP file in cell C2.
    How to do it...
  13. Select the Shape Data option and bind the Single shape file URL field to cell C2.
    How to do it...
  14. Click on the button on the right of Shape Data to open the Shape Data Options screen. Here, select Shape File URL and click on OK.
    How to do it...
  15. If you now hit the Preview button, the shapefile for Europe should be visible on top of the Google Map.

    Note

    The shapefile will not appear in Preview mode if you are using a relative path.

    How to do it...
  16. Now return to the properties pane of the CMaps Plugin component and bind the Labels field and the Values field to the corresponding cells in the spreadsheet.
    How to do it...
  17. Set Insertion Type to Row and bind the Source Data field to the cells we just bound to the Labels and Values fields. Also bind the Destination field to cell range B4:C4.
    How to do it...
  18. Add a Gauge component to the canvas and bind the Title field to cell B4 and the Data By Range field to cell C4.
  19. Select the CMaps Plugin component again and go to the Behavior tab.
  20. Deselect Dynamic Zoom.
  21. Bind the Pan to Location field to cell C3.
  22. Enter 54.52596, 15.25512 in cell C3. These are the coordinates for mid-Europe.
  23. Go to the Alerts tab in the CMaps Plugin properties pane. Select Enable Alerts.
  24. Select By Value and set the number of Alert Levels to 6.
  25. Now edit the limits by double-clicking on the Limit values. If you click on the Refresh button, your changes will already be shown in the component.
    How to do it...
  26. Preview and explore the dashboard.
    How to do it...

How it works...

This recipe required a lot of preparation before we could perform the actual binding of the data to the CMaps Plugin component. In this recipe, we showed you how to use SHP files. These files provide a layer on top of the Google Map. This layer enables us to make regions selectable or fill them with colors to show alerts.

The DBF file provided us with the metadata on the SHP file (that is, the country codes and names). After importing this information into the spreadsheet, the setup of the CMaps Plugin component has a lot of similarities with the configuration of standard SAP BusinessObjects Dashboards Map components, as we discussed in Chapter 3, From a Static to an Interactive Dashboard, and Chapter 5, Using Alerts.

The SHX file can be used to combine SHP and DBF files for GIS solutions, where this file is required to maintain the integrity between the files when used in GIS solutions. The CMaps plugin does not utilize this SHX file.

In the Behavior tab, we entered the coordinates for Europe, so the map, by default, showed Europe. You can find these coordinates at http://www.map-gps-coordinates.com/.

In addition, if you want to zoom in or out, you can change the Zoom Level.

Setting up the alerts in the CMaps plugin works just like configuring the Alerts tab in standard SAP BusinessObjects Dashboards components, with the addition that you can also use icons as alerts in the CMaps Plugin component.

There's more...

This recipe only covered a few of the possibilities of this add-on. Check out the CMaps plugin website (http://www.cmapsplugin.com/) to learn more about the other features. Here you can also find a lot of tutorials, articles, videos, templates, and samples.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset