Class: IWLayer

IWLayer

A class which encapsulates a value-key pair of layername and shapefile.

new IWLayer(map, layerTitle, layerName, idfLayerName)

Creates a new layer object. Throws 'onremove' event if removed from map.
Parameters:
Name Type Description
map IWMap
layerTitle String title of the layer
layerName String the name of the layer
idfLayerName String the name of the idflayer

Extends

Members


<static> DRAW_ON_LABELS :number

Type:
  • number

<static> DRAW_ON_TILES :number

Type:
  • number

Methods


addShape(newShape)

Adds a new shape to the layer.
Parameters:
Name Type Description
newShape IWShape the shape
Returns:
Type
void

checkIfExistsAsParent(node)

Checks if node already exists as predecessor (to prevent circles).
Parameters:
Name Type Description
node Object Object with tree functionality
Inherited From:
Returns:
Type
Boolean

getChildren()

Returns an array with all children
Inherited From:
Returns:
children
Type
Array

getCurrentShapeName(newZoomLevel)

Returns the name of the shape file which is currently visible on the map. Returns null if no shape is visible for current zoomlevel.
Parameters:
Name Type Description
newZoomLevel number the next zoomlevel
Returns:
shapefile
Type
String

getIdfLayerName()

Returns the name of the idflayer.
Returns:
Type
String

getLayerName()

Returns the name of the layer.
Returns:
the name
Type
String

getLayerTitle()

Returns the title of the layer.
Returns:
the title
Type
String

getName()

Returns name of the node element
Inherited From:
Returns:
name
Type
String

getParent()

Returns parent node
Inherited From:
Returns:
node Object with tree functionality
Type
Object

getShapes()

Returns all shapes.
Returns:
Type
Array.<IWShape>

getUseLabelsOrTilesForDrawing()

Returns IWLayer.DRAW_ON_TILES or IWLayer.DRAW_ON_LABELS
Returns:
Type
number

hasChild(child)

Checks if node exists as child.
Parameters:
Name Type Description
child Object
Inherited From:
Returns:
Type
Boolean

hasChildren()

Returns a boolean if node has any childs
Inherited From:
Returns:
Type
Boolean

isMarked()

Returns if node is marked.
Inherited From:
Returns:
Type
Boolean

isVisible()

Checks if this layer is visible or not.
Overrides:
Returns:
true if this layer is visible otherwise false.
Type
boolean

mark()

Marks the node. Throws 'statechanged' event if node was unmarked.
Inherited From:
Returns:
Type
void

remove(node)

Removes the node from the children.
Parameters:
Name Type Description
node Object Object with tree functionality
Inherited From:
Returns:
Type
void

removeShape(shapeName)

Removes shape from this layer.
Parameters:
Name Type Description
shapeName String
Returns:
Type
boolean

setIdfLayerName(idfLayerName)

Sets the name of the idflayer.
Parameters:
Name Type Description
idfLayerName String
Returns:
Type
void

setLayerName(layerName)

Sets the name of the layer.
Parameters:
Name Type Description
layerName String
Returns:
Type
void

setLayerTitle(layerTitle)

Sets the title of the layer.
Parameters:
Name Type Description
layerTitle String
Returns:
Type
void

setName(name)

Sets name of the node element
Parameters:
Name Type Description
name String the name of the node element
Inherited From:
Returns:
Type
void

setParent(newParent)

Sets the parent of this node
Parameters:
Name Type Description
newParent Object the parent node.
Inherited From:
Returns:
Type
void

setUseDefaults(useDefaults)

Sets if the defaults should be used.
Parameters:
Name Type Description
useDefaults boolean
Inherited From:
Returns:
Type
void

setUseLabelsOrTilesForDrawing(labelsOrTiles)

Parameters:
Name Type Description
labelsOrTiles number possible values are IWLayer.DRAW_ON_TILES and IWLayer.DRAW_ON_LABELS
Returns:
Type
void

setVisibility(visibility)

Sets the visibilty for the Layer
Parameters:
Name Type Description
visibility boolean
Returns:
Type
void

setVisible(visible)

Sets the visibility of node and updates it for the whole tree
Parameters:
Name Type Description
visible boolean
Inherited From:
Returns:
Type
void

toString()

Returns a string representation of this layer.
Returns:
Type
String

unmark()

Unmarks the node. Throws 'statechanged' event if node was marked.
Inherited From:
Returns:
Type
void

useDefaults()

Returns if defaults should be used.
Inherited From:
Returns:
Type
boolean