summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2020-01-24 12:38:08 +0200
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2020-01-24 14:15:37 +0200
commit61ab64906e6ebca9fe27463d9ea12a747314386c (patch)
treeca59b4331d0a50336a1becdc17fd603db49836a7 /include
parent9e1bcc4fdc6cb3bb1710a6e2cefd7e642159b2f3 (diff)
downloadqtlocation-mapboxgl-61ab64906e6ebca9fe27463d9ea12a747314386c.tar.gz
GeoJSONSource is re-using the existing scheduler
Thus avoiding spawing new threads on `setGeoJSONData()` calls.
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/style/sources/geojson_source.hpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/mbgl/style/sources/geojson_source.hpp b/include/mbgl/style/sources/geojson_source.hpp
index df2f9d2daf..750d29627d 100644
--- a/include/mbgl/style/sources/geojson_source.hpp
+++ b/include/mbgl/style/sources/geojson_source.hpp
@@ -42,7 +42,8 @@ public:
using TileFeatures = mapbox::feature::feature_collection<int16_t>;
using Features = mapbox::feature::feature_collection<double>;
static std::shared_ptr<GeoJSONData> create(const GeoJSON&,
- Immutable<GeoJSONOptions> = GeoJSONOptions::defaultOptions());
+ Immutable<GeoJSONOptions> = GeoJSONOptions::defaultOptions(),
+ std::shared_ptr<Scheduler> scheduler = nullptr);
virtual ~GeoJSONData() = default;
virtual void getTile(const CanonicalTileID&, const std::function<void(TileFeatures)>&) = 0;
@@ -53,6 +54,8 @@ public:
const std::uint32_t limit = 10u,
const std::uint32_t offset = 0u) = 0;
virtual std::uint8_t getClusterExpansionZoom(std::uint32_t) = 0;
+
+ virtual std::shared_ptr<Scheduler> getScheduler() { return nullptr; }
};
class GeoJSONSource final : public Source {