maps.nyc.gov

Class: LayerPicker

(abstract) nyc.ol.control.LayerPicker(options)

(abstract) new LayerPicker(options)

Class that provides layer a picker
Parameters:
Name Type Description
options nyc.ol.control.LayerPicker.Options Constructor options
Mixes In:
Source:

Extends

Members

controls :Array.<nyc.Choice>

The layer picker controls
Type:
Source:

layerGroups :Array.<nyc.ol.control.LayerPicker.LayerGroup>

The layer groups displayed on the picker
Type:
Source:

map :ol.Map

The map from which layers can be picked
Type:
  • ol.Map
Source:

Methods

(abstract) getButtonHtml() → {string}

Provides an HTML string for creating a menu actuator when a DOM target is not provided to the constructor
Source:
Returns:
Type
string

(abstract) getLayerGoupsFromMap(map) → {Array.<nyc.ol.control.LayerPicker.LayerGroup>}

Provides layer groups from the map when they are not provided to the constructor
Parameters:
Name Type Description
map ol.Map
Source:
Returns:
Type
Array.<nyc.ol.control.LayerPicker.LayerGroup>

(abstract) getLayers() → {Object.<string, ol.layer.Base>}

Return a map of layers by name
Source:
Returns:
Type
Object.<string, ol.layer.Base>

(abstract) getMenuClass() → {string}

Provides an HTML DOM element class for menu creation when a DOM target is not provided to the constructor
Source:
Returns:
Type
string

(abstract) loadedGroup(control, group, layers)

Provides notification that layers form a group namespace have been added
Parameters:
Name Type Description
control nyc.Choice
group Object
layers Array.<ol.layer.Base>
Source:

Type Definitions

LayerGroup

Type:
  • Object
Properties:
Name Type Attributes Default Description
name string The group name
layers Array.<ol.layer.Base> | nyc.ol.control.LayerPicker.LayerGroupNamespace The layers (layers should have a name property)
singleSelect boolean <optional>
false Only one layer per group can be visible at a time
expanded boolean <optional>
false The group starting display state
Source:

LayerGroupNamespace

Layer group namespace for nyc.ol.control.LayerPicker.LayerGroup
Type:
  • Object
Properties:
Name Type Attributes Description
name string The group name
namespace Object | string A layer group namespace
url string <optional>
The URL to the layer group JavaScript
Source:

Options

Constructor options for nyc.ol.control.LayerPicker
Type:
  • Object
Properties:
Name Type Attributes Description
map ol.Map The map containing layers to manage
target Element | JQuery | string The target DOM node for creating the layer manager
layerGroups Array.<nyc.ol.control.LayerPicker.LayerGroup> <optional>
Grouped layers to manage (default is all map layers with a name property)
Source:

nyc-lib: Class: LayerPicker

maps.nyc.gov

Class: LayerPicker

(abstract) nyc.ol.control.LayerPicker(options)

(abstract) new LayerPicker(options)

Class that provides layer a picker
Parameters:
Name Type Description
options nyc.ol.control.LayerPicker.Options Constructor options
Mixes In:
Source:

Extends

Members

controls :Array.<nyc.Choice>

The layer picker controls
Type:
Source:

layerGroups :Array.<nyc.ol.control.LayerPicker.LayerGroup>

The layer groups displayed on the picker
Type:
Source:

map :ol.Map

The map from which layers can be picked
Type:
  • ol.Map
Source:

Methods

(abstract) getButtonHtml() → {string}

Provides an HTML string for creating a menu actuator when a DOM target is not provided to the constructor
Source:
Returns:
Type
string

(abstract) getLayerGoupsFromMap(map) → {Array.<nyc.ol.control.LayerPicker.LayerGroup>}

Provides layer groups from the map when they are not provided to the constructor
Parameters:
Name Type Description
map ol.Map
Source:
Returns:
Type
Array.<nyc.ol.control.LayerPicker.LayerGroup>

(abstract) getLayers() → {Object.<string, ol.layer.Base>}

Return a map of layers by name
Source:
Returns:
Type
Object.<string, ol.layer.Base>

(abstract) getMenuClass() → {string}

Provides an HTML DOM element class for menu creation when a DOM target is not provided to the constructor
Source:
Returns:
Type
string

(abstract) loadedGroup(control, group, layers)

Provides notification that layers form a group namespace have been added
Parameters:
Name Type Description
control nyc.Choice
group Object
layers Array.<ol.layer.Base>
Source:

Type Definitions

LayerGroup

Type:
  • Object
Properties:
Name Type Attributes Default Description
name string The group name
layers Array.<ol.layer.Base> | nyc.ol.control.LayerPicker.LayerGroupNamespace The layers (layers should have a name property)
singleSelect boolean <optional>
false Only one layer per group can be visible at a time
expanded boolean <optional>
false The group starting display state
Source:

LayerGroupNamespace

Layer group namespace for nyc.ol.control.LayerPicker.LayerGroup
Type:
  • Object
Properties:
Name Type Attributes Description
name string The group name
namespace Object | string A layer group namespace
url string <optional>
The URL to the layer group JavaScript
Source:

Options

Constructor options for nyc.ol.control.LayerPicker
Type:
  • Object
Properties:
Name Type Attributes Description
map ol.Map The map containing layers to manage
target Element | JQuery | string The target DOM node for creating the layer manager
layerGroups Array.<nyc.ol.control.LayerPicker.LayerGroup> <optional>
Grouped layers to manage (default is all map layers with a name property)
Source: