Sunday, November 18, 2012

Dashboard - Google Map integration

OBIEE Google Map with multiple addresses or with the MarkerClusterer API.
 
It is based on blogs:
http://obiee101.blogspot.com/2009/03/obiee-google-maps-multiple-addresses.html
http://blog.guident.com/2009/12/integrating-obiee-and-google-maps-with.html
Working example can be found on Beyond University BI Demo
To use Google Maps you need to sign up for a key on Google Maps website. In those examples we use geocodes but you may use address or postcode but geocodes are much quicker.
All of that html/javascript code is quite simple and self-documented so it is very easy to change.
Tips:
Don't put too much code to Narrative View, create javascript functions in additional file and reference that in your Narrative view (i.e. ).
In javascript don't use single-line-style comments (// comment), use multi-line-style comments instead (/* comment */). When coping or modifying Answers with single-line-style comments you might end up with code placed in single line comment after your comment - some actions remove end of the line sign from Narrative View.
 
 
Simple OBIEE Google Map with multiple addresses.
 
Create an BI Answer query, go to Narrative view, check box next to "Contains HTML Markup" and type similar code in following sections.
In the Prefix part put (in the first line put your Google map key):
 






 
Now check if it works in the compound layout.
 
 
 
OBIEE Google Map with multiple addresses using with the MarkerClasterer API.
 
Create an BI Answer query, go to Narrative view, check box next to "Contains HTML Markup" and type similar code in following sections. Put beyondmap.js somewhere on the server.
In the Prefix part put (in the first line put your Google map key, in second line put path to beyondmap.js file on your server):
 






 
Now check if it works in the compound layout.
 
 
 
Get GeoCodes for postcodes using Google Maps API in OBIEE.
 
Create an BI Answer query, go to Narrative view, check box next to "Contains HTML Markup" and type similar code in following sections.
In the Prefix part put (in the first line put your Google map key):
 







 
 
Now check if it works in the compound layout.