Esempio n. 1
0
void EditPlacemarkDialog::updateTextAnnotation()
{
    d->m_placemark->setDescription( d->m_formattedTextWidget->text() );
    //allow for HTML in the description
    d->m_placemark->setDescriptionCDATA( true );
    d->m_placemark->setName( d->m_header->name() );
    d->m_placemark->setCoordinate( GeoDataCoordinates( d->m_header->longitude(),
                                                                         d->m_header->latitude(),
                                                                         0,
                                                                         GeoDataCoordinates::Degree ) );

    d->m_placemark->setVisible( d->m_isPlacemarkVisible->isChecked() );
    d->m_placemark->setBalloonVisible( d->m_isBalloonVisible->isChecked() );
    d->m_placemark->setId( d->m_header->id() );
    d->m_placemark->setTargetId( d->m_header->targetId() );

    GeoDataStyle *newStyle = new GeoDataStyle( *d->m_placemark->style() );

    QFileInfo fileInfo( d->m_header->iconLink() );
    if ( fileInfo.exists() ) {
        newStyle->iconStyle().setIconPath( d->m_header->iconLink() );
    }

    newStyle->iconStyle().setScale( d->m_iconScale->value() );
    newStyle->labelStyle().setScale( d->m_labelScale->value() );

    newStyle->iconStyle().setColor( d->m_iconColorDialog->currentColor() );
    newStyle->labelStyle().setColor( d->m_labelColorDialog->currentColor() );

    d->m_placemark->setStyle( newStyle );

    emit textAnnotationUpdated( d->m_placemark );
}
Esempio n. 2
0
void EditPlacemarkDialog::updateTextAnnotation()
{
    d->m_placemark->setDescription( d->m_formattedTextWidget->text() );
    //allow for HTML in the description
    d->m_placemark->setDescriptionCDATA( true );
    d->m_placemark->setName( d->m_header->name() );
    d->m_placemark->setCoordinate( GeoDataCoordinates( d->m_header->longitude(),
                                                                         d->m_header->latitude(),
                                                                         0,
                                                                         GeoDataCoordinates::Degree ) );

    d->m_placemark->setVisible( d->m_isPlacemarkVisible->isChecked() );
    d->m_placemark->setBalloonVisible( d->m_isBalloonVisible->isChecked() );
    d->m_placemark->setId( d->m_header->id() );
    d->m_placemark->setTargetId( d->m_header->targetId() );


    if ( !d->m_header->iconLink().isEmpty() ) {
        QFileInfo fileInfo( d->m_header->iconLink() );

        GeoDataStyle *newStyle = new GeoDataStyle( *d->m_placemark->style() );
        if ( fileInfo.exists() ) {
            newStyle->iconStyle().setIconPath( d->m_header->iconLink() );
        }

        newStyle->iconStyle().setScale( d->m_iconScale->value() );
        newStyle->labelStyle().setScale( d->m_labelScale->value() );
        newStyle->iconStyle().setColor( d->m_iconColorDialog->currentColor() );
        newStyle->labelStyle().setColor( d->m_labelColorDialog->currentColor() );
        d->m_placemark->setStyle( newStyle );
    }
    else {
        QString suitableTag = d->m_osmTagEditorWidget->suitableTag();
        if ( !suitableTag.isEmpty() ) {
            GeoDataFeature::GeoDataVisualCategory category = OsmPresetLibrary::osmVisualCategory( suitableTag );
            d->m_placemark->setVisualCategory( category );
            d->m_placemark->setStyle( 0 );
        }
    }

    emit textAnnotationUpdated( d->m_placemark );
}