本文整理汇总了C++中AnnotationIDs类的典型用法代码示例。如果您正苦于以下问题:C++ AnnotationIDs类的具体用法?C++ AnnotationIDs怎么用?C++ AnnotationIDs使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AnnotationIDs类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: queryRenderedFeatures
AnnotationIDs Map::queryPointAnnotations(const ScreenBox& box) {
auto features = queryRenderedFeatures(box, {{ AnnotationManager::PointLayerID }});
std::set<AnnotationID> set;
for (auto &feature : features) {
assert(feature.id);
assert(*feature.id <= std::numeric_limits<AnnotationID>::max());
set.insert(static_cast<AnnotationID>(feature.id->get<uint64_t>()));
}
AnnotationIDs ids;
ids.reserve(set.size());
std::move(set.begin(), set.end(), std::back_inserter(ids));
return ids;
}
示例4:
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;
}
示例5: removeAnnotations
void QMapboxGL::removeAnnotations(const AnnotationIDs &annotationIDs)
{
std::vector<mbgl::AnnotationID> mbglAnnotationIds;
mbglAnnotationIds.reserve(annotationIDs.size());
for (const AnnotationID annotationID : annotationIDs) {
mbglAnnotationIds.emplace_back(annotationID);
}
d_ptr->mapObj->removeAnnotations(mbglAnnotationIds);
}