PointQuery

ol-ishare/interaction/PointQuery~ PointQuery

Returns location and iShare Layer features at a point specified by a click

Constructor

new PointQuery(opt_options)

PointQuery interaction

Parameters:
Name Type Description
opt_options Object

Interaction options

Properties
Name Type Description
markPoint Boolean

Mark position of point queried on the map

markerStyle ol/style/Style

OpenLayers Style object for marker

markerPersist Boolean

Whether the marker remains on the map until another query is made or PointQuery.clearMarker() is called

queryLayers Array.<String>

Only query the layers in this list

overLayer ol/layer/Vector

The layer on which the query point marker should be drawn

Methods

handleEvent(mapBrowserEvent) → {boolean}

Handles the map browser event (if it was a singleclick) and requests info. Generally not called by user code.

This:
Parameters:
Name Type Description
mapBrowserEvent ol/MapBrowserEvent

Map browser event.

Returns:

false to stop event propagation.

Type
boolean

setMap(map)

Remove the interaction from its current map and attach it to the new map.

Parameters:
Name Type Description
map ol/PluggableMap

Map.

setActive(active)

Activate or deactivate the interaction.

Parameters:
Name Type Description
active boolean

Active.

resultHandler(map, errors, infoLayers, featureCollections, coordinates)

Dispatches Event with query results and/or errors

Parameters:
Name Type Description
map ol/Map~Map

Map instance against which the query has been performed

errors Array.<(Error|null)>

Array containing either null (no error) or Error instance for each infoLayer (in the same order as infoLayers)

infoLayers Array.<ol/layer/Layer~Layer>

Layers that have been queried

featureCollections Array.<FeatureCollection>

OpenLayers FeatureCollections

coordinates Array.<Float>

Location queried

requestInfo(map, coordinates)

Requests info for all layers marked as displaying info and calls handleResponse when complete

Parameters:
Name Type Description
map ol/Map~Map

Map instance to query

coordinates Array.<Float>

Location to query

clearMarker()

Clean up current displayed marker