[core] Use LayerInfo::tileKind in sources
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user