summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsheem Mamoowala <asheem.mamoowala@mapbox.com>2017-10-09 17:33:10 -0700
committerAsheem Mamoowala <asheem.mamoowala@mapbox.com>2017-10-10 16:53:14 -0700
commit648e74109dd995d5594795b9ddc1e249929b9630 (patch)
tree0a2dead672eee2195d67287e7b444e991a046d9b
parent135217fcee675da1f9be6bca63c43753e19d01b4 (diff)
downloadqtlocation-mapboxgl-648e74109dd995d5594795b9ddc1e249929b9630.tar.gz
[core] Cleanup headers, includes, and external type references
-rw-r--r--include/mbgl/style/sources/custom_vector_source.hpp4
-rw-r--r--src/mbgl/renderer/sources/render_custom_vector_source.hpp1
-rw-r--r--src/mbgl/style/custom_tile_loader.cpp2
-rw-r--r--src/mbgl/style/custom_tile_loader.hpp9
-rw-r--r--src/mbgl/style/sources/custom_vector_source.cpp3
-rw-r--r--src/mbgl/tile/custom_tile.cpp5
-rw-r--r--src/mbgl/tile/custom_tile.hpp3
7 files changed, 11 insertions, 16 deletions
diff --git a/include/mbgl/style/sources/custom_vector_source.hpp b/include/mbgl/style/sources/custom_vector_source.hpp
index 77d0a69bd3..02c3ceb694 100644
--- a/include/mbgl/style/sources/custom_vector_source.hpp
+++ b/include/mbgl/style/sources/custom_vector_source.hpp
@@ -14,6 +14,7 @@ class CanonicalTileID;
namespace style {
using TileFunction = std::function<void(const CanonicalTileID&)>;
+
class CustomTileLoader;
class CustomVectorSource : public Source {
@@ -34,7 +35,7 @@ public:
CustomVectorSource(std::string id, CustomVectorSource::Options options);
~CustomVectorSource() final;
void loadDescription(FileSource&) final;
- void setTileData(const CanonicalTileID&, const mapbox::geojson::geojson&);
+ void setTileData(const CanonicalTileID&, const GeoJSON&);
// Private implementation
class Impl;
@@ -42,7 +43,6 @@ public:
private:
std::shared_ptr<Mailbox> mailbox;
std::unique_ptr<CustomTileLoader> loader;
-
};
template <>
diff --git a/src/mbgl/renderer/sources/render_custom_vector_source.hpp b/src/mbgl/renderer/sources/render_custom_vector_source.hpp
index b52fa196d2..2ab40a82b0 100644
--- a/src/mbgl/renderer/sources/render_custom_vector_source.hpp
+++ b/src/mbgl/renderer/sources/render_custom_vector_source.hpp
@@ -3,7 +3,6 @@
#include <mbgl/renderer/render_source.hpp>
#include <mbgl/renderer/tile_pyramid.hpp>
#include <mbgl/style/sources/custom_vector_source_impl.hpp>
-#include <mbgl/actor/actor.hpp>
namespace mbgl {
diff --git a/src/mbgl/style/custom_tile_loader.cpp b/src/mbgl/style/custom_tile_loader.cpp
index 91832f82ba..da4ade6734 100644
--- a/src/mbgl/style/custom_tile_loader.cpp
+++ b/src/mbgl/style/custom_tile_loader.cpp
@@ -53,7 +53,7 @@ void CustomTileLoader::removeTile(const OverscaledTileID& tileID) {
}
-void CustomTileLoader::setTileData(const CanonicalTileID& tileID, const mapbox::geojson::geojson& data) {
+void CustomTileLoader::setTileData(const CanonicalTileID& tileID, const GeoJSON& data) {
auto iter = tileCallbackMap.find(tileID);
if (iter == tileCallbackMap.end()) return;
dataCache[tileID] = std::make_unique<mapbox::geojson::geojson>(std::move(data));
diff --git a/src/mbgl/style/custom_tile_loader.hpp b/src/mbgl/style/custom_tile_loader.hpp
index 6f390cfe35..12b2dd525b 100644
--- a/src/mbgl/style/custom_tile_loader.hpp
+++ b/src/mbgl/style/custom_tile_loader.hpp
@@ -1,17 +1,16 @@
#pragma once
#include <mbgl/style/sources/custom_vector_source.hpp>
-#include <mbgl/actor/scheduler.hpp>
#include <mbgl/tile/tile_id.hpp>
+#include <mbgl/util/geojson.hpp>
#include <mbgl/actor/actor_ref.hpp>
-#include <tuple>
#include <map>
namespace mbgl {
namespace style {
-using SetTileDataFunction = std::function<void(const mapbox::geojson::geojson&)>;
+using SetTileDataFunction = std::function<void(const GeoJSON&)>;
class CustomTileLoader : private util::noncopyable {
public:
@@ -24,13 +23,13 @@ public:
void cancelTile(const OverscaledTileID& tileID);
void removeTile(const OverscaledTileID& tileID);
- void setTileData(const CanonicalTileID& tileID, const mapbox::geojson::geojson& data);
+ void setTileData(const CanonicalTileID& tileID, const GeoJSON& data);
private:
TileFunction fetchTileFunction;
TileFunction cancelTileFunction;
std::unordered_map<CanonicalTileID, std::vector<OverscaledIDFunctionTuple>> tileCallbackMap;
- std::map<CanonicalTileID, std::unique_ptr<mapbox::geojson::geojson>> dataCache;
+ std::map<CanonicalTileID, std::unique_ptr<GeoJSON>> dataCache;
};
} // namespace style
diff --git a/src/mbgl/style/sources/custom_vector_source.cpp b/src/mbgl/style/sources/custom_vector_source.cpp
index fc2f8f548e..c10d0bd2ab 100644
--- a/src/mbgl/style/sources/custom_vector_source.cpp
+++ b/src/mbgl/style/sources/custom_vector_source.cpp
@@ -22,13 +22,14 @@ CustomVectorSource::~CustomVectorSource() = default;
const CustomVectorSource::Impl& CustomVectorSource::impl() const {
return static_cast<const CustomVectorSource::Impl&>(*baseImpl);
}
+
void CustomVectorSource::loadDescription(FileSource&) {
baseImpl = makeMutable<CustomVectorSource::Impl>(impl(), ActorRef<CustomTileLoader>(*loader, mailbox));
loaded = true;
}
void CustomVectorSource::setTileData(const CanonicalTileID& tileID,
- const mapbox::geojson::geojson& data) {
+ const GeoJSON& data) {
loader->setTileData(tileID, data);
}
diff --git a/src/mbgl/tile/custom_tile.cpp b/src/mbgl/tile/custom_tile.cpp
index 890f6a4660..710c6f6691 100644
--- a/src/mbgl/tile/custom_tile.cpp
+++ b/src/mbgl/tile/custom_tile.cpp
@@ -1,10 +1,7 @@
#include <mbgl/tile/custom_tile.hpp>
#include <mbgl/tile/geojson_tile_data.hpp>
-#include <mbgl/tile/geometry_tile_data.hpp>
#include <mbgl/renderer/query.hpp>
#include <mbgl/renderer/tile_parameters.hpp>
-#include <mbgl/style/filter_evaluator.hpp>
-#include <mbgl/util/logging.hpp>
#include <mbgl/actor/scheduler.hpp>
#include <mapbox/geojsonvt.hpp>
@@ -27,7 +24,7 @@ CustomTile::~CustomTile() {
loader.invoke(&style::CustomTileLoader::removeTile, id);
}
-void CustomTile::setTileData(const mapbox::geojson::geojson& geoJSON) {
+void CustomTile::setTileData(const GeoJSON& geoJSON) {
auto featureData = mapbox::geometry::feature_collection<int16_t>();
if (geoJSON.is<FeatureCollection>() && !geoJSON.get<FeatureCollection>().empty()) {
diff --git a/src/mbgl/tile/custom_tile.hpp b/src/mbgl/tile/custom_tile.hpp
index 74f4fff3a5..363079af1e 100644
--- a/src/mbgl/tile/custom_tile.hpp
+++ b/src/mbgl/tile/custom_tile.hpp
@@ -2,7 +2,6 @@
#include <mbgl/tile/geometry_tile.hpp>
#include <mbgl/util/feature.hpp>
-#include <mbgl/style/sources/custom_vector_source.hpp>
#include <mbgl/style/custom_tile_loader.hpp>
namespace mbgl {
@@ -17,7 +16,7 @@ public:
const style::CustomVectorSource::TileOptions,
ActorRef<style::CustomTileLoader> loader);
~CustomTile() override;
- void setTileData(const mapbox::geojson::geojson& data);
+ void setTileData(const GeoJSON& data);
void setNecessity(Necessity) final;