summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-06-07 15:30:40 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-06-13 10:57:46 -0700
commit37f9e838439c3b7fc162e01207aa36c6344fc09b (patch)
treeca11870c9e05f4afe453fdbdf350e254cd4b1ae2
parent0d2db2a5e321b764ca65de7ff6443822f07dc07a (diff)
downloadqtlocation-mapboxgl-37f9e838439c3b7fc162e01207aa36c6344fc09b.tar.gz
[core] Privatize geojson_tile.hpp contents
-rw-r--r--src/mbgl/tile/geojson_tile.cpp40
-rw-r--r--src/mbgl/tile/geojson_tile.hpp40
2 files changed, 40 insertions, 40 deletions
diff --git a/src/mbgl/tile/geojson_tile.cpp b/src/mbgl/tile/geojson_tile.cpp
index 35fa883557..4bea00bb45 100644
--- a/src/mbgl/tile/geojson_tile.cpp
+++ b/src/mbgl/tile/geojson_tile.cpp
@@ -1,10 +1,50 @@
#include <mbgl/tile/geojson_tile.hpp>
+#include <mbgl/tile/geometry_tile.hpp>
#include <mbgl/style/update_parameters.hpp>
#include <mapbox/geojsonvt.hpp>
namespace mbgl {
+// Implements a simple in-memory Tile type that holds GeoJSON values. A GeoJSON tile can only have
+// one layer, and it is always returned regardless of which layer is requested.
+
+class GeoJSONTileFeature : public GeometryTileFeature {
+public:
+ GeoJSONTileFeature(FeatureType, GeometryCollection&&, Feature::property_map&&);
+ FeatureType getType() const override;
+ optional<Value> getValue(const std::string&) const override;
+ Feature::property_map getProperties() const override { return properties; }
+ GeometryCollection getGeometries() const override;
+
+private:
+ const FeatureType type;
+ const GeometryCollection geometries;
+ const Feature::property_map properties;
+};
+
+class GeoJSONTileLayer : public GeometryTileLayer {
+public:
+ using Features = std::vector<std::shared_ptr<const GeoJSONTileFeature>>;
+
+ GeoJSONTileLayer(Features&&);
+ std::size_t featureCount() const override;
+ util::ptr<const GeometryTileFeature> getFeature(std::size_t) const override;
+ std::string getName() const override { return ""; };
+
+private:
+ const Features features;
+};
+
+class GeoJSONTile : public GeometryTile {
+public:
+ GeoJSONTile(std::shared_ptr<GeoJSONTileLayer>);
+ util::ptr<GeometryTileLayer> getLayer(const std::string&) const override;
+
+private:
+ const std::shared_ptr<GeoJSONTileLayer> layer;
+};
+
// Converts the geojsonvt::Tile to a a GeoJSONTile. They have a differing internal structure.
std::unique_ptr<GeoJSONTile> convertTile(const mapbox::geojsonvt::Tile& tile) {
std::shared_ptr<GeoJSONTileLayer> layer;
diff --git a/src/mbgl/tile/geojson_tile.hpp b/src/mbgl/tile/geojson_tile.hpp
index df7a628e6e..613ef2d962 100644
--- a/src/mbgl/tile/geojson_tile.hpp
+++ b/src/mbgl/tile/geojson_tile.hpp
@@ -1,6 +1,5 @@
#pragma once
-#include <mbgl/tile/geometry_tile.hpp>
#include <mbgl/tile/geometry_tile_data.hpp>
namespace mapbox {
@@ -26,43 +25,4 @@ public:
void setNecessity(Necessity) final;
};
-// Implements a simple in-memory Tile type that holds GeoJSON values. A GeoJSON tile can only have
-// one layer, and it is always returned regardless of which layer is requested.
-
-class GeoJSONTileFeature : public GeometryTileFeature {
-public:
- GeoJSONTileFeature(FeatureType, GeometryCollection&&, Feature::property_map&&);
- FeatureType getType() const override;
- optional<Value> getValue(const std::string&) const override;
- Feature::property_map getProperties() const override { return properties; }
- GeometryCollection getGeometries() const override;
-
-private:
- const FeatureType type;
- const GeometryCollection geometries;
- const Feature::property_map properties;
-};
-
-class GeoJSONTileLayer : public GeometryTileLayer {
-public:
- using Features = std::vector<std::shared_ptr<const GeoJSONTileFeature>>;
-
- GeoJSONTileLayer(Features&&);
- std::size_t featureCount() const override;
- util::ptr<const GeometryTileFeature> getFeature(std::size_t) const override;
- std::string getName() const override { return ""; };
-
-private:
- const Features features;
-};
-
-class GeoJSONTile : public GeometryTile {
-public:
- GeoJSONTile(std::shared_ptr<GeoJSONTileLayer>);
- util::ptr<GeometryTileLayer> getLayer(const std::string&) const override;
-
-private:
- const std::shared_ptr<GeoJSONTileLayer> layer;
-};
-
} // namespace mbgl