#ifndef MBGL_MAP_SOURCE #define MBGL_MAP_SOURCE #include #include #include #include #include #include #include #include #include #include #include namespace mbgl { class Map; class Painter; class StyleLayer; class TransformState; struct box; class Source : public std::enable_shared_from_this, private util::noncopyable { public: Source(SourceInfo info, const std::string &access_token = ""); bool update(Map &map); void updateMatrices(const mat4 &projMatrix, const TransformState &transform); void drawClippingMasks(Painter &painter); size_t getTileCount() const; void render(Painter &painter, std::shared_ptr layer_desc); void render(Painter &painter, std::shared_ptr layer_desc, const Tile::ID &id, const mat4 &matrix); void finishRender(Painter &painter); std::forward_list getIDs() const; void updateClipIDs(const std::map &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& retain); bool findLoadedParent(const Tile::ID& id, int32_t minCoveringZoom, std::forward_list& retain); std::forward_list covering_tiles(const TransformState &state, int32_t clamped_zoom, const box& points); bool updateTiles(Map &map); TileData::State addTile(Map &map, const Tile::ID& id); TileData::State hasTile(const Tile::ID& id); double getZoom(const TransformState &state) const; private: // Stores the time when this source was most recently updated. timestamp updated = 0; std::map> tiles; std::map> tile_data; }; } #endif