maps.nyc.gov

Class: GetFeature

nyc.ol.geoserver.GetFeature(options)

new GetFeature(options)

A class to retrieve the feature of the specified layer at a map click and provide a WKT representation of its geometry
Parameters:
Name Type Description
options nyc.ol.geoserver.GetFeature.Options Constructor options
Source:
See:
Fires:

Extends

Members

(static) BufferUnits :string

Buffer units to use when getting a feature at a map click
Type:
  • string
Properties:
Name Type Description
FEET string Feet
METERS string Meters
MILES string Statute miles
NAUTICAL_MILES string Nautical miles
KILOMETERS string Kilometers
Source:

Methods

activate()

Activate to begin capturing map clicks
Source:

callback(data)

The callback that handles GeoServer WFS GetFeature responses
Parameters:
Name Type Description
data Object The GeoServer WFS GetFeature response
Source:

clear()

Remove all captured features
Source:

deactivate()

Deactivate to stop capturing map clicks
Source:

getFeatures() → {Array.<nyc.ol.Feature>}

Get the features that have been captured
Source:
Returns:
The features
Type
Array.<nyc.ol.Feature>

off(eventName, evtHdlr, hdlrScopeopt)

Remove a previously connected event handler
Parameters:
Name Type Attributes Description
eventName string The name of the event to which the handler will be connected
evtHdlr function The event handler function
hdlrScope Object <optional>
The scope in which to invoke the event handler
Inherited From:
Source:

on(eventName, evtHdlr, hdlrScopeopt)

Connect a function to an event
Parameters:
Name Type Attributes Description
eventName string The name of the event to which the handler will be connected
evtHdlr function The event handler function
hdlrScope Object <optional>
The scope in which to invoke the event handler
Inherited From:
Source:

one(eventName, evtHdlr, hdlrScopeopt)

Connect a function to an event for a single invocation
Parameters:
Name Type Attributes Description
eventName string The name of the event to which the handler will be connected
evtHdlr function The event handler function
hdlrScope Object <optional>
The scope in which to invoke the event handler
Inherited From:
Source:

toggleActive()

Toggle active state
Source:

trigger(eventName, dataopt)

Trigger a named event with event data
Parameters:
Name Type Attributes Description
eventName string The name of the event to trigger
data Object <optional>
The event data
Inherited From:
Source:

Type Definitions

Options

Object type to hold constructor options for nyc.ol.geoserver.GetFeature
Type:
  • Object
Properties:
Name Type Attributes Default Description
map ol.Map The OpenLayers map with which the user will interact
wfsUrl string A GeoServer WFS URL (i.e. http://localhost/geoserver/wfs)
namespace string The namespace of the layer from which to retrieve features
typeName string The type name of the layer from which to retrieve features
geomColumn string The name of the layer's geometry column that will be queried
projection string <optional>
EPSG:3857 The projection of the layer
propertyNames Array.<string> <optional>
The property names of the layer to retrieve with the features
buffer number <optional>
25 The buffer radius to use around the map click when querying the layer
units nyc.ol.geoserver.GetFeature.BufferUnits <optional>
feet The units of the buffer
style ol.style.Style <optional>
The style to use for features added to the map
Source:

Events

addfeature

The added feature
Type:
  • nyc.ol.FeatureEvent
Source:

removefeature

The removed feature
Type:
  • nyc.ol.FeatureEvent
Source:

nyc-lib: Class: GetFeature

maps.nyc.gov

Class: GetFeature

nyc.ol.geoserver.GetFeature(options)

new GetFeature(options)

A class to retrieve the feature of the specified layer at a map click and provide a WKT representation of its geometry
Parameters:
Name Type Description
options nyc.ol.geoserver.GetFeature.Options Constructor options
Source:
See:
Fires:

Extends

Members

(static) BufferUnits :string

Buffer units to use when getting a feature at a map click
Type:
  • string
Properties:
Name Type Description
FEET string Feet
METERS string Meters
MILES string Statute miles
NAUTICAL_MILES string Nautical miles
KILOMETERS string Kilometers
Source:

Methods

activate()

Activate to begin capturing map clicks
Source:

callback(data)

The callback that handles GeoServer WFS GetFeature responses
Parameters:
Name Type Description
data Object The GeoServer WFS GetFeature response
Source:

clear()

Remove all captured features
Source:

deactivate()

Deactivate to stop capturing map clicks
Source:

getFeatures() → {Array.<nyc.ol.Feature>}

Get the features that have been captured
Source:
Returns:
The features
Type
Array.<nyc.ol.Feature>

off(eventName, evtHdlr, hdlrScopeopt)

Remove a previously connected event handler
Parameters:
Name Type Attributes Description
eventName string The name of the event to which the handler will be connected
evtHdlr function The event handler function
hdlrScope Object <optional>
The scope in which to invoke the event handler
Inherited From:
Source:

on(eventName, evtHdlr, hdlrScopeopt)

Connect a function to an event
Parameters:
Name Type Attributes Description
eventName string The name of the event to which the handler will be connected
evtHdlr function The event handler function
hdlrScope Object <optional>
The scope in which to invoke the event handler
Inherited From:
Source:

one(eventName, evtHdlr, hdlrScopeopt)

Connect a function to an event for a single invocation
Parameters:
Name Type Attributes Description
eventName string The name of the event to which the handler will be connected
evtHdlr function The event handler function
hdlrScope Object <optional>
The scope in which to invoke the event handler
Inherited From:
Source:

toggleActive()

Toggle active state
Source:

trigger(eventName, dataopt)

Trigger a named event with event data
Parameters:
Name Type Attributes Description
eventName string The name of the event to trigger
data Object <optional>
The event data
Inherited From:
Source:

Type Definitions

Options

Object type to hold constructor options for nyc.ol.geoserver.GetFeature
Type:
  • Object
Properties:
Name Type Attributes Default Description
map ol.Map The OpenLayers map with which the user will interact
wfsUrl string A GeoServer WFS URL (i.e. http://localhost/geoserver/wfs)
namespace string The namespace of the layer from which to retrieve features
typeName string The type name of the layer from which to retrieve features
geomColumn string The name of the layer's geometry column that will be queried
projection string <optional>
EPSG:3857 The projection of the layer
propertyNames Array.<string> <optional>
The property names of the layer to retrieve with the features
buffer number <optional>
25 The buffer radius to use around the map click when querying the layer
units nyc.ol.geoserver.GetFeature.BufferUnits <optional>
feet The units of the buffer
style ol.style.Style <optional>
The style to use for features added to the map
Source:

Events

addfeature

The added feature
Type:
  • nyc.ol.FeatureEvent
Source:

removefeature

The removed feature
Type:
  • nyc.ol.FeatureEvent
Source: