Nokia Maps API Reference

Contents

Class nokia.maps.map.component.InfoBubbles

Class Summary

If added to the map, this component manages info bubbles. The component is responsible for adding and removing info bubbles. Each info bubble must have an instance of nokia.maps.geo.Coordinate and its contents is a string object.

This info bubbles components supports single or multiple info bubbles (see nokia.maps.map.component.InfoBubbles#options).

Bubble This interface defines a bubble which is shown on the map by an instance of nokia.maps.map.component.InfoBubbles.
Options This interface defines the properties (options or keys) for nokia.maps.map.component.InfoBubbles#options property.
Method Summary
addBubble (content, coordinate) : nokia.maps.map.component.InfoBubbles.Bubble This method creates a new info bubble, updates it with content and shows it on the map.
addObserver (key, callback, [context]) : nokia.maps.util.OObject This method registers an observer for the property named by the caller.
attach (mapDisplay) This method will be invoked when the component is attached to a map and is not meant to be called directly.
bubbleExists (bubble) : boolean This method checks whether a (previously opened) bubble (still) exists.
closeBubble (bubble) This method closes the bubble that is passed as a parameter.
destroy () This method is called from Display when Display is destroyed.
detach (mapDisplay) This method will be invoked when the component is detached from a map and is not meant to be called directly
get (key) : Variant This method retrieves the value of the property with the name provided by the caller.
getId () : String This method retrieves the unique identifier of the component.
initBubble ([onUserClose, [hideCloseButton]]) : nokia.maps.map.component.InfoBubbles.Bubble This method creates a new empty info bubble.
openBubble (content, coordinate, [onUserClose, [hideCloseButton]]) : nokia.maps.map.component.InfoBubbles.Bubble This method creates a new info bubble, updates it with content and shows it on the map.
remove (key) : nokia.maps.util.OObject This method removes the property with the name provided by the caller.
removeBubble (bubble) This method closes an info bubble and removes it from the map.
removeObserver (key, callback, context) : nokia.maps.util.OObject This method removes the observer for the property named by the caller.
set (nameOrObject, [value, [force]]) : nokia.maps.util.OObject This method sets property values, using the property names and values supplied by the caller.
updateBubble (bubble, content, coordinate) This method updates the content of an info bubble with new content and/or coordinate.
Field Summary
String ALIGNMENT_ABOVE This identifier specifies a vertical alignment above the bubble's anchor.
String ALIGNMENT_BELOW This identifier specifies a vertical alignment below the bubble's anchor.
String ALIGNMENT_LEFT This identifier specifies a horizontal alignment to the left of the bubble's anchor.
String ALIGNMENT_RIGHT This identifier specifies a horizontal alignment to the right of the bubble's anchor.
String DIMENSION_AUTO This identifier specifies a width or height which is automatically determined.
nokia.maps.map.Display mapDisplay This property holds a reference to the map.Display instance to which the given component belongs.
nokia.maps.util.OList openBubbleHandles This property holds an observable list of handles to open bubbles.
nokia.maps.map.component.InfoBubbles.Options options This property holds an observable object that allows for modification of the presentation options on all newly created bubbles that are displayed via the given component.
Constructor Detail

This method initializes an instance of nokia.maps.map.component.InfoBubbles which can be added to a map Display.

new nokia.maps.map.component.InfoBubbles()
Method Detail
addBubble (content, coordinate) : nokia.maps.map.component.InfoBubbles.Bubble
This method creates a new info bubble, updates it with content and shows it on the map.
Parameters:
{String | DomElement} content The content to be shown in the info bubble; it can be an HTML string, please note that Flash content in the bubble overlap other elements in the document
{nokia.maps.geo.Coordinate} coordinate An object containing the geographic coordinates of the location, where the bubble's anchor is to be placed.
Deprecated:
as of 2.2.1 in favor of nokia.maps.map.component.InfoBubbles#openBubble
Returns:
{nokia.maps.map.component.InfoBubbles.Bubble} The handle of this bubble
bubbleExists (bubble) : boolean
This method checks whether a (previously opened) bubble (still) exists.
Parameters:
{nokia.maps.map.component.InfoBubbles.Bubble} bubble A handle to the bubble
Deprecated:
as of 2.2.1, check for bubble's state with nokia.maps.map.component.InfoBubbles.Bubble#getState instead
Returns:
{boolean} A flag indicating whether the bubble with the given handle (still) exists and is accessible
closeBubble (bubble)
This method closes the bubble that is passed as a parameter.
Parameters:
{nokia.maps.map.component.InfoBubbles.Bubble} bubble A handle to the info bubble
initBubble ([onUserClose, [hideCloseButton]]) : nokia.maps.map.component.InfoBubbles.Bubble
This method creates a new empty info bubble.

Note that you should use nokia.maps.map.component.InfoBubbles#openBubble if you do not want to nokia.maps.map.component.InfoBubbles.Bubble#update and nokia.maps.map.component.InfoBubbles.Bubble#open it by manually. This method is useful if you want to preload some content into bubble before showing it.
Parameters:
{Function} [onUserClose]: A callback method which is called when user closes the bubble (by clicking on close button) to be placed.
{Boolean} [hideCloseButton]: Hides close button if set to true.
Returns:
{nokia.maps.map.component.InfoBubbles.Bubble} The handle of this bubble
openBubble (content, coordinate, [onUserClose, [hideCloseButton]]) : nokia.maps.map.component.InfoBubbles.Bubble
This method creates a new info bubble, updates it with content and shows it on the map.
Parameters:
{String | DomElement} content The content to be shown in the info bubble; it can be an HTML string, please note that Flash content in the bubble overlap other elements in the document
{nokia.maps.geo.Coordinate} coordinate An object containing the geographic coordinates of the location, where the bubble's anchor is to be placed.
{Function} [onUserClose]: A callback method which is called when user closes the bubble (by clicking on close button) to be placed.
{Boolean} [hideCloseButton]: Hides close button if set to true.
Returns:
{nokia.maps.map.component.InfoBubbles.Bubble} The handle of this bubble
removeBubble (bubble)
This method closes an info bubble and removes it from the map.
Parameters:
{nokia.maps.map.component.InfoBubbles.Bubble} bubble A handle to the bubble
Deprecated:
as of 2.2.1 in favor of nokia.maps.map.component.InfoBubbles.Bubble#close
updateBubble (bubble, content, coordinate)
This method updates the content of an info bubble with new content and/or coordinate.
Parameters:
{nokia.maps.map.component.InfoBubbles.Bubble} bubble A handle to the info bubble
{String} content The content to be shown in the info bubble provided as an HTML string; note that flash content in the bubble can lead to the effect that the flash content overlaps other elements in the document
{nokia.maps.geo.Coordinate} coordinate An object containing the geographic coordinates of the location, where the anchor is to be placed
Deprecated:
as of 2.2.1 in favor of nokia.maps.map.component.InfoBubbles.Bubble#update
Field Detail
readonly String ALIGNMENT_ABOVE
This identifier specifies a vertical alignment above the bubble's anchor.
readonly String ALIGNMENT_BELOW
This identifier specifies a vertical alignment below the bubble's anchor.
readonly String ALIGNMENT_LEFT
This identifier specifies a horizontal alignment to the left of the bubble's anchor.
readonly String ALIGNMENT_RIGHT
This identifier specifies a horizontal alignment to the right of the bubble's anchor.
readonly String DIMENSION_AUTO
This identifier specifies a width or height which is automatically determined.
readonly nokia.maps.util.OList openBubbleHandles
This property holds an observable list of handles to open bubbles. When a bubble is shown, the respective handle is added to this list. When a bubble is closed, its handle is removed from this list.
This property holds an observable object that allows for modification of the presentation options on all newly created bubbles that are displayed via the given component.

Use nokia.maps.util.OObject.set() to set properties on this object to make sure changes are propagated correctly to the system.
Examples:
var infoBubbles = new nokia.maps.map.component.InfoBubbles();
//map is an instance of nokia.maps.map.Display
map.components.add(infoBubbles);

// causes all subsequently created bubbles to open left of their anchor
// (unless there's not enough space on that side)
infoBubbles.options.set("defaultXAlignment", infoBubbles.ALIGNMENT_LEFT);
infoBubbles.openBubble("myInfoBubble", map.center);
Documentation generated on Wed Jun 27 2012 16:54:26 GMT+0200 (CEST).