Class: IWGeometryFilter

IWGeometryFilter

main class to filter geometries

new IWGeometryFilter()

Methods


clear(map)

resets the geometryFilter (removes renderers and shapes)
Parameters:
Name Type Description
map IWMap the map

drawGetLayerResult(result, renderingAttributes, highlightingAttributes, map, callback, options)

draw the geometries of the given result object on the map.
Parameters:
Name Type Description
result object the result of getLayer function (contains array of geometries, extent and layer infos)
renderingAttributes object a set of CSS attributes to render the filtered polygons, e.g. {fill: "red", fillOpacity: 0, stroke: "grey", strokeWidth: 5}
highlightingAttributes object a set of CSS attributes to render polygons while the cursor hovers above them, e.g. {fill: "blue", fillOpacity: 0.5, stroke: "black", strokeWidth: 8}
map IWMap the map
callback function the callback function
options object set tooltip attribute or textAttributes E.g {tooltip:{value:'$ID$ $NAME$'}, textAttributes:{value:'NAME', renderOptions: {fill: 'red',fontSize: '30px', fontWeight: 'bold'}, boxAttributes: {fill: 'white'}}}

drawLayer(layerId, area, filters, renderingAttributes, highlightingAttributes, map, callback, options)

Requests geometry and attributes from the given layer and draw them on the map.
Parameters:
Name Type Description
layerId String layerId of the layer, e.g. KGS
area object an area to bound the shapes, e.g. {topleft: "697526,6759257", bottomright: "789250,6667533"}, a bounding box {coord: "726113,6702540", radius: 16758}, a circle {polygon: ["727641,6713853","739566,6726694","749197,6708808"]}, a polygon
filters array a list of filter objects, e.g. {type: "prefix", key: "PLZ", value: "5"} a prefix filter to select only postal codes starting with 5
renderingAttributes object a set of CSS attributes to render the filtered polygons, e.g. {fill: "red", fillOpacity: 0, stroke: "grey", strokeWidth: 5}
highlightingAttributes object a set of CSS attributes to render polygons while the cursor hovers above them, e.g. {fill: "blue", fillOpacity: 0.5, stroke: "black", strokeWidth: 8}
map IWMap a map
callback function the callback function
options object set tooltip attribute or textAttributes E.g {tooltip:{value:'$ID$ $NAME$'}, textAttributes:{value:'NAME', renderOptions: {fill: 'red',fontSize: '30px', fontWeight: 'bold'}, boxAttributes: {fill: 'white'}}}

getLayer(layerId, area, filters, zoom, callback)

Requests geometry and attributes from the given layer.
Parameters:
Name Type Description
layerId String ID of the layer, e.g. KGS
area object an area to bound the shapes, e.g. {topleft: "697526,6759257", bottomright: "789250,6667533"}, a bounding box {coord: "726113,6702540", radius: 16758}, a circle {polygon: ["727641,6713853","739566,6726694","749197,6708808"]}, a polygon
filters array a list of filter objects, e.g. {type: "prefix", key: "PLZ", value: "5"} a prefix filter to select only postal codes starting with 5
zoom number preffered zoom level (depends on the zoom range of the layer, if it is out of range no layer is returned). Default is 13
callback function the callback function

getLayerAttributes(layerId, filters, offset, limit, callback)

Requests items and their attributes from a layer.
Parameters:
Name Type Description
layerId String layerId of the layer, e.g. KGS
filters array a list of filter objects, e.g. {type: "prefix", key: "PLZ", value: "5"} a prefix filter to select only postal codes starting with 5
offset number index of the first desired element, can be used for paging. 0 determined!
limit number number of elements, can be used for paging
callback function the callback function

getLayers(callback)

Lists all available layers.
Parameters:
Name Type Description
callback function function which is called when a result is available

removeLayer(map, layerId)

removes the given layer
Parameters:
Name Type Description
map IWMap the map
layerId String layerId of the layer, e.g. KGS