summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--config/constants.cpp (renamed from src/util/constants.cpp)6
-rw-r--r--include/llmr/platform/platform.hpp3
-rw-r--r--include/llmr/util/constants.hpp5
-rw-r--r--llmr.gyp2
-rw-r--r--src/map/map.cpp2
-rw-r--r--src/platform/platform.cpp3
-rw-r--r--src/text/glyph_store.cpp3
8 files changed, 16 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
index 5295ff95ff..c2ddb1a0c3 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
index 46852e5e79..ab0c160a8a 100644
--- a/src/util/constants.cpp
+++ b/config/constants.cpp
@@ -1,5 +1,9 @@
#include <llmr/util/constants.hpp>
+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 31118a22f1..220acd3971 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 f315e5171b..e3a7b206e2 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 d165a24d3b..73aece077a 100644
--- a/llmr.gyp
+++ b/llmr.gyp
@@ -65,6 +65,7 @@
],
'sources': [
'<!@(find src -name "*.cpp")',
+ '<!@(test -f "config/constants_local.cpp" && echo "config/constants_local.cpp" || echo "config/constants.cpp")',
'<!@(find src -name "*.c")',
'<!@(find src -name "*.h")',
'<!@(find include -name "*.hpp")',
@@ -131,6 +132,7 @@
],
'sources': [
'<!@(find src/ \( -name "*.cpp" ! -name shaders.hpp ! -name shaders_gles2.cpp ! -name shaders_gl.cpp \))',
+ '<!@(test -f "config/constants_local.cpp" && echo "config/constants_local.cpp" || echo "config/constants.cpp")',
'<!@(find src -name "*.c")',
'<!@(find src -name "*.h")',
'<!@(find include -name "*.hpp")',
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(), ' ', '+');