abstract hardcoded URLs for now

This commit is contained in:
Justin R. Miller
2014-02-04 11:46:06 -05:00
parent 3b7f06ccbf
commit 2b2ff9fb3f
3 changed files with 5 additions and 2 deletions

View File

@@ -5,6 +5,9 @@
#include <functional>
#include <string>
#define kTileURL "http://localhost:3333/gl/tiles/plain/%d-%d-%d.vector.pbf"
#define kSpriteURL "http://localhost:3333/gl/debug/img/sprite"
namespace llmr {
class Tile;

View File

@@ -18,7 +18,7 @@ Map::Map(Settings& settings)
// TODO: Extract that information from the stylesheet instead of hard coding
style.sprite = std::make_shared<Sprite>();
style.sprite->load("http://localhost:3333/gl/debug/img/sprite");
style.sprite->load(kSpriteURL);
}
Map::~Map() {

View File

@@ -65,7 +65,7 @@ void Tile::request() {
state = Tile::loading;
// Create http request
std::string url = util::sprintf("http://localhost:3333/gl/tiles/plain/%d-%d-%d.vector.pbf",
std::string url = util::sprintf(kTileURL,
id.z, id.x, id.y);
// Note: Somehow this feels slower than the change to request_http()