Ejemplo n.º 1
0
void GLFWView::addRandomCustomPointAnnotations(int count) {
    std::vector<mbgl::PointAnnotation> points;

    for (int i = 0; i < count; i++) {
        static int spriteID = 1;
        const auto name = std::string{ "marker-" } + mbgl::util::toString(spriteID++);
        map->setSprite(name, makeSpriteImage(22, 22, 1));
        spriteIDs.push_back(name);
        points.emplace_back(makeRandomPoint(), name);
    }

    auto newIDs = map->addPointAnnotations(points);
    annotationIDs.insert(annotationIDs.end(), newIDs.begin(), newIDs.end());
}
Ejemplo n.º 2
0
void GLFWView::notifyMapChange(mbgl::MapChange change) {
    if (change == mbgl::MapChange::MapChangeDidFinishLoadingMap && !initializedDefaultMarker) {
        initializedDefaultMarker = true;
        map->setSprite("default_marker", makeSpriteImage(22, 22, 1));
    }
}
Ejemplo n.º 3
0
void GLFWView::initialize(mbgl::Map *map_) {
    View::initialize(map_);
    map->addAnnotationIcon("default_marker", makeSpriteImage(22, 22, 1));
}