[core] Add support for $id key to filters

https://github.com/mapbox/mapbox-gl-style-spec/issues/391
This commit is contained in:
John Firebaugh
2016-07-15 16:07:42 -07:00
parent b03471bc8d
commit da35ef9f49
9 changed files with 116 additions and 85 deletions

View File

@@ -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);

View File

@@ -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;

View File

@@ -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);
}