Nokia Maps API Reference

Contents

Class nokia.maps.kml.component.KMLResultSet

Class Summary

This class represents a result set that can be initiated with a response from a KML file request.

Example of usage

	var kmlManager = new nokia.maps.kml.Manager();

	function onKMLParsed(kmlManager) {
		var resultSet,
			container;

		if (kmlManager.state == KMLManager.State.FINISHED) {
			resultSet = new nokia.maps.kml.component.KMLResultSet(kmlManager.kmlDocument);
			resultSet.addObserver("state", function (resultSet) {
				if (resultSet.state == "finished") {
					var container = resultSet.container;
					//add map objects/container to map display
					//mapDisplay.objects.add(container);
				}
			});
			resultSet.create();
		}
	}

	kmlManager.addObserver("state", onKMLParsed, that);
	kmlManager.parseKML("sampleFile.kml");
	

new nokia.maps.kml.component.KMLResultSet (kmlDocument, [display])
Method Summary
addObserver (key, callback, [context]) : nokia.maps.util.OObject This method registers an observer for the property named by the caller.
create () Method launches convertion of kmlDocument provided in the constructor to nokia.maps.map.Container
get (key) : Variant This method retrieves the value of the property with the name provided by the caller.
getLineObject (geometry) : nokia.maps.map.Polyline This method converts an instance of LinearRing or LineString (a geometry) to a displayable map nokia.maps.map.Polyline.
getObjects (geometries) This method converts all the geometries supplied by the caller and puts them in a map container that can be displayed directly in map.
getPointObject (geometry) : nokia.maps.map.Marker | nokia.maps.map.StandardMarker This method converts the point geometry to a displayable map object.
getPolygonObject (geometry) : nokia.maps.map.Polygon This method converts a polygon geometry to a nokia.maps.map.Polygon that can be displayed on the map.
remove (key) : nokia.maps.util.OObject This method removes the property with the name provided by the caller.
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.
Field Summary
nokia.maps.map.Container container This property is a container of markers, representing the results.
String state This property holds the state of the container creation.
Direct Inheritance
Constructor Detail

Initialize a new instance of the class with the following parameters.

new nokia.maps.kml.component.KMLResultSet(kmlDocument, [display])
Parameters:
{nokia.maps.kml.Document} kmlDocument An instance of kml.Document that results from parsing a KML file
{nokia.maps.map.Display} [display]: An instance of map.Display so that a map object listener can be added to ensure support for highlighted styles; if this argument is not provided by the caller, highlighted styles are not supported
Method Detail
create ()
Method launches convertion of kmlDocument provided in the constructor to nokia.maps.map.Container
getLineObject (geometry) : nokia.maps.map.Polyline
This method converts an instance of LinearRing or LineString (a geometry) to a displayable map nokia.maps.map.Polyline.
Parameters:
geometry
Returns:
{nokia.maps.map.Polyline} A displayable map object that can be added directly to an instance of nokia.maps.map.Display
getObjects (geometries)
This method converts all the geometries supplied by the caller and puts them in a map container that can be displayed directly in map.
Parameters:
geometries An object that contains a hierarchical tree of geometries; the objects from the tree can be converted to map objects in KMLResultSet
Returns:
nokia.maps.map.Container A map container object that can be displayed on the map
This method converts the point geometry to a displayable map object. Depending on the style properties, the resulting object can be an instance of nokia.maps.map.Marker or nokia.maps.map.StandardMarker
Parameters:
geometry A point geometry object to be converted to a map object
Returns:
{nokia.maps.map.Marker | nokia.maps.map.StandardMarker} An object that can be displayed on the map by adding it to an instance of nokia.maps.map.Display
getPolygonObject (geometry) : nokia.maps.map.Polygon
This method converts a polygon geometry to a nokia.maps.map.Polygon that can be displayed on the map.
Parameters:
geometry
Returns:
{nokia.maps.map.Polygon} A displayable polygon that can be added directly to an instance of nokia.maps.map.Display
Field Detail
This property is a container of markers, representing the results.
String state
This property holds the state of the container creation. The possible values are: "initial", "started", "finished".
Documentation generated on Thu Dec 15 2011 15:14:31 GMT+0100 (CET).