Changeset 6487 for geovis


Ignore:
Timestamp:
Aug 17, 2016 6:10:21 PM (8 years ago)
Author:
ldelgass
Message:

Display elevation in coordinate readout if an elevation layer is present in the
map.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • geovis/trunk/MouseCoordsTool.h

    r6253 r6487  
    4242        TRACE("%g %g %g", mapCoords.x(), mapCoords.y(), mapCoords.z());
    4343        if (_label.valid()) {
    44             _label->setText(osgEarth::Stringify()
    45                             << _prefix
    46                             <<  _formatter->format(mapCoords));
    47                             //<< ", " << mapCoords.z());
     44            if (mapNode->getMap()->getNumElevationLayers() > 0) {
     45                _label->setText(osgEarth::Stringify()
     46                                << _prefix
     47                                <<  _formatter->format(mapCoords)
     48                                << "\nElev: " << mapCoords.z() << " m");
     49            } else {
     50                _label->setText(osgEarth::Stringify()
     51                                << _prefix
     52                                <<  _formatter->format(mapCoords));
     53            }
    4854        }
    4955        _pt = mapCoords;
Note: See TracChangeset for help on using the changeset viewer.