diff options
author | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2020-02-06 09:44:49 +0200 |
---|---|---|
committer | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2020-02-11 10:40:30 +0200 |
commit | fce4129435ddc5f14abdd1e2ed6a74bf84e1c496 (patch) | |
tree | b0195f13b1783298f940dc0ccf72dac6098532dd /src/mbgl/style/sources | |
parent | a23100586098c2d44682444cdd31001f1eba5859 (diff) | |
download | qtlocation-mapboxgl-fce4129435ddc5f14abdd1e2ed6a74bf84e1c496.tar.gz |
[core] Add runtime API for setting tile prefetch delta for Source
New setPrefetchZoomDelta(optional<uint8_t> delta) method allow overriding
default tile prefetch setting that is defined by the Map instance. The
method can be moved to generic style specification if found to be useful
for gl-js engine.
Diffstat (limited to 'src/mbgl/style/sources')
-rw-r--r-- | src/mbgl/style/sources/custom_geometry_source.cpp | 6 | ||||
-rw-r--r-- | src/mbgl/style/sources/geojson_source.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/style/sources/image_source.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/style/sources/raster_source.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/style/sources/vector_source.cpp | 4 |
5 files changed, 21 insertions, 1 deletions
diff --git a/src/mbgl/style/sources/custom_geometry_source.cpp b/src/mbgl/style/sources/custom_geometry_source.cpp index 1076cbf417..113298dd3c 100644 --- a/src/mbgl/style/sources/custom_geometry_source.cpp +++ b/src/mbgl/style/sources/custom_geometry_source.cpp @@ -27,7 +27,7 @@ const CustomGeometrySource::Impl& CustomGeometrySource::impl() const { } void CustomGeometrySource::loadDescription(FileSource&) { - baseImpl = makeMutable<CustomGeometrySource::Impl>(impl(), loader->self()); + baseImpl = makeMutable<Impl>(impl(), loader->self()); loaded = true; observer->onSourceLoaded(*this); } @@ -49,5 +49,9 @@ void CustomGeometrySource::invalidateRegion(const LatLngBounds& bounds) { loader->self().invoke(&CustomTileLoader::invalidateRegion, bounds, impl().getZoomRange()); } +Mutable<Source::Impl> CustomGeometrySource::createMutable() const noexcept { + return staticMutableCast<Source::Impl>(makeMutable<Impl>(impl())); +} + } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/sources/geojson_source.cpp b/src/mbgl/style/sources/geojson_source.cpp index 3afccf07f2..2880b9b131 100644 --- a/src/mbgl/style/sources/geojson_source.cpp +++ b/src/mbgl/style/sources/geojson_source.cpp @@ -120,5 +120,9 @@ bool GeoJSONSource::supportsLayerType(const mbgl::style::LayerTypeInfo* info) co return mbgl::underlying_type(Tile::Kind::Geometry) == mbgl::underlying_type(info->tileKind); } +Mutable<Source::Impl> GeoJSONSource::createMutable() const noexcept { + return staticMutableCast<Source::Impl>(makeMutable<Impl>(impl())); +} + } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/sources/image_source.cpp b/src/mbgl/style/sources/image_source.cpp index d55f7c9f09..ec727a33bd 100644 --- a/src/mbgl/style/sources/image_source.cpp +++ b/src/mbgl/style/sources/image_source.cpp @@ -87,5 +87,9 @@ bool ImageSource::supportsLayerType(const mbgl::style::LayerTypeInfo* info) cons return mbgl::underlying_type(Tile::Kind::Raster) == mbgl::underlying_type(info->tileKind); } +Mutable<Source::Impl> ImageSource::createMutable() const noexcept { + return staticMutableCast<Source::Impl>(makeMutable<Impl>(impl())); +} + } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/sources/raster_source.cpp b/src/mbgl/style/sources/raster_source.cpp index f90306945e..8c41da3a23 100644 --- a/src/mbgl/style/sources/raster_source.cpp +++ b/src/mbgl/style/sources/raster_source.cpp @@ -87,5 +87,9 @@ bool RasterSource::supportsLayerType(const mbgl::style::LayerTypeInfo* info) con return mbgl::underlying_type(Tile::Kind::Raster) == mbgl::underlying_type(info->tileKind); } +Mutable<Source::Impl> RasterSource::createMutable() const noexcept { + return staticMutableCast<Source::Impl>(makeMutable<Impl>(impl())); +} + } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/sources/vector_source.cpp b/src/mbgl/style/sources/vector_source.cpp index 510106adb9..cc2319b302 100644 --- a/src/mbgl/style/sources/vector_source.cpp +++ b/src/mbgl/style/sources/vector_source.cpp @@ -91,5 +91,9 @@ bool VectorSource::supportsLayerType(const mbgl::style::LayerTypeInfo* info) con return mbgl::underlying_type(Tile::Kind::Geometry) == mbgl::underlying_type(info->tileKind); } +Mutable<Source::Impl> VectorSource::createMutable() const noexcept { + return staticMutableCast<Source::Impl>(makeMutable<Impl>(impl())); +} + } // namespace style } // namespace mbgl |