diff options
Diffstat (limited to 'platform/glfw/glfw_view.cpp')
-rw-r--r-- | platform/glfw/glfw_view.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp index 5e9083f503..f4ade26885 100644 --- a/platform/glfw/glfw_view.cpp +++ b/platform/glfw/glfw_view.cpp @@ -1,7 +1,7 @@ #include "glfw_view.hpp" #include <mbgl/annotation/annotation.hpp> -#include <mbgl/sprite/sprite_image.hpp> +#include <mbgl/style/image.hpp> #include <mbgl/style/transition_options.hpp> #include <mbgl/util/logging.hpp> #include <mbgl/util/platform.hpp> @@ -124,7 +124,7 @@ GLFWView::~GLFWView() { void GLFWView::setMap(mbgl::Map *map_) { map = map_; - map->addAnnotationIcon("default_marker", makeSpriteImage(22, 22, 1)); + map->addAnnotationImage("default_marker", makeImage(22, 22, 1)); } void GLFWView::updateAssumedState() { @@ -258,8 +258,8 @@ mbgl::Point<double> GLFWView::makeRandomPoint() const { return { latLng.longitude(), latLng.latitude() }; } -std::shared_ptr<const mbgl::SpriteImage> -GLFWView::makeSpriteImage(int width, int height, float pixelRatio) { +std::unique_ptr<mbgl::style::Image> +GLFWView::makeImage(int width, int height, float pixelRatio) { const int r = 255 * (double(std::rand()) / RAND_MAX); const int g = 255 * (double(std::rand()) / RAND_MAX); const int b = 255 * (double(std::rand()) / RAND_MAX); @@ -284,7 +284,7 @@ GLFWView::makeSpriteImage(int width, int height, float pixelRatio) { } } - return std::make_shared<mbgl::SpriteImage>(std::move(image), pixelRatio); + return std::make_unique<mbgl::style::Image>(std::move(image), pixelRatio); } void GLFWView::nextOrientation() { @@ -301,7 +301,7 @@ void GLFWView::addRandomCustomPointAnnotations(int count) { for (int i = 0; i < count; i++) { static int spriteID = 1; const auto name = std::string{ "marker-" } + mbgl::util::toString(spriteID++); - map->addAnnotationIcon(name, makeSpriteImage(22, 22, 1)); + map->addAnnotationImage(name, makeImage(22, 22, 1)); spriteIDs.push_back(name); annotationIDs.push_back(map->addAnnotation(mbgl::SymbolAnnotation { makeRandomPoint(), name })); } |