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
country_code_iso3166_1_alpha_2 tag.
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:
https://taginfo.openstreetmap.org/tags/?key=country_code_iso3166_1_alpha_2&value=FR
https://www.openstreetmap.org/node/1363947712

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:
https://gist.github.com/pathmapper/6b3b8955454b9bc69452493c06a72b0c#file-filter-json
Sample geometry used for this filter:
https://gist.github.com/pathmapper/6b3b8955454b9bc69452493c06a72b0c#file-polygon-geojson
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:
https://codesandbox.io/s/keen-panini-7yesf
https://7yesf.sse.codesandbox.io
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:
https://gist.github.com/pathmapper/6b3b8955454b9bc69452493c06a72b0c#file-filter_only_within-json