[core] Add support for $id key to filters
https://github.com/mapbox/mapbox-gl-style-spec/issues/391
This commit is contained in:
@@ -24,7 +24,7 @@ void ShapeAnnotationImpl::updateTileData(const CanonicalTileID& tileID, Annotati
|
||||
if (!shapeTiler) {
|
||||
mapbox::geometry::feature_collection<double> features;
|
||||
features.emplace_back(ShapeAnnotationGeometry::visit(geometry(), [] (auto&& geom) {
|
||||
return Feature(std::move(geom));
|
||||
return Feature { std::move(geom) };
|
||||
}));
|
||||
mapbox::geojsonvt::Options options;
|
||||
options.maxZoom = util::clamp<uint8_t>(maxZoom, 0, 18);
|
||||
|
||||
@@ -119,7 +119,7 @@ void SymbolBucket::parseFeatures(const GeometryTileLayer& layer, const Filter& f
|
||||
const GLsizei featureCount = static_cast<GLsizei>(layer.featureCount());
|
||||
for (GLsizei i = 0; i < featureCount; i++) {
|
||||
auto feature = layer.getFeature(i);
|
||||
if (!filter(feature->getType(), [&] (const auto& key) { return feature->getValue(key); }))
|
||||
if (!filter(feature->getType(), feature->getID(), [&] (const auto& key) { return feature->getValue(key); }))
|
||||
continue;
|
||||
|
||||
SymbolFeature ft;
|
||||
|
||||
@@ -10,7 +10,7 @@ void BucketParameters::eachFilteredFeature(const Filter& filter,
|
||||
auto name = layer.getName();
|
||||
for (std::size_t i = 0; !cancelled() && i < layer.featureCount(); i++) {
|
||||
auto feature = layer.getFeature(i);
|
||||
if (!filter(feature->getType(), [&] (const auto& key) { return feature->getValue(key); }))
|
||||
if (!filter(feature->getType(), feature->getID(), [&] (const auto& key) { return feature->getValue(key); }))
|
||||
continue;
|
||||
function(*feature, i, name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user