I am trying to use the extended worldview for my MapBox maps.
I already have custom styles and trying to set filters to the map for various world views like US, CH, IN and JP, but when I do this it works incorrect and just cuts out the borders.
In other words, when I use setFilter for admin-0-boundary-disputed, admin-0-boundary and admin-0-boundary-bg for IN I don’t see the borders, they are just cropped out.
At first I was thinking that these values have the same color as the countries backgrounds and tried to update it to red / blue / green, but the issue didn’t go away.
this is the code I am using:
map.setFilter('admin-0-boundary-disputed', [
"all",
["==", ["get", "disputed"], "true"],
["==", ["get", "admin_level"], 0],
["==", ["get", "maritime"], "false"],
["match", ["get", "worldview"], ["all", "IN"], true, false]
]);
map.setFilter('admin-0-boundary', [
"all",
["==", ["get", "admin_level"], 0],
["==", ["get", "disputed"], "false"],
["==", ["get", "maritime"], "false"],
["match", ["get", "worldview"], ["all", "IN"], true, false]
]);
map.setFilter('admin-0-boundary-bg', [
"all",
["==", ["get", "admin_level"], 0],
["==", ["get", "maritime"], "false"],
["match", ["get", "worldview"], ["all", "IN"], true, false]
]);
and these are my styles from the mapbox styles for these particular fields:
admin-0-boundary-disputed:
{
"minzoom": 1,
"layout": { "line-join": "round" },
"metadata": {
"mapbox:featureComponent": "admin-boundaries",
"mapbox:group": "Administrative boundaries, admin"
},
"filter": [
"all",
["==", ["get", "disputed"], "true"],
["==", ["get", "admin_level"], 0],
["==", ["get", "maritime"], "false"],
["match", ["get", "worldview"], ["all", "IN"], true, false]
],
"type": "line",
"source": "composite",
"id": "admin-0-boundary-disputed",
"paint": {
"line-color": "hsl(102, 100%, 49%)",
"line-width": ["interpolate", ["linear"], ["zoom"], 3, 0.95, 10, 3.8],
"line-dasharray": [
"step",
["zoom"],
["literal", [3.25, 3.25]],
6,
["literal", [2.5, 2.5]],
7,
["literal", [2, 2.25]],
8,
["literal", [1.75, 2]]
]
},
"source-layer": "admin"
},
admin-0-boundary-bg:
{
"minzoom": 1,
"layout": {},
"metadata": {
"mapbox:featureComponent": "admin-boundaries",
"mapbox:group": "Administrative boundaries, admin"
},
"filter": [
"all",
["==", ["get", "admin_level"], 0],
["==", ["get", "maritime"], "false"],
["match", ["get", "worldview"], ["all", "IN"], true, false]
],
"type": "line",
"source": "composite",
"id": "admin-0-boundary-bg",
"paint": {
"line-width": [
"interpolate",
["linear"],
["zoom"],
3,
6.6499999999999995,
10,
15.2
],
"line-color": [
"interpolate",
["linear"],
["zoom"],
0,
"hsl(0, 0%, 51%)",
22,
"hsl(0, 0%, 51%)"
],
"line-opacity": ["interpolate", ["linear"], ["zoom"], 3, 0, 4, 0.5],
"line-translate": [0, 0],
"line-blur": ["interpolate", ["linear"], ["zoom"], 3, 0, 10, 3.8]
},
"source-layer": "admin"
},
admin-0-boundary:
{
"minzoom": 1,
"layout": { "line-join": "round", "line-cap": "round" },
"metadata": {
"mapbox:featureComponent": "admin-boundaries",
"mapbox:group": "Administrative boundaries, admin"
},
"filter": [
"all",
["==", ["get", "admin_level"], 0],
["==", ["get", "disputed"], "false"],
["==", ["get", "maritime"], "false"],
["match", ["get", "worldview"], ["all", "IN"], true, false]
],
"type": "line",
"source": "composite",
"id": "admin-0-boundary",
"paint": {
"line-color": "hsl(188, 98%, 49%)",
"line-width": ["interpolate", ["linear"], ["zoom"], 3, 0.95, 10, 3.8],
"line-dasharray": [10, 0]
},
"source-layer": "admin"
},