How to display map on pentaho bi server v6.1

775 views
Skip to first unread message

agus irawan

unread,
Dec 7, 2017, 1:57:14 AM12/7/17
to Pentaho Community
I have a dimension table containing countryid, countryname, latitude, longitide and fact table containing countryid, sales. I am confusing with maps component in CDE, I have tried but the maps still not show. How to display map on pentaho bi server v6.1 based on countryname and latitude longitude using NewMapComponent/Google Maps Overlay?, thanks in advance.

Regards,
Agus

agus irawan

unread,
Dec 7, 2017, 6:14:42 AM12/7/17
to Pentaho Community
Previously I have tried NewMapComponet based on the existing plugin-sampel (base on lat/long) and succeeded by using "scriptable over scripting" datasource.

I want to ask what if the datasource comes from schema mondrian?

How should I design the exact schema if I have two tables dim_country (countryid, countryname, latitude, longitude) and fact_country_sales (countryid, sales)?

Thanks in advance.


Regards,
Agus

Carlos Russo

unread,
Dec 9, 2017, 1:07:36 PM12/9/17
to Pentaho Community
The NewMapComponent interprets special column names in the resultset: "latitude", "longitude", "fill", "r", etc...

As long as your query returns a resultset with columns named "latitude" and "longitude", the NewMapComponent should typically show markers at those locations.
It does not really matter the type of datasource.

If your table does not contain latitude/longitude, e.g "countryid", "sales", then you will need to use some LocationResolver addIn to figure out the coordinates for each each row of data.

agus irawan

unread,
Dec 10, 2017, 8:49:32 PM12/10/17
to Pentaho Community
Hi Carlos, thanks for the explanation, this is very helpful. 

Btw, if anyone has a problem like me, you can see the following reference schema. In MDX query get the property value using properties function like this.


Regards,
Agus

agus irawan

unread,
Dec 13, 2017, 12:46:01 AM12/13/17
to Pentaho Community
Hi Carlos, Hi everyone, 

I have another question, how to change marker color using MDX query in NewMapComponent?

I have tried to create a query that generates the table as follows (ex: using jpivot), but the marker color in the map not change!

or

Anyone know why this can happen?, thanks in advance..


Regards,
Agus

agus irawan

unread,
Dec 14, 2017, 4:43:54 AM12/14/17
to Pentaho Community
Referring from this thread, I have successfully solved my case (radius of the marker and the fill color follow the sales value),


but when I choose "requirejs support" (I need it to embed dashboard to web apps), the map does't show!

Does anyone have a solution for my new case?, so the map can show up and the dashboard can be embeded ?, thanks in advance..

Regards,
Agus

Nelson Sousa

unread,
Dec 14, 2017, 5:05:24 AM12/14/17
to pentaho-...@googlegroups.com

open the browser debugger window and append debug=true to the dashboard url and see what's wrong.

With requirejs support there's no longer a global Dashboards object. Instead, there's a dashboard objec (note the different spelling). If your dashboard refers to MetaLayer, or Dashboards or another of the old methods and functions, it will fail with requirejs support on.

The debugger should get you started in figuring out what's wrong.

Cheers,


Nelson Sousa
Business Intelligence Consultant


--
You received this message because you are subscribed to the Google Groups "Pentaho Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pentaho-community+unsubscribe@googlegroups.com.
To post to this group, send email to pentaho-community@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pentaho-community/dbbc0e0a-2e67-49ab-94bc-7c6f2bece39a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Carlos Russo

unread,
Dec 14, 2017, 5:07:59 PM12/14/17
to Pentaho Community

When setting up a map component, most people forget to assign a height to the map's htmlObject (which is defined in CDE's Layout panel): as a result, the map is rendered with zero height, and people are puzzled as to why it does not render.

agus irawan

unread,
Dec 14, 2017, 10:39:41 PM12/14/17
to Pentaho Community
Hello Nelson.. thanks for your explanation, if my maps fail with requirejs support on, is there any other solution?, like changing the pentaho version?, or there are other components that can be used to display maps like newmapcomponent but can use requirejs support?, thanks in advance..

Regards,
Agus
To unsubscribe from this group and stop receiving emails from it, send an email to pentaho-commun...@googlegroups.com.
To post to this group, send email to pentaho-...@googlegroups.com.

agus irawan

unread,
Dec 14, 2017, 10:47:13 PM12/14/17
to Pentaho Community
Hello Carlos thanks for your explanation, I have assigned a height in the maps component and my maps is rendered but if I choose "requirejs support" the maps not render.. 

Regards,
Agus

Nelson Sousa

unread,
Dec 15, 2017, 2:49:53 AM12/15/17
to pentaho-...@googlegroups.com

You’ll need to change your javascript code and make it requirejs compatble. 
Depending on how complex your dashboard is this may take some effort


For more options, visit https://groups.google.com/d/optout.
--
Sent from Gmail Mobile

Carlos Russo

unread,
Dec 15, 2017, 4:41:48 AM12/15/17
to Pentaho Community
You'll need to provide more information.
Do you have any errors in the browser's javascript console?
Typically, when porting from legacy to requirejs dashboards people tend to forget to convert some references of the global variable "Dashboards" to the local reference "this.dashboard"

agus irawan

unread,
Dec 17, 2017, 8:48:58 PM12/17/17
to Pentaho Community
Thanks Nelson and Carlos for the explanation, right now my dashboard is running well (can embedded). Little information for anyone has a problem like me, to display radius and fill in markers based on sales (newmapcomponent) doesn't require additional javascript, we only need to give special column names (as in the above explanation), which should be noted that the initial letter on the column naming should be uppercase like "Latitude", "Longitude", "R", "Fill".

Regards,
Agus

agus irawan

unread,
Dec 17, 2017, 9:25:39 PM12/17/17
to Pentaho Community

Sorry there is an wrong explanation above, uppercase or lowercase has no effect, the effect is the contents of the record in the columns that we created, such as if we want to create a radius and fill marker based on sales without using additional javascript, we must create a new column using the calculate column like the example below (mdx query):

WITH
    MEMBER [Measures].[fill] AS  '[Measures].[Sales] * -1'
    MEMBER [Measures].[r] AS  '[Measures].[Sales]'
SELECT
NON EMPTY {[Measures].[Latitude], [Measures].[Longitude], [Measures].[Sales], [Measures].[fill], [Measures].[r]} ON COLUMNS,
NON EMPTY {[dim_country].[Country].Members} ON ROWS
FROM [Sales and Location]


*fill multiply negative for red to indicate bad sales and green color for good sales


Regards, 
Agus
Reply all
Reply to author
Forward
0 new messages