From 37f9e838439c3b7fc162e01207aa36c6344fc09b Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 7 Jun 2016 15:30:40 -0700 Subject: [PATCH] [core] Privatize geojson_tile.hpp contents --- src/mbgl/tile/geojson_tile.cpp | 40 ++++++++++++++++++++++++++++++++++ src/mbgl/tile/geojson_tile.hpp | 40 ---------------------------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/mbgl/tile/geojson_tile.cpp b/src/mbgl/tile/geojson_tile.cpp index 35fa88355..4bea00bb4 100644 --- a/src/mbgl/tile/geojson_tile.cpp +++ b/src/mbgl/tile/geojson_tile.cpp @@ -1,10 +1,50 @@ #include +#include #include #include 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 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>; + + GeoJSONTileLayer(Features&&); + std::size_t featureCount() const override; + util::ptr 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); + util::ptr getLayer(const std::string&) const override; + +private: + const std::shared_ptr layer; +}; + // Converts the geojsonvt::Tile to a a GeoJSONTile. They have a differing internal structure. std::unique_ptr convertTile(const mapbox::geojsonvt::Tile& tile) { std::shared_ptr layer; diff --git a/src/mbgl/tile/geojson_tile.hpp b/src/mbgl/tile/geojson_tile.hpp index df7a628e6..613ef2d96 100644 --- a/src/mbgl/tile/geojson_tile.hpp +++ b/src/mbgl/tile/geojson_tile.hpp @@ -1,6 +1,5 @@ #pragma once -#include #include 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 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>; - - GeoJSONTileLayer(Features&&); - std::size_t featureCount() const override; - util::ptr 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); - util::ptr getLayer(const std::string&) const override; - -private: - const std::shared_ptr layer; -}; - } // namespace mbgl