Hitachi Vantara Pentaho Community Forums
Results 1 to 10 of 10

Thread: Google Map in a dashboard

  1. #1
    Join Date
    Nov 2009

    Unhappy Google Map in a dashboard


    I have an action sequence that returns a google map - it works fine if I execute it from the User Console - or if I embed it in a dashboard created using the dashboard designer as part of my evaluation copy of Enterprise Edition. However I would like to create a dashboard from scratch so that I can build in additional javascript and jquery stuff later on. So I have followed the step by step notes in Ch17 of the Pentaho Solutions book by Bouman and Dongen.

    Firstly I added a new folder in the user console. In the folder I have created an xcdf file called repairers.xcdf:

    <?xml version="1.0" encoding="UTF-8"?>
    <title>Repairers Dashboard</title>
    <author>Matt Gardner</author>
    The Repairers Dashboard shows the geographical
    distribution of repairers in the network along
    with the historical repair volume for repairers

    I have also created an html template called "repairers-tempate.html" in the same folder:

    <h1>Repairers Dashboard</h1>
    <div id="repairer_map"></div>
    <script langauge="javascript" type="text/javascript">
    // Get solution and path of this current locations
    var solution = Dashboards.getQueryParameter("solution");
    var path = Dashboards.getQueryParameter("path");

    // Dashboard Parameters
    Dashboards.globalcontext = false;
    // Parameter definitions go here:

    // Component Definitions
    //var components = [];

    components[components.length] =
    name: "repairer_map",
    type: "xaction",
    solution: solution,
    path: path,
    action: "xRepairerMap.xaction",
    parameters: [],
    htmlObject: "repairer_map",
    executeAtStart: true,
    tooltip: "My first dashboard"



    This should execute the action sequence and return the html to display in the dashboard.

    Finally the code for the action sequence is here:

    <?xml version="1.0" encoding="UTF-8"?>
    <description>Empty blank action sequence document</description>


    <out type="string">


    <output-message type="string" mapping="out"/>
    <title>Google Maps and jQuery</title>
    <!-- -->

    <script type="text/javascript" src=""></script>
    <script type="text/javascript">
    google.load("jquery", '1.3');
    google.load("maps", "2.x");

    <script type="text/javascript" charset="utf-8">
    var map = new GMap2($("#map").get(0));
    var centre = new GLatLng(54.57,-2.197);
    map.setCenter(centre, 6);
    <style type="text/css" media="screen">
    #map { float:left; width:500px; height:750px; }
    <div id="map"></div>


    The problem is I just get the community dashboard framework header - with my title but no map...See attached screenshot.

    No errors or anything. Any thoughts? Where would errors get written to. How can I debug this?

    Any ideas would really be welcome.


    Attached Images Attached Images  

  2. #2


    I have no solution to your problem... but I will just point out that unless you pay ($10K a year) for Google Maps you are breaking google's terms and conditions unless the Pentaho installation you are working on faces the internet and has no login at all ... which is why a lot of us use Open Street Maps.
    This is a signature.... everyone gets it.

    Join the Unofficial Pentaho IRC channel on freenode.
    Server: Channel: ##pentaho

    Please try and make an effort and search the wiki and forums before posting!
    Checkout the Saiku, the future of Open Source Interactive OLAP(

  3. #3
    Join Date
    Nov 2009


    Really! I thought as long as I am just developing test code that I would be ok. Google Maps are not used anywhere in production, just part of some evaluation work at the moment.

  4. #4


    Is that like telling Microsoft i was only evaluating my copy of Windows 7 and therefore didn't need to buy it?

    *Disclaimer* I do not own or download, and do not plan to own or download any copies of Windows 7
    This is a signature.... everyone gets it.

    Join the Unofficial Pentaho IRC channel on freenode.
    Server: Channel: ##pentaho

    Please try and make an effort and search the wiki and forums before posting!
    Checkout the Saiku, the future of Open Source Interactive OLAP(

  5. #5
    Join Date
    Nov 2009


    OK - I will check out Open Street Maps - but I guess I am going to run into the same problem when I try and create the dashboard. What I want to get to is the point where I have a map displaying markers. When I click on a marker other components will refresh based on the id of the marker. Anyone got a sample that will speed up my progress?

  6. #6


    You got FF and Firebug installed, I'd open it w/o mantle (the rest of the ui) and just see where its throwing up.
    This is a signature.... everyone gets it.

    Join the Unofficial Pentaho IRC channel on freenode.
    Server: Channel: ##pentaho

    Please try and make an effort and search the wiki and forums before posting!
    Checkout the Saiku, the future of Open Source Interactive OLAP(

  7. #7
    Join Date
    Nov 2009


    Just tried that - does not seem to be breaking anywhere as far as I can see...

  8. #8
    Join Date
    Nov 2009


    Does this mean anything to anyone - it is a response form Michael Tarallo at Pentaho. My brain is hurting - a very steep learning curve here! I just love the CDF strap line "Dashboards made Easy!".... umm what was it like before Pentaho?!!

    CDF renders the content using AJAX, so if you want to call the Google Maps .xaction object you may have to use an iframe property instead -- see this CDF code snippet here:

    This is a call to an .xaction that renders a custom map component, using SVG, you can see it in the sample in one of my blog entries.
    myMap =
    name: "myMap",
    type: "xaction",
    solution: "work_verticals",
    path: "Retail/Dashboard/svg",
    action: "usa_map_svg.xaction",
    // listeners:,
    htmlObject: "MapObject",
    // serviceMethod:"ViewAction",


    So first, you may need to create a .xaction using a message template that references a html page, with the google maps api code in it.

    ..and then, use a CDF xaction component, to call the .xaction using the iframe:true property.

    This should work for you.

  9. #9
    Join Date
    Jun 2007


    Hi Matt, simply stated working with the Google Maps API by itself, no Pentaho included, is a coding exercise. That is why it is called an API. CDF itself is also an API. You need to have a background in HTML and JavaScript as well as an understanding of the CDF basics that work with Pentaho in order to use it successfully.

    CDF is built on the powerful JQuery library. What CDF provides, is a cut and paste approach to building robust UI's, while working with the benefits of the Pentaho BI platform, Action Sequneces to be particular.

    The response I provided you, and the samples on the Pre-Sales Consulting Portal, are 1 way of many that you can achieve what you are looking for.

    It is just like anything else, I would not take apart or modify my car without the proper know how. As you said in the support case, you are trying to run before you can walk.

    I believe the account rep Ben Tebbs, should be in touch with additional support options for you.

    The samples on the PSCP are a great start for you.

    Also you can get a CDF tutorial and training package from web details.

    Take Care

    Mike Tarallo
    Pre-Sales Director

  10. #10
    Join Date
    Nov 2009

    Thumbs up

    Agree entirely with your comments and very much appreciate your help. I do have a programming background but have limited exposure to JavaScript and JQuery - have worked on projects with Microsoft ASP.Net which is similar but not the same. My reason for trying to run rather than walk is that we need to demo some stuff in the New Year and we thought that it would be easier than it is proving - for the demo I cannot muster any JavaScript support in the business at the moment so have picked up what I can! Not far away now - we can do everything in xactions and display them - but it is the dashboard and interactive stuff beyond simple parameterisation that is proving the tricky bit. I will have a chat to Ben in the New Year and keep playing with this.
    Have a good Christmas.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2017 Pentaho Corporation. All Rights Reserved.