summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-09-18 14:56:21 +0300
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-09-18 16:21:59 +0300
commite3137d86d2d873bf0894c438a51510575d7ecc7a (patch)
tree7b14badce0fd3c800c87cfe467e62c446d9f2257
parent152d4c35fc5c7f06940b820790474fa5d5767112 (diff)
downloadqtlocation-mapboxgl-e3137d86d2d873bf0894c438a51510575d7ecc7a.tar.gz
[core] Use LayerInfo::tileKind in sources
-rw-r--r--src/mbgl/style/sources/custom_geometry_source.cpp5
-rw-r--r--src/mbgl/style/sources/geojson_source.cpp5
-rw-r--r--src/mbgl/style/sources/image_source.cpp3
-rw-r--r--src/mbgl/style/sources/raster_dem_source.cpp3
-rw-r--r--src/mbgl/style/sources/raster_source.cpp3
-rw-r--r--src/mbgl/style/sources/vector_source.cpp5
6 files changed, 12 insertions, 12 deletions
diff --git a/src/mbgl/style/sources/custom_geometry_source.cpp b/src/mbgl/style/sources/custom_geometry_source.cpp
index 5576277de8..1076cbf417 100644
--- a/src/mbgl/style/sources/custom_geometry_source.cpp
+++ b/src/mbgl/style/sources/custom_geometry_source.cpp
@@ -7,6 +7,7 @@
#include <mbgl/style/source_observer.hpp>
#include <mbgl/style/sources/custom_geometry_source.hpp>
#include <mbgl/style/sources/custom_geometry_source_impl.hpp>
+#include <mbgl/tile/tile.hpp>
#include <mbgl/tile/tile_id.hpp>
#include <tuple>
@@ -32,9 +33,7 @@ void CustomGeometrySource::loadDescription(FileSource&) {
}
bool CustomGeometrySource::supportsLayerType(const mbgl::style::LayerTypeInfo* info) const {
- return !std::strcmp(info->type, "line") || !std::strcmp(info->type, "symbol") ||
- !std::strcmp(info->type, "circle") || !std::strcmp(info->type, "fill") ||
- !std::strcmp(info->type, "fill-extrusion") || !std::strcmp(info->type, "heatmap");
+ return mbgl::underlying_type(Tile::Kind::Geometry) == mbgl::underlying_type(info->tileKind);
}
void CustomGeometrySource::setTileData(const CanonicalTileID& tileID,
diff --git a/src/mbgl/style/sources/geojson_source.cpp b/src/mbgl/style/sources/geojson_source.cpp
index b1a5dd981a..baf76d8224 100644
--- a/src/mbgl/style/sources/geojson_source.cpp
+++ b/src/mbgl/style/sources/geojson_source.cpp
@@ -5,6 +5,7 @@
#include <mbgl/style/source_observer.hpp>
#include <mbgl/style/sources/geojson_source.hpp>
#include <mbgl/style/sources/geojson_source_impl.hpp>
+#include <mbgl/tile/tile.hpp>
#include <mbgl/util/logging.hpp>
namespace mbgl {
@@ -80,9 +81,7 @@ void GeoJSONSource::loadDescription(FileSource& fileSource) {
}
bool GeoJSONSource::supportsLayerType(const mbgl::style::LayerTypeInfo* info) const {
- return !std::strcmp(info->type, "line") || !std::strcmp(info->type, "symbol") ||
- !std::strcmp(info->type, "circle") || !std::strcmp(info->type, "fill") ||
- !std::strcmp(info->type, "fill-extrusion") || !std::strcmp(info->type, "heatmap");
+ return mbgl::underlying_type(Tile::Kind::Geometry) == mbgl::underlying_type(info->tileKind);
}
} // namespace style
diff --git a/src/mbgl/style/sources/image_source.cpp b/src/mbgl/style/sources/image_source.cpp
index abd01af701..baadc86e7c 100644
--- a/src/mbgl/style/sources/image_source.cpp
+++ b/src/mbgl/style/sources/image_source.cpp
@@ -3,6 +3,7 @@
#include <mbgl/style/source_observer.hpp>
#include <mbgl/style/sources/image_source.hpp>
#include <mbgl/style/sources/image_source_impl.hpp>
+#include <mbgl/tile/tile.hpp>
#include <mbgl/util/geo.hpp>
#include <mbgl/util/premultiply.hpp>
@@ -82,7 +83,7 @@ void ImageSource::loadDescription(FileSource& fileSource) {
}
bool ImageSource::supportsLayerType(const mbgl::style::LayerTypeInfo* info) const {
- return !std::strcmp(info->type, "raster");
+ return mbgl::underlying_type(Tile::Kind::Raster) == mbgl::underlying_type(info->tileKind);
}
} // namespace style
diff --git a/src/mbgl/style/sources/raster_dem_source.cpp b/src/mbgl/style/sources/raster_dem_source.cpp
index 724a322917..dd859cc6d1 100644
--- a/src/mbgl/style/sources/raster_dem_source.cpp
+++ b/src/mbgl/style/sources/raster_dem_source.cpp
@@ -4,6 +4,7 @@
#include <mbgl/style/source_observer.hpp>
#include <mbgl/style/sources/raster_dem_source.hpp>
#include <mbgl/style/sources/raster_source_impl.hpp>
+#include <mbgl/tile/tile.hpp>
#include <mbgl/util/mapbox.hpp>
namespace mbgl {
@@ -14,7 +15,7 @@ RasterDEMSource::RasterDEMSource(std::string id, variant<std::string, Tileset> u
}
bool RasterDEMSource::supportsLayerType(const mbgl::style::LayerTypeInfo* info) const {
- return !std::strcmp(info->type, "hillshade");
+ return mbgl::underlying_type(Tile::Kind::RasterDEM) == mbgl::underlying_type(info->tileKind);
}
} // namespace style
diff --git a/src/mbgl/style/sources/raster_source.cpp b/src/mbgl/style/sources/raster_source.cpp
index c758a7bc8b..851f32573e 100644
--- a/src/mbgl/style/sources/raster_source.cpp
+++ b/src/mbgl/style/sources/raster_source.cpp
@@ -5,6 +5,7 @@
#include <mbgl/style/source_observer.hpp>
#include <mbgl/style/sources/raster_source.hpp>
#include <mbgl/style/sources/raster_source_impl.hpp>
+#include <mbgl/tile/tile.hpp>
#include <mbgl/util/exception.hpp>
#include <mbgl/util/mapbox.hpp>
@@ -82,7 +83,7 @@ void RasterSource::loadDescription(FileSource& fileSource) {
}
bool RasterSource::supportsLayerType(const mbgl::style::LayerTypeInfo* info) const {
- return !std::strcmp(info->type, "raster");
+ return mbgl::underlying_type(Tile::Kind::Raster) == mbgl::underlying_type(info->tileKind);
}
} // namespace style
diff --git a/src/mbgl/style/sources/vector_source.cpp b/src/mbgl/style/sources/vector_source.cpp
index 7cb89a9474..dc1a45fdff 100644
--- a/src/mbgl/style/sources/vector_source.cpp
+++ b/src/mbgl/style/sources/vector_source.cpp
@@ -5,6 +5,7 @@
#include <mbgl/style/source_observer.hpp>
#include <mbgl/style/sources/vector_source.hpp>
#include <mbgl/style/sources/vector_source_impl.hpp>
+#include <mbgl/tile/tile.hpp>
#include <mbgl/util/constants.hpp>
#include <mbgl/util/exception.hpp>
#include <mbgl/util/mapbox.hpp>
@@ -86,9 +87,7 @@ void VectorSource::loadDescription(FileSource& fileSource) {
}
bool VectorSource::supportsLayerType(const mbgl::style::LayerTypeInfo* info) const {
- return !std::strcmp(info->type, "line") || !std::strcmp(info->type, "symbol") ||
- !std::strcmp(info->type, "circle") || !std::strcmp(info->type, "fill") ||
- !std::strcmp(info->type, "fill-extrusion") || !std::strcmp(info->type, "heatmap");
+ return mbgl::underlying_type(Tile::Kind::Geometry) == mbgl::underlying_type(info->tileKind);
}
} // namespace style