summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2015-11-19 16:07:15 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-11-30 12:40:09 -0800
commit12fc9490065e1ddc2fada269a045cd2725a257f5 (patch)
tree17a91e9e04bf0f8b5241911ca776a17d9ae74b88 /platform
parent48504baa9134020c57bb899f290557b4249a2d6d (diff)
downloadqtlocation-mapboxgl-12fc9490065e1ddc2fada269a045cd2725a257f5.tar.gz
[tests] Don't use icons from the style for annotations
Diffstat (limited to 'platform')
-rw-r--r--platform/default/glfw_view.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp
index 4e00722e21..48e9386fc7 100644
--- a/platform/default/glfw_view.cpp
+++ b/platform/default/glfw_view.cpp
@@ -117,6 +117,13 @@ void GLFWView::initialize(mbgl::Map *map_) {
View::initialize(map_);
}
+void GLFWView::notifyMapChange(mbgl::MapChange change) {
+ if (change == mbgl::MapChange::MapChangeDidFinishLoadingMap && !initializedDefaultMarker) {
+ initializedDefaultMarker = true;
+ map->setSprite("default_marker", makeSpriteImage(22, 22, 1));
+ }
+}
+
void GLFWView::onKey(GLFWwindow *window, int key, int /*scancode*/, int action, int mods) {
GLFWView *view = reinterpret_cast<GLFWView *>(glfwGetWindowUserPointer(window));
@@ -234,7 +241,7 @@ void GLFWView::addRandomPointAnnotations(int count) {
std::vector<mbgl::PointAnnotation> points;
for (int i = 0; i < count; i++) {
- points.emplace_back(makeRandomPoint(), "marker-15");
+ points.emplace_back(makeRandomPoint(), "default_marker");
}
auto newIDs = map->addPointAnnotations(points);