本文整理汇总了C++中AnnotationIDs::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ AnnotationIDs::push_back方法的具体用法?C++ AnnotationIDs::push_back怎么用?C++ AnnotationIDs::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnnotationIDs
的用法示例。
在下文中一共展示了AnnotationIDs::push_back方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getPointAnnotationsInBounds
AnnotationIDs AnnotationManager::getPointAnnotationsInBounds(const LatLngBounds& bounds) const {
AnnotationIDs result;
pointTree.query(boost::geometry::index::intersects(bounds),
boost::make_function_output_iterator([&](const auto& val){
result.push_back(val->id);
}));
return result;
}
示例2: make_pair
std::pair<std::unordered_set<TileID, TileID::Hash>, AnnotationIDs>
AnnotationManager::addPointAnnotations(const std::vector<PointAnnotation>& points,
const uint8_t maxZoom) {
// We pre-generate tiles to contain each annotation up to the map's max zoom.
// We do this for fast rendering without projection conversions on the fly, as well as
// to simplify bounding box queries of annotations later. Tiles get invalidated when
// annotations are added or removed in order to refresh the map render without
// touching the base map underneath.
AnnotationIDs annotationIDs;
annotationIDs.reserve(points.size());
std::unordered_set<TileID, TileID::Hash> affectedTiles;
for (const PointAnnotation& point : points) {
// projection conversion into unit space
const auto pp = projectPoint(point.position);
const uint32_t pointAnnotationID = nextID();
// at render time we style the point according to its {sprite} field
std::unordered_map<std::string, std::string> pointFeatureProperties;
if (point.icon.length()) {
pointFeatureProperties.emplace("sprite", point.icon);
}
if (point.text.length()) {
pointFeatureProperties.emplace("marker-text", point.text);
} else {
pointFeatureProperties.emplace("sprite", defaultPointAnnotationSymbol);
}
if (point.type.length()) {
pointFeatureProperties.emplace("type", point.type);
}
// add individual point tile feature
auto featureAffectedTiles = addTileFeature(
pointAnnotationID,
AnnotationSegments({{ point.position }}),
std::vector<std::vector<vec2<double>>>({{ pp }}),
AnnotationType::Point,
{{ }},
pointFeatureProperties,
"",
maxZoom
);
std::copy(featureAffectedTiles.begin(), featureAffectedTiles.end(), std::inserter(affectedTiles, affectedTiles.begin()));
annotationIDs.push_back(pointAnnotationID);
}
// Tile:IDs that need refreshed and the annotation identifiers held onto by the client.
return std::make_pair(affectedTiles, annotationIDs);
}
示例3:
AnnotationIDs
AnnotationManager::addShapeAnnotations(const std::vector<ShapeAnnotation>& shapes, const uint8_t maxZoom) {
AnnotationIDs annotationIDs;
annotationIDs.reserve(shapes.size());
for (const auto& shape : shapes) {
const uint32_t annotationID = nextID++;
shapeAnnotations.emplace(annotationID,
std::make_unique<ShapeAnnotationImpl>(annotationID, shape, maxZoom));
annotationIDs.push_back(annotationID);
}
return annotationIDs;
}