Class: IWPoiUtils

IWPoiUtils

A class to help you to suport all kinds of points of interest (POIs) on the map. Adding a set of POIs and creating tooltips and bubbles on mouseover and click events is easy like this:

IWPoiUtils.initFormatters(); // initialize the default POI behaviour
IWPoiUtils.initLayers(map, 'demo'); // add the POIs of the layer "demo" to your map object

new IWPoiUtils()

Singleton constructor

Methods


initFormatters(formatters)

Initializes the POI formatters. This optionally takes an array of formatters, or uses a set of default formatters if not specified. Example: Use an additional custom formatter (with highest priority) like this:

var formatters = [
	new IWPublicTransportFormatter(),
	new IWRailwayFormatter(),
	new IWParkingFormatter(),
	new IWTrafficFormatter(),
	new IWDefaultPoiFormatter()
];
IWPoiUtils.initFormatters(formatters);
For default behaviour just call IWPoiUtils.initFormatters();
Parameters:
Name Type Description
formatters Array.<object> an array of formatters
Returns:
Type
void

initLayers(map, key, layerGroup, range)

Adds all POI types of a POI catalogue to the map.
Parameters:
Name Type Description
map IWMap a map
key String the POI catalogue name
layerGroup IWLayerGroup a group to add the new layers to (optional, adds the new layers at top level by default)
range IWRange a range of zoom levels to display the POIs on (optional, defaults to level 10 to 18)
Returns:
Type
void

makeLayer(layerTitle, layerName, shapeName, idfLayerName, range, options, maximumHits)

Creates a layer with default behaviour and register listeners
Parameters:
Name Type Description
layerTitle string the title of the layer (used to show it in a POI layer list)
layerName string the name of the layer (has to be an existing layer name of the server)
shapeName string the name of the shape to show in the layer (has to be an existing shape file on the server)
idfLayerName string the name of the layer which is used for identify requests (optional, default is the layer name)
range IWRange the visibility range of the layer (optional, default is visible on all zoom levels)
options object an object which is passed to ondatareceive events (optional)
maximumHits number the maximum number of hits which is requested from the server
Returns:
the layer
Type
IWLayer