diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-06-04 11:22:03 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-06-04 11:22:03 +0200 |
commit | af69b4fe3918d34092f65c3038a3eb3f3690488f (patch) | |
tree | c5a65578c10f8d845df8f6ef0841b71b6192abdc /src | |
parent | 580527a16c22fe41df8368492193980acc979b5a (diff) | |
download | qtlocation-mapboxgl-af69b4fe3918d34092f65c3038a3eb3f3690488f.tar.gz |
unifiy constants in one place, and allow local override
Diffstat (limited to 'src')
-rw-r--r-- | src/map/map.cpp | 2 | ||||
-rw-r--r-- | src/platform/platform.cpp | 3 | ||||
-rw-r--r-- | src/text/glyph_store.cpp | 3 | ||||
-rw-r--r-- | src/util/constants.cpp | 27 |
4 files changed, 3 insertions, 32 deletions
diff --git a/src/map/map.cpp b/src/map/map.cpp index af8876541f..2a3f366f11 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -170,7 +170,7 @@ void Map::setup() { sources.emplace("outdoors", std::unique_ptr<Source>(new Source(*this, painter, - "http://a.tiles.mapbox.com/v3/mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5/%d/%d/%d.vector.pbf", + kVectorTileURL, Source::Type::vector, {{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }}, 512, diff --git a/src/platform/platform.cpp b/src/platform/platform.cpp deleted file mode 100644 index 6aa5ef38fc..0000000000 --- a/src/platform/platform.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include <llmr/platform/platform.hpp> - -const char *llmr::kSpriteURL = "http://mapbox-kkaefer.s3.amazonaws.com/static/outdoors-gl/sprite"; diff --git a/src/text/glyph_store.cpp b/src/text/glyph_store.cpp index 50084ba5f5..9d88a692b5 100644 --- a/src/text/glyph_store.cpp +++ b/src/text/glyph_store.cpp @@ -4,6 +4,7 @@ #include <llmr/util/string.hpp> #include <llmr/util/utf.hpp> #include <llmr/util/pbf.hpp> +#include <llmr/util/constants.hpp> #include <llmr/platform/platform.hpp> #include <uv.h> #include <algorithm> @@ -118,7 +119,7 @@ GlyphPBF::GlyphPBF(const std::string &fontStack, GlyphRange glyphRange) : future(promise.get_future().share()) { // Load the glyph set URL - std::string url = util::sprintf<255>("http://mapbox.s3.amazonaws.com/gl-glyphs-256/%s/%d-%d.pbf", fontStack.c_str(), glyphRange.first, glyphRange.second); + std::string url = util::sprintf<255>(kGlyphURL, fontStack.c_str(), glyphRange.first, glyphRange.second); // TODO: Find more reliable URL normalization function std::replace(url.begin(), url.end(), ' ', '+'); diff --git a/src/util/constants.cpp b/src/util/constants.cpp deleted file mode 100644 index 46852e5e79..0000000000 --- a/src/util/constants.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include <llmr/util/constants.hpp> - -const float llmr::util::tileSize = 512.0f; - -#if defined(DEBUG) -const bool llmr::debug::tileParseWarnings = false; -const bool llmr::debug::styleParseWarnings = false; -const bool llmr::debug::spriteWarnings = false; -const bool llmr::debug::renderWarnings = false; -const bool llmr::debug::renderTree = false; -const bool llmr::debug::labelTextMissingWarning = true; -const bool llmr::debug::missingFontStackWarning = true; -const bool llmr::debug::missingFontFaceWarning = true; -const bool llmr::debug::glyphWarning = true; -const bool llmr::debug::shapingWarning = true; -#else -const bool llmr::debug::tileParseWarnings = false; -const bool llmr::debug::styleParseWarnings = false; -const bool llmr::debug::spriteWarnings = false; -const bool llmr::debug::renderWarnings = false; -const bool llmr::debug::renderTree = false; -const bool llmr::debug::labelTextMissingWarning = false; -const bool llmr::debug::missingFontStackWarning = false; -const bool llmr::debug::missingFontFaceWarning = false; -const bool llmr::debug::glyphWarning = false; -const bool llmr::debug::shapingWarning = false; -#endif
\ No newline at end of file |