1
0
Fork 0

Map: make POI display optional

This commit is contained in:
James Turner 2022-01-07 11:16:13 +00:00
parent 33eb4a55fb
commit d5bc2d4629

View file

@ -508,6 +508,7 @@ void MapWidget::setProperty(SGPropertyNode_ptr prop)
createPropertyIfRequired(_root, "centre-on-aircraft", true);
createPropertyIfRequired(_root, "draw-data", false);
createPropertyIfRequired(_root, "draw-pois", true);
createPropertyIfRequired(_root, "draw-flight-history", false);
createPropertyIfRequired(_root, "magnetic-headings", true);
createPropertyIfRequired(_root, "key-pan", true);
@ -714,18 +715,22 @@ void MapWidget::update()
newItemsToDraw.insert(newItemsToDraw.end(), navs.begin(), navs.end());
}
FGPositioned::TypeFilter tf(FGPositioned::COUNTRY);
if (_cachedZoom <= SHOW_DETAIL_ZOOM) {
tf.addType(FGPositioned::CITY);
const bool drawPOIs = _root->getBoolValue("draw-pois");
if (drawPOIs) {
FGPositioned::TypeFilter tf(FGPositioned::COUNTRY);
if (_cachedZoom <= SHOW_DETAIL_ZOOM) {
tf.addType(FGPositioned::CITY);
}
if (_cachedZoom <= SHOW_DETAIL2_ZOOM) {
tf.addType(FGPositioned::TOWN);
}
FGPositionedList poi = FGPositioned::findWithinRange(_projectionCenter, _drawRangeNm, &tf);
newItemsToDraw.insert(newItemsToDraw.end(), poi.begin(), poi.end());
}
if (_cachedZoom <= SHOW_DETAIL2_ZOOM) {
tf.addType(FGPositioned::TOWN);
}
FGPositionedList poi = FGPositioned::findWithinRange(_projectionCenter, _drawRangeNm, &tf);
newItemsToDraw.insert(newItemsToDraw.end(), poi.begin(), poi.end());
_itemsToDraw.swap(newItemsToDraw);
updateAIObjects();