Nokia Maps API Reference

Contents

Class nokia.maps.gfx.Painter

Class Summary

This class is an abstract base class for all painter implementations. A painter renders a nokia.maps.gfx.IDL object using a specific method, for example via a CANVAS tag (nokia.maps.gfx.CanvasPainter), an SVG DOM node (nokia.maps.gfx.SvgPainter) or a VML DOM node (nokia.maps.gfx.VmlPainter).

Method Summary
abstract createElement (idl, [doc, [opacity]]) : Node This method renders the supplied IDL object and returns a DOM node that can be added to the supplied document.
abstract setOpacity (element, opacity) This method changes the global opacity of an element returned by the method createElement().
abstract updateElement (idl, node, [opacity]) This method updates a DOM node that was previously returned by the method createElement() to the caller-supplied IDL object.
Field Summary
static Function defaultPainter This property holds a reference to the constructor of the default painter that can be used with the current browser/platform.
Method Detail
abstract createElement (idl, [doc, [opacity]]) : Node
This method renders the supplied IDL object and returns a DOM node that can be added to the supplied document. The node must contain "something" (VML, SVG, Canvas tag or whatever is suitable) that can hold the image described by the IDL.
Parameters:
{nokia.maps.gfx.IDL} idl An IDL object describing the image to be rendered
{Document} [doc]: document A reference to the document for which the painter is to create an element; if omitted the current document is used
{Number} [opacity]: 1 A value representing the opacity with which the element is to be created; if omitted or invalid, 1.0 (opaque) is used; must be a number between 0 (transparent) and 1 (opaque)
Returns:
{Node} A reference to the DOM node that can be added into the given DOM node and represents the image described by the supplied IDL
abstract setOpacity (element, opacity)
This method changes the global opacity of an element returned by the method createElement().
Parameters:
{Node} element A reference to the DOM node that was returned by createElement()
{Number} opacity A value representing global opacity for the node as a number between 0 and 1
abstract updateElement (idl, node, [opacity])
This method updates a DOM node that was previously returned by the method createElement() to the caller-supplied IDL object. This can result in a complete re-rendering of the node's content or in a partial update, depending on the painter implementation and the number of changes made to the IDL.
Parameters:
{nokia.maps.gfx.IDL} idl An IDL object describing the image to be rendered
{Node} node A reference to the DOM node that was previously returned by the method createElement() and which is to be updated
{Number} [opacity]: A numeric value representing the opacity with which the element is to be updated; if omitted, or an invalid value, 1.0 (opaque) is used; the value must be a number between 0 (transparent) and 1 (opaque)
Field Detail
static Function defaultPainter
This property holds a reference to the constructor of the default painter that can be used with the current browser/platform.

Note that the default painter need not to be the best painter, but it must be a painter that is fully supported by the current browser/platform. It may happen that there is no default painter, so this property may be set to null.

Documentation generated on Wed Jun 27 2012 16:54:18 GMT+0200 (CEST).