0

I'm trying to only draw contour lines at every 30m of elevation. In mapbox studio this is pretty easy to do using the regex:

[ele =~ '.*30'] ...

Now I'm trying to do this using Mapbox GL which uses JSON, and I can't find any documentation on doing this.

{ 
"id": "contour_line_30s_over_2000m", 
"type": "line", 
"source": "mapbox", 
"source-layer": "contour", 
"filter": [">", "ele", 2000], //only show elevations over 2000m
"paint": { "line-color": "@contour_line_color" } 
}

What is the proper syntax for doing this? Thanks!

cdubbs
  • 97
  • 12

1 Answers1

0

Mapbox GL styles don't currently support using regular expressions in filters. See this issue for the feature request.

John
  • 29,546
  • 11
  • 78
  • 79