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,18 +715,22 @@ void MapWidget::update()
|
||||||
newItemsToDraw.insert(newItemsToDraw.end(), navs.begin(), navs.end());
|
newItemsToDraw.insert(newItemsToDraw.end(), navs.begin(), navs.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
FGPositioned::TypeFilter tf(FGPositioned::COUNTRY);
|
const bool drawPOIs = _root->getBoolValue("draw-pois");
|
||||||
if (_cachedZoom <= SHOW_DETAIL_ZOOM) {
|
if (drawPOIs) {
|
||||||
tf.addType(FGPositioned::CITY);
|
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);
|
_itemsToDraw.swap(newItemsToDraw);
|
||||||
|
|
||||||
updateAIObjects();
|
updateAIObjects();
|
||||||
|
|
Loading…
Reference in a new issue