Class: LayerItsInventory

LayerItsInventory

Its Layer class

Constructor

new LayerItsInventory(options)

ITS device layer, types available at http://transportal.cee.wisc.edu/its/inventory/
Parameters:
Name Type Description
options object config
Properties
Name Type Attributes Default Description
id string <optional>
layer id
name string <optional>
Unnamed Layer layer name
opacity number <optional>
1 opacity
visible boolean <optional>
true default visible
minZoom number <optional>
min zoom level, 0 - 28
maxZoom number <optional>
max zoom level, 0 - 28
params object <optional>
{} the get parameters to include to retrieve the layer
zIndex number <optional>
0 the z index for the layer
loadCallback function <optional>
function to call on load, context this is the layer object
legendCollapse boolean <optional>
false if the legend item should be initially collapsed
legendCheckbox boolean <optional>
true if the legend item should have a checkbox for visibility
legendContent boolean <optional>
additional content to add to the legend
autoLoad boolean <optional>
false if the layer should auto load if not visible
style object | * <optional>
the layer style, use openlayers default style if not defined
onDemand boolean <optional>
false if the layer should be loaded by extent on map move
onDemandDelay number <optional>
300 delay before the map move callback should be called
mapMoveObj MapMoveCls <optional>
mapMove alternate map move object for use with multi map pages
itsType string the ITS device type, use the url flag at http://transportal.cee.wisc.edu/its/inventory/
addPopup boolean <optional>
true if the popup should be added automatically
itsIcon string <optional>
the ITS device type icon image see http://transportal.cee.wisc.edu/its/inventory/icons/
itsLineStyle object <optional>
A single line style
Properties
Name Type Attributes Default Description
color string the line color as rgb or hex
width number <optional>
5 the line width
itsIconConfig object <optional>
The icon subtype configuration
Properties
Name Type Attributes Default Description
prop string The property used to define icon attribute symbolization
defaultName string The default name to be used if no other match is found
defaultIcon string The default icon to be used for no other matches
iconArray object <optional>
[] an array, items with format [property, name, img]
itsLineConfig object <optional>
The property used to define icon attribute symbolization
Properties
Name Type Attributes Default Description
prop string The property used to define icon attribute symbolization
defaultName string <optional>
Other The default name to be used if no other match is found
defaultColor string <optional>
red The default line color to be used for no other matches
defaultWidth number <optional>
The default line width to be used for no other matches
lineArray object <optional>
[] an array, items with format [property, name, color, optional width = 5]
Source:

Extends

Members

autoLoad :boolean

get if the layer is autoloaded
Type:
  • boolean
Inherited From:
Source:

features :Array.<ol.Feature>

array of ol features
Type:
  • Array.<ol.Feature>
Inherited From:
Source:

legendContent :string

get the legend content
Type:
  • string
Inherited From:
Source:

loaded :boolean

Check if the layer is loaded
Type:
  • boolean
Inherited From:
Source:

mapCrs :string|*

get the map CRS if it is defined by the map move object
Type:
  • string | *
Inherited From:
Source:

mapMove :MapMove|*

get the map move object
Type:
  • MapMove | *
Inherited From:
Source:

mapMoveParams :object

map move params
Type:
  • object
Inherited From:
Source:

maxResolution :number|*

get the maximum resolution
Type:
  • number | *
Inherited From:
Source:

maxZoom :number|*

get max zoom
Type:
  • number | *
Inherited From:
Source:

minResolution :number|*

get the minimum resolution
Type:
  • number | *
Inherited From:
Source:

minZoom :number|*

get min zoom
Type:
  • number | *
Inherited From:
Source:

name :string

Get the layer name
Type:
  • string
Inherited From:
Source:

onDemandDelay :number|*

get on demand delay in miliseconds
Type:
  • number | *
Inherited From:
Source:

opacity :number

Get the layer opacity
Type:
  • number
Inherited From:
Source:

params :object

get the map get params
Type:
  • object
Inherited From:
Source:

source :*

get the layer source
Type:
  • *
Inherited From:
Source:

style :ol.Style|function

get the style definition
Type:
  • ol.Style | function
Inherited From:
Source:

url :string

get the url
Type:
  • string
Inherited From:
Source:

visible

Set the layer visibility
Inherited From:
Source:

zIndex :number

get the z index
Type:
  • number
Inherited From:
Source:

Methods

(protected) _load() → {boolean}

trigger load features
Inherited From:
Source:
Returns:
if already loaded
Type
boolean

addFeatures(featureCollection)

add feature collection
Parameters:
Name Type Description
featureCollection object as geojson object
Inherited From:
Source:

addLegendContent(additionalContent=opt)

add additional content to the legend
Parameters:
Name Type Attributes Description
additionalContent= string <optional>
additonal content to add
Inherited From:
Source:

clear()

clear features in the layer
Inherited From:
Source:

getLegendDiv() → {string}

Get the legend html, be sure to only add to the DOM once
Inherited From:
Source:
Returns:
html for layer wrapped in a div
Type
string

mapMoveBefore(zoom, evtTypeopt) → {boolean}

Before call to map move callback, can prevent call by returning false
Parameters:
Name Type Attributes Description
zoom number zoom level
evtType string <optional>
undefined for initial load, otherwise one of 'change:center', 'change:resolution'
Inherited From:
Source:
Returns:
if the call should proceed
Type
boolean

mapMoveCallback(d)

callback function on map move
Parameters:
Name Type Description
d object the json response
Inherited From:
Source:

mapMoveMakeGetParams(extent, zoomLevel)

callback to generate the parameters passed in the get request
Parameters:
Name Type Description
extent object extent object
Properties
Name Type Description
minX number minX
minY number minY
maxX number maxX
maxY number maxY
zoomLevel number zoom level
Overrides:
Source:

refresh()

trick to refresh the layer
Inherited From:
Source: