diff --git a/.gitignore b/.gitignore index 5295ff95f..c2ddb1a0c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ /ios/build /config.gypi /config.mk +/config/constants_local.cpp /build /bin/node_modules /include/llmr/shader/shaders.hpp diff --git a/src/util/constants.cpp b/config/constants.cpp similarity index 76% rename from src/util/constants.cpp rename to config/constants.cpp index 46852e5e7..ab0c160a8 100644 --- a/src/util/constants.cpp +++ b/config/constants.cpp @@ -1,5 +1,9 @@ #include +const char *llmr::kSpriteURL = "http://mapbox-kkaefer.s3.amazonaws.com/static/outdoors-gl/sprite"; +const char *llmr::kVectorTileURL = "http://a.tiles.mapbox.com/v3/mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5/%d/%d/%d.vector.pbf"; +const char *llmr::kGlyphURL = "http://mapbox.s3.amazonaws.com/gl-glyphs-256/%s/%d-%d.pbf"; + const float llmr::util::tileSize = 512.0f; #if defined(DEBUG) @@ -24,4 +28,4 @@ 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 +#endif diff --git a/include/llmr/platform/platform.hpp b/include/llmr/platform/platform.hpp index 31118a22f..220acd397 100644 --- a/include/llmr/platform/platform.hpp +++ b/include/llmr/platform/platform.hpp @@ -12,9 +12,6 @@ class loop; } namespace llmr { - -extern const char *kSpriteURL; - namespace platform { class Request; diff --git a/include/llmr/util/constants.hpp b/include/llmr/util/constants.hpp index f315e5171..e3a7b206e 100644 --- a/include/llmr/util/constants.hpp +++ b/include/llmr/util/constants.hpp @@ -6,6 +6,11 @@ #include "vec.hpp" namespace llmr { + +extern const char *kSpriteURL; +extern const char *kVectorTileURL; +extern const char *kGlyphURL; + namespace util { extern const float tileSize; diff --git a/llmr.gyp b/llmr.gyp index d165a24d3..73aece077 100644 --- a/llmr.gyp +++ b/llmr.gyp @@ -65,6 +65,7 @@ ], 'sources': [ '(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 6aa5ef38f..000000000 --- a/src/platform/platform.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include - -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 50084ba5f..9d88a692b 100644 --- a/src/text/glyph_store.cpp +++ b/src/text/glyph_store.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -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(), ' ', '+');