mapbox / mapbox-gl-style-spec

76 stars 38 forks source link

Cannot filter properties beginning with '@' #654

Closed planemad closed 7 years ago

planemad commented 7 years ago

A Mapbox tileset generated with data exported from OSM overpass has the metadata properties prefixed with @ eg. @id, @user. While trying to filter this property, I get the following error:

map.setFilter("countries-layer-highlight", ["==", "@id","India" ])
evented.js:91 Error: layers.countries-layer-highlight.filter[1]: filter key cannot be a constant
    at Function.module.exports.emitErrors (validate_style.js:8)
    at t._validate (style.js:807)
    at t.setFilter (style.js:585)
    at e.setFilter (map.js:849)
    at <anonymous>:1:5

Is there a workaround to this apart from renaming the property in my tileset?

mourner commented 7 years ago

Probably no workaround — we'll have to remove that check in the style-spec validator (here). It was relevant when the spec had the concept of constants, but no longer.

ImreSamu commented 7 years ago

same problem with: Mapbox OSM QA TILES (@version @user ... )