[core] Improve error message when style is not found or is incompatible
Attempting to use a Mapbox-hosted incompatible raster map/style with GL would throw a simple 404, without any indication of the real issue. Fix #1724, ref #1841
This commit is contained in:
@@ -118,6 +118,8 @@ void MapContext::setStyleURL(const std::string& url) {
|
||||
|
||||
if (res.status == Response::Successful) {
|
||||
loadStyleJSON(res.data, base);
|
||||
} else if (res.status == Response::NotFound && (styleURL.find("mapbox://") != std::string::npos)) {
|
||||
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.message.c_str());
|
||||
data.loading = false;
|
||||
|
||||
Reference in New Issue
Block a user