diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-09-17 18:51:53 +0300 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-09-18 16:21:59 +0300 |
commit | 224d49cc9083f8ecb418a68ae0fea839bc51def6 (patch) | |
tree | f7fe1451c5b3d9631f6d4e1e5672ae628ecd7982 /src/mbgl/style/sources/geojson_source.cpp | |
parent | 8b355c7f8b42d4523c3adfc3f7407a522273824f (diff) | |
download | qtlocation-mapboxgl-224d49cc9083f8ecb418a68ae0fea839bc51def6.tar.gz |
[core] Check layer compatibility with source
Diffstat (limited to 'src/mbgl/style/sources/geojson_source.cpp')
-rw-r--r-- | src/mbgl/style/sources/geojson_source.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/mbgl/style/sources/geojson_source.cpp b/src/mbgl/style/sources/geojson_source.cpp index 72a51e212f..b1a5dd981a 100644 --- a/src/mbgl/style/sources/geojson_source.cpp +++ b/src/mbgl/style/sources/geojson_source.cpp @@ -1,9 +1,10 @@ +#include <mbgl/storage/file_source.hpp> +#include <mbgl/style/conversion/geojson.hpp> +#include <mbgl/style/conversion/json.hpp> +#include <mbgl/style/layer.hpp> +#include <mbgl/style/source_observer.hpp> #include <mbgl/style/sources/geojson_source.hpp> #include <mbgl/style/sources/geojson_source_impl.hpp> -#include <mbgl/style/source_observer.hpp> -#include <mbgl/style/conversion/json.hpp> -#include <mbgl/style/conversion/geojson.hpp> -#include <mbgl/storage/file_source.hpp> #include <mbgl/util/logging.hpp> namespace mbgl { @@ -78,5 +79,11 @@ 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"); +} + } // namespace style } // namespace mbgl |