Bing Map Integration with OBIEE 11g

As in OBIEE 10g, OBIEE 11g provides the ability to integrate Bing maps in the presentation layer through HTML and Java Script in the Narrative view. This blog demonstrate this functionality. In the example below, we will plot cities on a Bing map with conditional icons based on profit amounts (blue and red). This demo uses custom data but can be further extended to use real data sets.
Here are the steps to integrate Bing maps:

1. Create a new report that includes city, state, latitude, longitude, and the profit amount measure.
2. Format the columns Latitude and Longitude to have at least 6 decimal places to ensure precise plotting on the map.

3. Now in the Results tab, add the Narrative view to include the custom Java Script shown below. In the Prefix section call the Bing map API and declare the required variables. In our case we used arrays to hold the latitude, longitude and profit.
var v_lat = [];
var v_long = [];
var v_profit = [];
4. In the Narrative section, pass the required columns with @{column_location} with Latitude and Longitude. In our example we have passed Latitude (@4), Longitude (@5) and Profit (@3).

v_lat.push(@4);
v_long.push(@5);
v_profit.push("@3"); // The added "$" makes profit a string value.
5. Define the following two functions in the Postfix section:
GetMap(): Sets the default settings for the map (like 2D mode), initial location (init_x1), default view to Road, and map zoom size to 4.

AddShapes01(): Loops through the array length and drops the push pin icons (custom icons) for each latitude and longitude, and their respective title.
6. Check the “Contains HTML Markup” in the Narrative.

The image below shows the table view and the Narrative View in the dashboard.

Feel free to contact us with questions.

4 comments:

  1. Hi I am Masood, I am very glad to see your article but there is a problem when i am placing the code in Narrative view as you have said above it doesn't show the map infact it shows the line of code multiple time in the result.

    I have searched that issue on most of the places buti haven't seen Map is viewed in a compound layout.

    So can you please provide me a complete steps for creating Maps in OBIEE 11g and also how to manage the weblogic server for the Maps. Thanks

    ReplyDelete
  2. There could be couple of reasons for not showing in Compound View;
    1. Use IE if you are working with Firefox or other browsers.
    2. If you have made any changes in the code like the icon location make sure they are referring the correct path. Other than location try using the same code as posted.
    3. Finally, set Harden XSS property to false in instanceconfig.xml file.
    Hope this helps and it should work as good as in OBIEE 10g.

    Thanks for checking our post and feel free to contact us.

    ReplyDelete
  3. Hi Vel, I hope you are well. Actually my client wants to see the customize map of Srilanka in OBIEE 11g. I have tried it through database but i didn't success or in default map application of Oracle Srilanka map is avaialable but no deeply information is present like cities, road or other information. I got the maps through narrative view but i am not success to integrate my reports with these maps.

    Another thing in OBIEE 11.1.1.5 when i am deploying the new sample App the problem is that in Section 2.2 Page 7 he is saying that create the datapump folder in C drive and then unzip the file in that folder but he didn't mentioned the file name which file i have placed in that folder.

    So, Please guide me what should i do and please provide me the steps through which i can easily create my custom Srilanka map or also tell me the steps how i integrate with my report to narrative view map, Thanks.

    ReplyDelete
  4. Hi,
    Assuming - you have tired Oracle Spatial map to get Srilanka in-detail but later moved on to integrate BI with Bing or Google map using Narrative. If yes, then implementation steps are much similar as in the blog;
    1. Modify/add coordinates to focus on the country/region you are interested (see GetMap() )
    2. Use the existing function AddShapes01() as a sample and pass your details like latitude, longitude, along with other details you like to show on the map from the reports.
    3. Narrative can be configured to push the data v1.push ("@3") (see v_lat.push(@4); v_long.push(@5);). Try with few coordinates and see the result before pushing large number of records to Narrative.
    I didn’t see any error details in your comments; it will help answering the question.

    The sample app installation steps, especially loading datadump is for reference. You can choose any folder location on the db server for the dump file, if you can see the .dmp file use “impdp” utility to import.

    ReplyDelete


Welcome to the Guident Blog!

Our Blog features several of Guident's top leaders and industry experts who share their perspectives and invite discussion on industry news, best practices, tips and tricks, and much more.