Ejemplo n.º 1
0
PositionTracking::PositionTracking( GeoDataTreeModel *model )
     : QObject( model ),
       d( new PositionTrackingPrivate( model, this ) )
{
    d->m_document.setDocumentRole( TrackingDocument );
    d->m_document.setName("Position Tracking");

    // First point is current position
    d->m_currentPositionPlacemark->setName("Current Position");
    d->m_currentPositionPlacemark->setVisible(false);
    d->m_document.append( d->m_currentPositionPlacemark );

    // Second point is position track
    d->m_currentTrack = new GeoDataTrack;
    d->m_trackSegments->append(d->m_currentTrack);

    d->m_currentTrackPlacemark->setGeometry(d->m_trackSegments);
    d->m_currentTrackPlacemark->setName("Current Track");

    GeoDataStyle style;
    GeoDataLineStyle lineStyle;
    QColor transparentRed = Oxygen::brickRed4;
    transparentRed.setAlpha( 200 );
    lineStyle.setColor( transparentRed );
    lineStyle.setWidth( 4 );
    style.setLineStyle(lineStyle);
    style.setId("track");

    GeoDataStyleMap styleMap;
    styleMap.setId("map-track");
    styleMap.insert("normal", QString("#").append(style.id()));
    d->m_document.addStyleMap(styleMap);
    d->m_document.addStyle(style);
    d->m_document.append( d->m_currentTrackPlacemark );

    d->m_currentTrackPlacemark->setStyleUrl(QString("#").append(styleMap.id()));

    d->m_treeModel->addDocument( &d->m_document );
}
Ejemplo n.º 2
0
void GeoDataDocument::addStyleMap( const GeoDataStyleMap& map )
{
    Q_D(GeoDataDocument);
    d->m_styleMapHash.insert(map.id(), map);
    d->m_styleMapHash[map.id()].setParent(this);
}