Map: make POI display optional
This commit is contained in:
parent
33eb4a55fb
commit
d5bc2d4629
1 changed files with 16 additions and 11 deletions
|
@ -508,6 +508,7 @@ void MapWidget::setProperty(SGPropertyNode_ptr prop)
|
||||||
|
|
||||||
createPropertyIfRequired(_root, "centre-on-aircraft", true);
|
createPropertyIfRequired(_root, "centre-on-aircraft", true);
|
||||||
createPropertyIfRequired(_root, "draw-data", false);
|
createPropertyIfRequired(_root, "draw-data", false);
|
||||||
|
createPropertyIfRequired(_root, "draw-pois", true);
|
||||||
createPropertyIfRequired(_root, "draw-flight-history", false);
|
createPropertyIfRequired(_root, "draw-flight-history", false);
|
||||||
createPropertyIfRequired(_root, "magnetic-headings", true);
|
createPropertyIfRequired(_root, "magnetic-headings", true);
|
||||||
createPropertyIfRequired(_root, "key-pan", true);
|
createPropertyIfRequired(_root, "key-pan", true);
|
||||||
|
@ -714,7 +715,10 @@ void MapWidget::update()
|
||||||
newItemsToDraw.insert(newItemsToDraw.end(), navs.begin(), navs.end());
|
newItemsToDraw.insert(newItemsToDraw.end(), navs.begin(), navs.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bool drawPOIs = _root->getBoolValue("draw-pois");
|
||||||
|
if (drawPOIs) {
|
||||||
FGPositioned::TypeFilter tf(FGPositioned::COUNTRY);
|
FGPositioned::TypeFilter tf(FGPositioned::COUNTRY);
|
||||||
|
|
||||||
if (_cachedZoom <= SHOW_DETAIL_ZOOM) {
|
if (_cachedZoom <= SHOW_DETAIL_ZOOM) {
|
||||||
tf.addType(FGPositioned::CITY);
|
tf.addType(FGPositioned::CITY);
|
||||||
}
|
}
|
||||||
|
@ -725,6 +729,7 @@ void MapWidget::update()
|
||||||
|
|
||||||
FGPositionedList poi = FGPositioned::findWithinRange(_projectionCenter, _drawRangeNm, &tf);
|
FGPositionedList poi = FGPositioned::findWithinRange(_projectionCenter, _drawRangeNm, &tf);
|
||||||
newItemsToDraw.insert(newItemsToDraw.end(), poi.begin(), poi.end());
|
newItemsToDraw.insert(newItemsToDraw.end(), poi.begin(), poi.end());
|
||||||
|
}
|
||||||
|
|
||||||
_itemsToDraw.swap(newItemsToDraw);
|
_itemsToDraw.swap(newItemsToDraw);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue