Load TileJSON; support inline TileJSON sources

Fixes #412
Refs https://github.com/mapbox/mapbox-gl-style-spec/pull/143
This commit is contained in:
Lauren Budorick
2014-08-18 17:49:50 -07:00
committed by John Firebaugh
parent b9c7e1bdd9
commit 0168612ed3
8 changed files with 176 additions and 61 deletions

View File

@@ -25,7 +25,9 @@ struct box;
class Source : public std::enable_shared_from_this<Source>, private util::noncopyable {
public:
Source(SourceInfo info, const std::string &access_token = "");
Source(SourceInfo& info);
void load(Map &map);
bool update(Map &map);
void updateMatrices(const mat4 &projMatrix, const TransformState &transform);
@@ -38,11 +40,6 @@ public:
std::forward_list<Tile::ID> getIDs() const;
void updateClipIDs(const std::map<Tile::ID, ClipID> &mapping);
static std::string normalizeSourceURL(const std::string &url, const std::string &access_token);
public:
const SourceInfo info;
private:
bool findLoadedChildren(const Tile::ID& id, int32_t maxCoveringZoom, std::forward_list<Tile::ID>& retain);
bool findLoadedParent(const Tile::ID& id, int32_t minCoveringZoom, std::forward_list<Tile::ID>& retain);
@@ -55,7 +52,9 @@ private:
double getZoom(const TransformState &state) const;
private:
SourceInfo& info;
bool loaded = false;
// Stores the time when this source was most recently updated.
timestamp updated = 0;

View File

@@ -67,9 +67,6 @@ protected:
public:
const SourceInfo &source;
// Request-related information.
const std::string url;
protected:
std::weak_ptr<platform::Request> req;
std::string data;