tangrams / tangram

WebGL map rendering engine for creative cartography
https://tangram.city
MIT License
2.22k stars 290 forks source link

Add optional pixel radius for feature selection #571

Closed bcamper closed 7 years ago

bcamper commented 7 years ago

This PR adds an optional pixel radius when requesting features at/near a pixel location. Previously, feature selection only returned a feature at the exact pixel location provided, but there are common use cases where a larger radius is useful, such as:

The following methods are affected:

In all cases, radius or selectionRadius is an optional value in pixels (default matches existing behavior, where radius is zero). When using a radius, the feature closest to the center point will be returned. (As with existing feature selection, only features marked as interactive: true will register.)

bcamper commented 7 years ago

Released in v0.13.0