void TagEqualsSelector::matchWay(WayId wayID, const shared_ptr<TileIdentifier>& ti, RenderAttributes* attributes) const { Way* way = geodata->getWay(wayID); auto entry = way->getTags().find(tag); if (entry != way->getTags().end() && entry->second == value) { next->matchWay(wayID, ti, attributes); } }
void HasNotTagSelector::matchWay(WayId wayID, const shared_ptr<TileIdentifier>& ti, RenderAttributes* attributes) const { Way* way = geodata->getWay(wayID); auto entry = way->getTags().find(tag); if (entry == way->getTags().end() || entry->second == precached_no || entry->second == precached_false) { next->matchWay(wayID, ti, attributes); } }
void TagMatchesSelector::matchWay(WayId wayID, const shared_ptr<TileIdentifier>& ti, RenderAttributes* attributes) const { Way* way = geodata->getWay(wayID); auto entry = way->getTags().find(tag); if (entry != way->getTags().end()) { if (boost::regex_match(entry->second.str(), expression)) { next->matchWay(wayID, ti, attributes); } } }
void LineSelector::matchWay(WayId wayID, const shared_ptr<TileIdentifier>& ti, RenderAttributes* attributes) const { Way* way = geodata->getWay(wayID); auto& nodes = way->getNodeIDs(); // (area is open) or (area is set and area == no) if (nodes.front() != nodes.back()) { next->matchWay(wayID, ti, attributes); } else { auto entry = way->getTags().find(precached_area); if (entry != way->getTags().end() && entry->second == precached_no) { next->matchWay(wayID, ti, attributes); } } }
void HasTagSelector::matchWay(WayId wayID, const shared_ptr<TileIdentifier>& ti, RenderAttributes* attributes) const { Way* way = geodata->getWay(wayID); auto& map = way->getTags(); if (map.find(tag) != map.end()) { next->matchWay(wayID, ti, attributes); } }
void styleWays(const shared_ptr<std::vector<WayId> >& ids, RenderAttributes& attr) const { for (auto id : *ids) { Way* w = data->getWay(id); auto& tags = w->getTags(); auto name = tags.find(CachedString("name")); if (name != tags.end()) { auto style = styles.find(name->second); if (style != styles.end()) { Style* s = attr.getNewStyle(id); *s = style->second; } } } }