Files
openlayers/examples/select-features.html
2015-11-01 02:18:09 -07:00

27 lines
1.5 KiB
HTML

---
layout: example.html
title: Select features example
shortdesc: Example of using the Select interaction.
docs: >
Choose between <code>Single-click</code>, <code>Click</code>, <code>Hover</code> and <code>Alt+Click</code> as the event type for selection in the combobox below. When using <code>Single-click</code> or <code>Click</code> you can hold do <code>Shift</code> key to toggle the feature in the selection.</p>
<p>Note: when <code>Single-click</code> is used double-clicks won't select features. This in contrast to <code>Click</code>, where a double-click will both select the feature and zoom the map (because of the <code>DoubleClickZoom</code> interaction). Note that <code>Single-click</code> is less responsive than <code>Click</code> because of the delay it uses to detect double-clicks.</p>
<p>In this example, a listener is registered for the Select interaction's <code>select</code> event in order to update the selection status below.
<form class="form-inline">
<label>Action type &nbsp;</label>
<select id="type" class="form-control">
<option value="none" selected>None</option>
<option value="singleclick">Single-click</option>
<option value="click">Click</option>
<option value="pointermove">Hover</option>
<option value="altclick">Alt+Click</option>
</select>
<span id="status">&nbsp;0 selected features</span>
</form>
tags: "select, vector"
---
<div class="row-fluid">
<div class="span12">
<div id="map" class="map"></div>
</div>
</div>