29 : QGeoTiledMappingManagerEngine(parent)
30 , m_networkManager(networkManager)
32 qCDebug(QGeoTiledMappingManagerEngineQGCLog) <<
this;
34 setLocale(
qgcApp()->getCurrentLanguage());
39 QGeoCameraCapabilities cameraCaps{};
40 cameraCaps.setTileSize(256);
41 cameraCaps.setMinimumZoomLevel(2.0);
43 cameraCaps.setSupportsBearing(
true);
44 cameraCaps.setSupportsRolling(
false);
45 cameraCaps.setSupportsTilting(
false);
46 cameraCaps.setMinimumTilt(0.0);
47 cameraCaps.setMaximumTilt(0.0);
48 cameraCaps.setMinimumFieldOfView(45.0);
49 cameraCaps.setMaximumFieldOfView(45.0);
50 cameraCaps.setOverzoomEnabled(
true);
51 setCameraCapabilities(cameraCaps);
53 setTileVersion(kTileVersion);
54 setTileSize(QSize(256, 256));
56 QList<QGeoMapType> mapList;
59 const QGeoMapType map = QGeoMapType(
60 provider->getMapStyle(),
61 provider->getMapName(),
62 provider->getMapName(),
66 QByteArrayLiteral(
"QGroundControl"),
71 setSupportedMapTypes(mapList);
73 setCacheHint(QAbstractGeoTileCache::CacheArea::AllCaches);
75 setTileCache(fileTileCache);
78 static std::once_flag mapEngineInit;
79 std::call_once(mapEngineInit, [fileTileCache]() {
84 (void) connect(QNetworkInformation::instance(), &QNetworkInformation::reachabilityChanged,
this, [
this](QNetworkInformation::Reachability newReachability) {
85 if (newReachability == QNetworkInformation::Reachability::Online) {
86 m_prefetchStyle = QGeoTiledMap::PrefetchTwoNeighbourLayers;
88 m_prefetchStyle = QGeoTiledMap::NoPrefetching;
92 Q_ASSERT(m_networkManager);
95 *
error = QGeoServiceProvider::NoError;
97 setTileFetcher(tileFetcher);