summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-07-24 13:18:40 +0300
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-07-24 21:04:56 +0300
commitec6650d3c0db8bff7e425518176261a8e6ed4e79 (patch)
treec5deae9d70e96368488972348ca50db3fb272175
parent852fef66ef4cbbe753527b42cf23c59de59399b3 (diff)
downloadqtlocation-mapboxgl-ec6650d3c0db8bff7e425518176261a8e6ed4e79.tar.gz
[core] Default GeometryTileFeature::getGeometries() implementation
-rw-r--r--src/mbgl/style/expression/expression.cpp3
-rw-r--r--src/mbgl/tile/geometry_tile_data.cpp5
-rw-r--r--src/mbgl/tile/geometry_tile_data.hpp2
3 files changed, 6 insertions, 4 deletions
diff --git a/src/mbgl/style/expression/expression.cpp b/src/mbgl/style/expression/expression.cpp
index 4800f6aa7f..4c810431d0 100644
--- a/src/mbgl/style/expression/expression.cpp
+++ b/src/mbgl/style/expression/expression.cpp
@@ -17,7 +17,6 @@ public:
}
PropertyMap getProperties() const override { return feature.properties; }
FeatureIdentifier getID() const override { return feature.id; }
- const GeometryCollection& getGeometries() const override { return geometry; }
optional<mbgl::Value> getValue(const std::string& key) const override {
auto it = feature.properties.find(key);
if (it != feature.properties.end()) {
@@ -25,8 +24,6 @@ public:
}
return optional<mbgl::Value>();
}
-
- GeometryCollection geometry;
};
diff --git a/src/mbgl/tile/geometry_tile_data.cpp b/src/mbgl/tile/geometry_tile_data.cpp
index 2dda9ecae4..c7aea35944 100644
--- a/src/mbgl/tile/geometry_tile_data.cpp
+++ b/src/mbgl/tile/geometry_tile_data.cpp
@@ -180,4 +180,9 @@ Feature convertFeature(const GeometryTileFeature& geometryTileFeature, const Can
return feature;
}
+const GeometryCollection& GeometryTileFeature::getGeometries() const {
+ static const GeometryCollection dummy;
+ return dummy;
+}
+
} // namespace mbgl
diff --git a/src/mbgl/tile/geometry_tile_data.hpp b/src/mbgl/tile/geometry_tile_data.hpp
index db3378a019..a0d41608a3 100644
--- a/src/mbgl/tile/geometry_tile_data.hpp
+++ b/src/mbgl/tile/geometry_tile_data.hpp
@@ -44,7 +44,7 @@ public:
virtual optional<Value> getValue(const std::string& key) const = 0;
virtual PropertyMap getProperties() const { return PropertyMap(); }
virtual FeatureIdentifier getID() const { return NullValue {}; }
- virtual const GeometryCollection& getGeometries() const = 0;
+ virtual const GeometryCollection& getGeometries() const;
};
class GeometryTileLayer {