Mapbox-gl-js: Rename `layer` option to `layers` for featuresIn/At requests

Created on 8 Mar 2016  路  5Comments  路  Source: mapbox/mapbox-gl-js

I've seen this come up a couple times where someone has typed layers instead of layer in the property options for featuresAt or featuresIn requests. If the typo is not caught the effect is elusive (_appears_ to sort of work as the layer you want is captured in the request but buggy as it captures others)

Propose:

  • layer continues to accept a single string value or an array of strings
  • layers accepts an array of strings
feature

Most helpful comment

I agree with @tmcw.

All 5 comments

someone

:+1: I've done this many times.

:-1: rename to layers, require an array of strings as an argument. One true way.

I agree with @tmcw.

Agree with one true way, though should we continue to support the singular form, to avoid a breaking change?

Let's support an array-valued layers property only, as part of #2052 / #2224, which are already breaking changes.

cc @ansis

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rasagy picture rasagy  路  3Comments

rigoneri picture rigoneri  路  3Comments

infacq picture infacq  路  3Comments

BernhardRode picture BernhardRode  路  3Comments

PBrockmann picture PBrockmann  路  3Comments