diff options
Diffstat (limited to 'platform/glfw/glfw_view.cpp')
-rw-r--r-- | platform/glfw/glfw_view.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp index d3a6347110..29cd0dd7c3 100644 --- a/platform/glfw/glfw_view.cpp +++ b/platform/glfw/glfw_view.cpp @@ -131,7 +131,7 @@ GLFWView::~GLFWView() { void GLFWView::setMap(mbgl::Map *map_) { map = map_; - map->addAnnotationImage("default_marker", makeImage(22, 22, 1)); + map->addAnnotationImage(makeImage("default_marker", 22, 22, 1)); } void GLFWView::updateAssumedState() { @@ -255,7 +255,7 @@ mbgl::Point<double> GLFWView::makeRandomPoint() const { } std::unique_ptr<mbgl::style::Image> -GLFWView::makeImage(int width, int height, float pixelRatio) { +GLFWView::makeImage(const std::string& id, 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); @@ -280,7 +280,7 @@ GLFWView::makeImage(int width, int height, float pixelRatio) { } } - return std::make_unique<mbgl::style::Image>(std::move(image), pixelRatio); + return std::make_unique<mbgl::style::Image>(id, std::move(image), pixelRatio); } void GLFWView::nextOrientation() { @@ -297,7 +297,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->addAnnotationImage(name, makeImage(22, 22, 1)); + map->addAnnotationImage(makeImage(name, 22, 22, 1)); spriteIDs.push_back(name); annotationIDs.push_back(map->addAnnotation(mbgl::SymbolAnnotation { makeRandomPoint(), name })); } |