Revert FeatureType rename

This commit is contained in:
John Firebaugh
2015-03-09 17:58:33 -07:00
parent b7f04ee7c2
commit 4d3dcea82c
4 changed files with 9 additions and 9 deletions

View File

@@ -19,7 +19,7 @@
namespace mbgl {
enum class GeometryFeatureType : uint8_t {
enum class FeatureType : uint8_t {
Unknown = 0,
Point = 1,
LineString = 2,
@@ -30,7 +30,7 @@ typedef std::vector<std::vector<Coordinate>> GeometryCollection;
class GeometryTileFeature : public mbgl::util::noncopyable {
public:
virtual GeometryFeatureType getType() const = 0;
virtual FeatureType getType() const = 0;
virtual mapbox::util::optional<Value> getValue(const std::string& key) const = 0;
virtual GeometryCollection getGeometries() const = 0;
};

View File

@@ -34,7 +34,7 @@ VectorTileFeature::VectorTileFeature(pbf feature_pbf, const VectorTileLayer& lay
}
}
} else if (feature_pbf.tag == 3) { // type
type = (GeometryFeatureType)feature_pbf.varint();
type = (FeatureType)feature_pbf.varint();
} else if (feature_pbf.tag == 4) { // geometry
geometry_pbf = feature_pbf.message();
} else {

View File

@@ -12,13 +12,13 @@ class VectorTileFeature : public GeometryTileFeature {
public:
VectorTileFeature(pbf, const VectorTileLayer&);
virtual GeometryFeatureType getType() const { return type; }
virtual FeatureType getType() const { return type; }
virtual mapbox::util::optional<Value> getValue(const std::string&) const;
virtual GeometryCollection getGeometries() const;
private:
uint64_t id = 0;
GeometryFeatureType type = GeometryFeatureType::Unknown;
FeatureType type = FeatureType::Unknown;
std::map<std::string, Value> properties;
pbf geometry_pbf;
};

View File

@@ -5,14 +5,14 @@ namespace mbgl {
Value parseFeatureType(const Value& value) {
if (value == std::string("Point")) {
return Value(uint64_t(GeometryFeatureType::Point));
return Value(uint64_t(FeatureType::Point));
} else if (value == std::string("LineString")) {
return Value(uint64_t(GeometryFeatureType::LineString));
return Value(uint64_t(FeatureType::LineString));
} else if (value == std::string("Polygon")) {
return Value(uint64_t(GeometryFeatureType::Polygon));
return Value(uint64_t(FeatureType::Polygon));
} else {
Log::Warning(Event::ParseStyle, "value for $type filter must be Point, LineString, or Polygon");
return Value(uint64_t(GeometryFeatureType::Unknown));
return Value(uint64_t(FeatureType::Unknown));
}
}