Filter is prohibited by validation(fix1)
/mapbox-gl-js/issues/7730
by Leo
HTML
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.51.0/mapbox-gl.js"></script>
<link rel="stylesheet" href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.51.0/mapbox-gl.css">
<div id='map'></div>
CSS
#map { position:absolute; top:0; bottom:0; width:100%; }
#setFilterBtn { position:absolute; top:0; right:0;}
#clearFilterBtn { position:absolute; top:0; right:100px;}
JavaScript
var map = new mapboxgl.Map({
container: 'map',
zoom: 13,
center: [-122.447303, 37.753574],
style: {
version: 8,
sources: {
slippymap: {
type: "raster",
scheme: "xyz",
tiles: [
"https://a.tile.openstreetmap.org/{z}/{x}/{y}.png",
"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png",
"https://c.tile.openstreetmap.org/{z}/{x}/{y}.png"
],
tileSize: 256
},
d25uarhxywzl1j: {
type: "vector",
tiles: ["https://d25uarhxywzl1j.cloudfront.net/v0.1/{z}/{x}/{y}.mvt"],
tileSize: 512,
minzoom: 6,
maxzoom: 14
}
},
layers: [
{
id: "slippymap",
type: "raster",
source: "slippymap"
},
{
id: "mapillary",
type: "line",
source: "d25uarhxywzl1j",
"source-layer": "mapillary-sequences",
filter: ["all",
["==", ["geometry-type"],"LineString"],
["any",
["==","sp","_"],
["!",["has","sp"]]
]
],
layout: {
"line-cap": "round",
"line-join": "round"
},
paint: {
"line-opacity": 0.6,
"line-color": "rgb(53, 175, 109)",
"line-width": 2
}
}
]
}
});