[core] Custom layers

This commit is contained in:
John Firebaugh
2015-12-08 14:30:42 -08:00
parent 0346cfd865
commit bde07c8f0e
17 changed files with 274 additions and 56 deletions

View File

@@ -7,6 +7,7 @@
#include <mbgl/map/map_data.hpp>
#include <mbgl/annotation/point_annotation.hpp>
#include <mbgl/annotation/shape_annotation.hpp>
#include <mbgl/style/style_layer.hpp>
#include <mbgl/util/projection.hpp>
#include <mbgl/util/thread.hpp>
@@ -415,6 +416,16 @@ AnnotationIDs Map::getPointAnnotationsInBounds(const LatLngBounds& bounds) {
LatLngBounds Map::getBoundsForAnnotations(const AnnotationIDs& annotations) {
return data->getAnnotationManager()->getBoundsForAnnotations(annotations);
}
#pragma mark - Style API
void Map::addLayer(std::unique_ptr<StyleLayer> layer) {
context->invoke(&MapContext::addLayer, std::move(layer), mapbox::util::optional<std::string>());
}
void Map::addLayer(std::unique_ptr<StyleLayer> layer, const std::string& before) {
context->invoke(&MapContext::addLayer, std::move(layer), before);
}
#pragma mark - Toggles