summaryrefslogtreecommitdiff
path: root/platform/glfw/glfw_view.cpp
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.deoliveira@mapbox.com>2019-11-04 08:12:23 +0200
committerAnder Conselvan de Oliveira <ander.deoliveira@mapbox.com>2019-11-13 13:31:01 +0200
commit4c1d03c257754ecc1555f3e31b3c6ccf45c4bf7b (patch)
treed6bd914727d337216e269b08b139a87bca7f41d4 /platform/glfw/glfw_view.cpp
parent089ff8e2b34583de6c989c05a0771b108b3c82f0 (diff)
downloadqtlocation-mapboxgl-4c1d03c257754ecc1555f3e31b3c6ccf45c4bf7b.tar.gz
[core] Fix MapSnapshotter build failure on Windows
MSVC implementation of std::promise is buggy and only works with types that can be default-constructed. To avoid a compilation failure in the instantiation of ask() inside MapSnapshotter::getRegion(), which creates a std::promise<LanLngBounds>, make LatLngBounds' default constructor public.
Diffstat (limited to 'platform/glfw/glfw_view.cpp')
-rw-r--r--platform/glfw/glfw_view.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp
index c39b2c904a..9a2fefaade 100644
--- a/platform/glfw/glfw_view.cpp
+++ b/platform/glfw/glfw_view.cpp
@@ -288,11 +288,10 @@ void GLFWView::onKey(GLFWwindow *window, int key, int /*scancode*/, int action,
break;
case GLFW_KEY_D: {
static const std::vector<mbgl::LatLngBounds> bounds = {
- mbgl::LatLngBounds::hull(mbgl::LatLng { -45.0, -170.0 }, mbgl::LatLng { 45.0, 170.0 }), // inside
- mbgl::LatLngBounds::hull(mbgl::LatLng { -45.0, -200.0 }, mbgl::LatLng { 45.0, -160.0 }), // left IDL
- mbgl::LatLngBounds::hull(mbgl::LatLng { -45.0, 160.0 }, mbgl::LatLng { 45.0, 200.0 }), // right IDL
- mbgl::LatLngBounds::unbounded()
- };
+ mbgl::LatLngBounds::hull(mbgl::LatLng{-45.0, -170.0}, mbgl::LatLng{45.0, 170.0}), // inside
+ mbgl::LatLngBounds::hull(mbgl::LatLng{-45.0, -200.0}, mbgl::LatLng{45.0, -160.0}), // left IDL
+ mbgl::LatLngBounds::hull(mbgl::LatLng{-45.0, 160.0}, mbgl::LatLng{45.0, 200.0}), // right IDL
+ mbgl::LatLngBounds()};
static size_t nextBound = 0u;
static mbgl::AnnotationID boundAnnotationID = std::numeric_limits<mbgl::AnnotationID>::max();
@@ -301,7 +300,7 @@ void GLFWView::onKey(GLFWwindow *window, int key, int /*scancode*/, int action,
view->map->setBounds(mbgl::BoundOptions().withLatLngBounds(bound));
- if (bound == mbgl::LatLngBounds::unbounded()) {
+ if (bound == mbgl::LatLngBounds()) {
view->map->removeAnnotation(boundAnnotationID);
boundAnnotationID = std::numeric_limits<mbgl::AnnotationID>::max();
} else {