Revision as of 03:35, 12 October 2011 by hamishwillee (Talk | contribs)

HERE Maps API - How to add an HTML InfoBubble on the map

From Nokia Developer Wiki
Jump to: navigation, search

Ovi Maps API - How to add an HTML infoBubble on the map



An infoBubble must have a ovi.mapsapi.geo.Coordinate and content which can be either provided as a string or as a ovi.mapsapi.search.Location object.

API defines:

Extends ovi.mapsapi.map.component.Component.
new ovi.mapsapi.map.component.InfoBubbles ()
Options Interface defining the info bubbles' options (keys)


Ovi Maps API supported web browser (basically any modern web browser)

Important about Maps credentials

With Ovi Maps API you can start without having any credentials given, but you might face a performance gap. In order to get the full potential out of the offering, you must get the credentials that authenticate your application against the Services. Please read through the Location API.

For more information on how to obtain the credentials, please start with the Ovi Maps API Developers Guide section "Acquiring API credentials"


In this example we will create one infoBubble with video content from YouTube. Location is Bermuda Triangle near Bahamas and the video will show a plane flying on that area.

Example code

<script src="http://api.maps.ovi.com/jsl.js" type="text/javascript" charset="utf-8">
<link rel="stylesheet" href="style.css" />
<body style = "width:100%; height:100%;">
<div id="map" style="width:100%; height:100%;"></div>
<script type="text/javascript">
var myInfoBubbles = new ovi.mapsapi.map.component.InfoBubbles();
var myHTMLcontent = "<div class=\"myHtmlContent\">"+"<iframe width='425' height='349' src='http://www.youtube.com/embed/9hVAFzo30qE' frameborder='0' allowfullscreen></iframe>"+"</div>";
var map = new ovi.mapsapi.map.Display(document.getElementById("map"), // new instance of Ovi Maps
components: [
new ovi.mapsapi.map.component.Behavior(),
new ovi.mapsapi.map.component.ZoomBar(),
new ovi.mapsapi.map.component.Overview(),
new ovi.mapsapi.map.component.TypeSelector(),
new ovi.mapsapi.map.component.ScaleBar()
'zoomLevel': 6,
'center':[25, -71]
map.set("baseMapType", map.SATELLITE);
myInfoBubbles.addBubble(myHTMLcontent, new ovi.mapsapi.geo.Coordinate(25, -71));

For more on Ovi Maps API

Please check out the Ovi Maps API full documentation and API reference here:


Tested on

Google Chrome 11.0x

Mozilla Firefox 5.0b

4455 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.