diff options
Diffstat (limited to 'src/mbgl/renderer/sources/render_geojson_source.cpp')
-rw-r--r-- | src/mbgl/renderer/sources/render_geojson_source.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mbgl/renderer/sources/render_geojson_source.cpp b/src/mbgl/renderer/sources/render_geojson_source.cpp index 2b1eeea73b..893f6a2ac6 100644 --- a/src/mbgl/renderer/sources/render_geojson_source.cpp +++ b/src/mbgl/renderer/sources/render_geojson_source.cpp @@ -9,12 +9,15 @@ namespace mbgl { using namespace style; -RenderGeoJSONSource::RenderGeoJSONSource(const style::GeoJSONSource::Impl& impl_) - : RenderSource(impl_), - impl(impl_) { +RenderGeoJSONSource::RenderGeoJSONSource(Immutable<style::GeoJSONSource::Impl> impl_) + : RenderSource(impl_) { tilePyramid.setObserver(this); } +const style::GeoJSONSource::Impl& RenderGeoJSONSource::impl() const { + return static_cast<const style::GeoJSONSource::Impl&>(*baseImpl); +} + bool RenderGeoJSONSource::isLoaded() const { return tilePyramid.isLoaded(); } @@ -37,7 +40,7 @@ std::map<UnwrappedTileID, RenderTile>& RenderGeoJSONSource::getRenderTiles() { } void RenderGeoJSONSource::updateTiles(const TileParameters& parameters) { - GeoJSONData* data_ = impl.getData(); + GeoJSONData* data_ = impl().getData(); if (!data_) { return; @@ -55,9 +58,9 @@ void RenderGeoJSONSource::updateTiles(const TileParameters& parameters) { tilePyramid.updateTiles(parameters, SourceType::GeoJSON, util::tileSize, - impl.getZoomRange(), + impl().getZoomRange(), [&] (const OverscaledTileID& tileID) { - return std::make_unique<GeoJSONTile>(tileID, impl.id, parameters, data->getTile(tileID.canonical)); + return std::make_unique<GeoJSONTile>(tileID, impl().id, parameters, data->getTile(tileID.canonical)); }); } |