summaryrefslogtreecommitdiff
path: root/include/mbgl
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-09-17 18:51:53 +0300
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-09-18 16:21:59 +0300
commit224d49cc9083f8ecb418a68ae0fea839bc51def6 (patch)
treef7fe1451c5b3d9631f6d4e1e5672ae628ecd7982 /include/mbgl
parent8b355c7f8b42d4523c3adfc3f7407a522273824f (diff)
downloadqtlocation-mapboxgl-224d49cc9083f8ecb418a68ae0fea839bc51def6.tar.gz
[core] Check layer compatibility with source
Diffstat (limited to 'include/mbgl')
-rw-r--r--include/mbgl/style/source.hpp3
-rw-r--r--include/mbgl/style/sources/custom_geometry_source.hpp1
-rw-r--r--include/mbgl/style/sources/geojson_source.hpp2
-rw-r--r--include/mbgl/style/sources/image_source.hpp2
-rw-r--r--include/mbgl/style/sources/raster_dem_source.hpp2
-rw-r--r--include/mbgl/style/sources/raster_source.hpp2
-rw-r--r--include/mbgl/style/sources/vector_source.hpp2
7 files changed, 13 insertions, 1 deletions
diff --git a/include/mbgl/style/source.hpp b/include/mbgl/style/source.hpp
index 2507b67fdc..c3c0609a9f 100644
--- a/include/mbgl/style/source.hpp
+++ b/include/mbgl/style/source.hpp
@@ -22,6 +22,7 @@ class RasterSource;
class RasterDEMSource;
class GeoJSONSource;
class SourceObserver;
+struct LayerTypeInfo;
/**
* The runtime representation of a [source](https://www.mapbox.com/mapbox-gl-style-spec/#sources) from the Mapbox Style
@@ -74,6 +75,8 @@ public:
virtual void loadDescription(FileSource&) = 0;
void dumpDebugLogs() const;
+ virtual bool supportsLayerType(const mbgl::style::LayerTypeInfo*) const = 0;
+
bool loaded = false;
// For use in SDK bindings, which store a reference to a platform-native peer
diff --git a/include/mbgl/style/sources/custom_geometry_source.hpp b/include/mbgl/style/sources/custom_geometry_source.hpp
index a5e545f445..ff04505699 100644
--- a/include/mbgl/style/sources/custom_geometry_source.hpp
+++ b/include/mbgl/style/sources/custom_geometry_source.hpp
@@ -46,6 +46,7 @@ public:
// Private implementation
class Impl;
const Impl& impl() const;
+ bool supportsLayerType(const mbgl::style::LayerTypeInfo*) const override;
mapbox::base::WeakPtr<Source> makeWeakPtr() override {
return weakFactory.makeWeakPtr();
}
diff --git a/include/mbgl/style/sources/geojson_source.hpp b/include/mbgl/style/sources/geojson_source.hpp
index c99687fad6..a256ad6f15 100644
--- a/include/mbgl/style/sources/geojson_source.hpp
+++ b/include/mbgl/style/sources/geojson_source.hpp
@@ -50,6 +50,8 @@ public:
void loadDescription(FileSource&) final;
+ bool supportsLayerType(const mbgl::style::LayerTypeInfo*) const override;
+
mapbox::base::WeakPtr<Source> makeWeakPtr() override {
return weakFactory.makeWeakPtr();
}
diff --git a/include/mbgl/style/sources/image_source.hpp b/include/mbgl/style/sources/image_source.hpp
index 84faab33c9..699a3c6494 100644
--- a/include/mbgl/style/sources/image_source.hpp
+++ b/include/mbgl/style/sources/image_source.hpp
@@ -28,6 +28,8 @@ public:
void loadDescription(FileSource&) final;
+ bool supportsLayerType(const mbgl::style::LayerTypeInfo*) const override;
+
mapbox::base::WeakPtr<Source> makeWeakPtr() override {
return weakFactory.makeWeakPtr();
}
diff --git a/include/mbgl/style/sources/raster_dem_source.hpp b/include/mbgl/style/sources/raster_dem_source.hpp
index 82588613bc..42e27cd078 100644
--- a/include/mbgl/style/sources/raster_dem_source.hpp
+++ b/include/mbgl/style/sources/raster_dem_source.hpp
@@ -13,7 +13,7 @@ namespace style {
class RasterDEMSource : public RasterSource {
public:
RasterDEMSource(std::string id, variant<std::string, Tileset> urlOrTileset, uint16_t tileSize);
-
+ bool supportsLayerType(const mbgl::style::LayerTypeInfo*) const override;
};
template <>
diff --git a/include/mbgl/style/sources/raster_source.hpp b/include/mbgl/style/sources/raster_source.hpp
index 1bdced8da7..00a3b788c2 100644
--- a/include/mbgl/style/sources/raster_source.hpp
+++ b/include/mbgl/style/sources/raster_source.hpp
@@ -25,6 +25,8 @@ public:
void loadDescription(FileSource&) final;
+ bool supportsLayerType(const mbgl::style::LayerTypeInfo*) const override;
+
mapbox::base::WeakPtr<Source> makeWeakPtr() final {
return weakFactory.makeWeakPtr();
}
diff --git a/include/mbgl/style/sources/vector_source.hpp b/include/mbgl/style/sources/vector_source.hpp
index 97f0a7e5a8..4165af0a61 100644
--- a/include/mbgl/style/sources/vector_source.hpp
+++ b/include/mbgl/style/sources/vector_source.hpp
@@ -24,6 +24,8 @@ public:
void loadDescription(FileSource&) final;
+ bool supportsLayerType(const mbgl::style::LayerTypeInfo*) const override;
+
mapbox::base::WeakPtr<Source> makeWeakPtr() override {
return weakFactory.makeWeakPtr();
}