summaryrefslogtreecommitdiff
path: root/src/mbgl/map/map_context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/map/map_context.cpp')
-rw-r--r--src/mbgl/map/map_context.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp
index f2c17824c3..be6d32d2a0 100644
--- a/src/mbgl/map/map_context.cpp
+++ b/src/mbgl/map/map_context.cpp
@@ -21,6 +21,7 @@
#include <mbgl/util/texture_pool.hpp>
#include <mbgl/util/exception.hpp>
#include <mbgl/util/string.hpp>
+#include <mbgl/util/mapbox.hpp>
#include <algorithm>
@@ -114,7 +115,8 @@ void MapContext::setStyleURL(const std::string& url) {
styleRequest = nullptr;
if (res.error) {
- if (res.error->reason == Response::Error::Reason::NotFound && styleURL.find("mapbox://") == 0) {
+ if (res.error->reason == Response::Error::Reason::NotFound &&
+ util::mapbox::isMapboxURL(styleURL)) {
Log::Error(Event::Setup, "style %s could not be found or is an incompatible legacy map or style", styleURL.c_str());
} else {
Log::Error(Event::Setup, "loading style failed: %s", res.error->message.c_str());