@@ -20,28 +20,28 @@ using namespace style;
|
||||
|
||||
std::unique_ptr<RenderSource> RenderSource::create(const Immutable<Source::Impl>& impl) {
|
||||
switch (impl->type) {
|
||||
case SourceType::Vector:
|
||||
return std::make_unique<RenderVectorSource>(staticImmutableCast<VectorSource::Impl>(impl));
|
||||
case SourceType::Raster:
|
||||
return std::make_unique<RenderRasterSource>(staticImmutableCast<RasterSource::Impl>(impl));
|
||||
case SourceType::RasterDEM:
|
||||
return std::make_unique<RenderRasterDEMSource>(staticImmutableCast<RasterSource::Impl>(impl));
|
||||
case SourceType::GeoJSON:
|
||||
return std::make_unique<RenderGeoJSONSource>(staticImmutableCast<GeoJSONSource::Impl>(impl));
|
||||
case SourceType::Video:
|
||||
assert(false);
|
||||
return nullptr;
|
||||
case SourceType::Annotations:
|
||||
if (LayerManager::annotationsEnabled) {
|
||||
return std::make_unique<RenderAnnotationSource>(staticImmutableCast<AnnotationSource::Impl>(impl));
|
||||
} else {
|
||||
case SourceType::Vector:
|
||||
return std::make_unique<RenderVectorSource>(staticImmutableCast<VectorSource::Impl>(impl));
|
||||
case SourceType::Raster:
|
||||
return std::make_unique<RenderRasterSource>(staticImmutableCast<RasterSource::Impl>(impl));
|
||||
case SourceType::RasterDEM:
|
||||
return std::make_unique<RenderRasterDEMSource>(staticImmutableCast<RasterSource::Impl>(impl));
|
||||
case SourceType::GeoJSON:
|
||||
return std::make_unique<RenderGeoJSONSource>(staticImmutableCast<GeoJSONSource::Impl>(impl));
|
||||
case SourceType::Video:
|
||||
assert(false);
|
||||
return nullptr;
|
||||
}
|
||||
case SourceType::Image:
|
||||
return std::make_unique<RenderImageSource>(staticImmutableCast<ImageSource::Impl>(impl));
|
||||
case SourceType::CustomVector:
|
||||
return std::make_unique<RenderCustomGeometrySource>(staticImmutableCast<CustomGeometrySource::Impl>(impl));
|
||||
case SourceType::Annotations:
|
||||
if (LayerManager::annotationsEnabled) {
|
||||
return std::make_unique<RenderAnnotationSource>(staticImmutableCast<AnnotationSource::Impl>(impl));
|
||||
} else {
|
||||
assert(false);
|
||||
return nullptr;
|
||||
}
|
||||
case SourceType::Image:
|
||||
return std::make_unique<RenderImageSource>(staticImmutableCast<ImageSource::Impl>(impl));
|
||||
case SourceType::CustomVector:
|
||||
return std::make_unique<RenderCustomGeometrySource>(staticImmutableCast<CustomGeometrySource::Impl>(impl));
|
||||
}
|
||||
|
||||
// Not reachable, but placate GCC.
|
||||
@@ -53,8 +53,7 @@ static RenderSourceObserver nullObserver;
|
||||
|
||||
RenderSource::RenderSource(Immutable<style::Source::Impl> impl)
|
||||
: baseImpl(std::move(impl)),
|
||||
observer(&nullObserver) {
|
||||
}
|
||||
observer(&nullObserver) {}
|
||||
|
||||
RenderSource::~RenderSource() = default;
|
||||
|
||||
@@ -74,7 +73,7 @@ bool RenderSource::isEnabled() const {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
uint8_t RenderSource::getMaxZoom() const {
|
||||
uint8_t RenderSource::getMaxZoom() const {
|
||||
assert(false);
|
||||
return util::TERRAIN_RGB_MAXZOOM;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user