This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Marble::GeoTagWriter in libmarblewidget.dll

Tags: None
(comma "," separated)
vfr
Registered Member
Posts
3
Karma
0
Hi

I wanted to write a KML file from some placemarks, that the user has added in my application.

I found the classes Marble::GeoWriter, Marble::GeoTagWriter and all the KmlXYZTagWriter's. Unfortunately these classes are not exported when building the libmarblewidget.dll under Windows (in Linux it is working as expected and the KML file is correct).

I did the following:

Code: Select all
    QFile file(fileName);
    file.open(QIODevice::WriteOnly | QIODevice::Text);
    GeoWriter writer;
    GeoDataDocument document;
    for (int i = 0; i < m_routeModel->rowCount(); i++)
    {
        RouteWaypoint *waypoint = m_routeModel->getWaypoint(i);
        GeoDataPlacemark *placemarkTemp = new Marble::GeoDataPlacemark(waypoint->getName());
        placemarkTemp->setCoordinate(waypoint->getCoordinates());
        placemarkTemp->setId(waypoint->getCode());
        placemarkTemp->setName(waypoint->getName());
        document.append(placemarkTemp);
    }

    writer.setDocumentType(QString("http://www.opengis.net/kml/2.2"));
    KmlDocumentTagWriter tagWriter;
    tagWriter.write(&document,writer);
    writer.write(&file, &document);
    file.close();


I wonder if this is the right approach? Do I have to patch the headers in src/lib/marble/geodata/writers so that the classes will be exported in the dll?

Thanks a lot?


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]