In general your filter is fine (there's a missing bracket
] to close the array), but the filter doesn't give the result you want because there is only one feature with the
iso_a2 property for whole France in the source vector tiles (OpenMapTiles).
As stated in the OpenMapTiles docs, the
iso_a2 property is a
Two-letter country code ISO 3166-1 alpha-2. Original value of the
https://wiki.openstreetmap.org/wiki/Tag:place%3Dcountry states that this tag is useful but currently not part of map features.
In fact there is only one feature available in OSM with
country_code_iso3166_1_alpha_2=FR and only this feature with
class=country is available for filtering:
However, if you want to show labels only for one country, you could try to use a filter with the within expression and a GeoJSON of the country geometry.
Here es an example how such a filter would look like:
Sample geometry used for this filter:
Please note that this filter is currently not working with https://maputnik.github.io/editor because the GL JS version used for Maputnik
v1.7.0 has a bug with nested within expressions in filters.
If you don't want to wait for the next release (
v1.8.0) of Maputnik to try the filter out, you could build Maputnik yourself from
master or use this codesandbox:
Here is also a filter which uses only a within exression so this one works with Maputnik
v1.7.0 which is currently available on https://maputnik.github.io/editor: