7#include "KmlGroundOverlayWriter.h"
9#include "GeoDataLatLonQuad.h"
10#include "GeoDataGroundOverlay.h"
11#include "GeoDataTypes.h"
13#include "KmlElementDictionary.h"
18static GeoTagWriterRegistrar s_writerLookAt(
20 kml::kmlTag_nameSpaceOgc22 ),
21 new KmlGroundOverlayWriter );
23KmlGroundOverlayWriter::KmlGroundOverlayWriter() : KmlOverlayTagWriter( kml::kmlTag_GroundOverlay )
28bool KmlGroundOverlayWriter::writeMid(
const GeoNode *node, GeoWriter &writer)
const
30 KmlOverlayTagWriter::writeMid( node, writer );
32 const GeoDataGroundOverlay *ground_overlay =
33 static_cast<const GeoDataGroundOverlay*
>( node );
35 writer.writeOptionalElement( kml::kmlTag_altitude,
37 KmlGroundOverlayWriter::writeAltitudeMode( writer, ground_overlay->altitudeMode() );
39 if ( !ground_overlay->latLonBox().isEmpty() ) {
40 writeElement( &ground_overlay->latLonBox(), writer );
43 if ( ground_overlay->latLonQuad().isValid() ) {
44 writeElement( &ground_overlay->latLonQuad(), writer );
50QString KmlGroundOverlayWriter::altitudeModeToString(AltitudeMode mode)
54 return "clampToGround";
56 return "relativeToGround";
58 return "clampToSeaFloor";
60 return "relativeToSeaFloor";
67void KmlGroundOverlayWriter::writeAltitudeMode(GeoWriter& writer, AltitudeMode altMode)
69 if ( altMode == ClampToGround ) {
74 const QString altitudeMode = KmlGroundOverlayWriter::altitudeModeToString( altMode );
76 if ( isGoogleExtension ) {
78 writer.writeElement( kml::kmlTag_nameSpaceGx22, kml::kmlTag_altitudeMode, altitudeMode);
80 writer.writeElement( kml::kmlTag_altitudeMode, altitudeMode );
QPair< QString, QString > QualifiedName
Object Name and Namespace Pair This type is intended to be used in a similar way to.
Binds a QML item to a specific geodetic location in screen coordinates.
@ RelativeToGround
Altitude is always given relative to ground level.
@ ClampToSeaFloor
Altitude always sticks to sea floor.
@ ClampToGround
Altitude always sticks to ground level.
@ RelativeToSeaFloor
Altitude is given relative to the sea floor.
@ Absolute
Altitude is given relative to the sealevel.
QString number(double n, char format, int precision)