Registered Member
|
Hi,
I want to show the content of a .nmea file in a MarbleWidget. For this purpose I wanted to use placemarks. But it seems that the MarbleWidget does not show them.
|
KDE Developer
|
In the code snippet, where is lon, lat defined? And when is the line containing $GPGGA parsed? Doesn't seem to happen anywhere.
The easiest way to visualize a .nmea file is to transform it to .gpx before:
The --enableFileView parameter is not strictly needed, but it creates a new tab on the left of Marble where you can examine the contents of the loaded file. You can also use File -> Open inside marble to load a .gpx file. |
KDE Developer
|
Of course Dennis' suggestion might be the more convenient way. Still your code looks mostly alright on first glimpse. So I'm still a bit curious why it doesn't work. If it's just due to the missing lon/lat definition do your placemarks appear at 0°N 0°E by chance?
|
Registered Member
|
Hi,
the code snipped is only part of the code. And the placemark seems to be at the correct position, because
goes to the right position. But the green line is not visible there. |
KDE Developer
|
Hello,
if you are using MarbleWidget::addPlacemark, then you must be using a 4.5 or 4.6 release of marble, which is at best one year old. For now a stable version of KDE is 4.8 Unless you have a pressing need to stick to such environment, I would first recommend to use a more recent release, because we keep improving on the geodata rendering department from release to release. Now even considering a 4.6, you are basically using the Bookmark management, which is slightly different from the generic Placemark rendering. (Bookmark is a special case of point placemarks which are stored in a marble specific file, whereas you are looking for a generic geometry Placemark). The api alternatives would be to either: - do your file parsing, generate a kml string for your placemark, and use widget->model()->addGeoDataString (convoluted but the historical api) - use the FileManager, but i'm not sure if it ever was part of the public api - in 4.8+ use the widget()->model()->treeModel() (now a GeoDataTreeModel) which is the recommended way to interact with geodata now. You can find usecases how geodata documents are handled in PositionTracking (internal code though), of in the recent Satellite plugin (which reads data from file and manipulates the treeModel to insert its satellites tracks) Hth, if you have more questions feel free to ask. |
Registered Member
|
Hi,
I think there is another problem. Even if I use
I cannot see any overlays in the map. Also if I start the normal marble application (PRE 0.12.0 SVN) and load a .kml file (https://developers.google.com/kml/docum ... amples.kml) I cannot see it in the map. |
KDE Developer
|
The "PRE" indicates that you are not running a stable release of Marble but instead a development snapshot that might have bugs. Therefore PRE 0.12.0 SVN is likely more than a year old (and lacks a vast amount of bugfixes and features).
However even with the current version of Marble we lack support for certain features. When loading the KML Samples file I can at least spot the "Simple Placemark" on the map. If you load https://developers.google.com/kml/docum ... states.kml does it show the us states like this: http://edu.kde.org/marble/screenshots/g ... le-kml.png It should. |
Registered Member
|
Hi,
this .kml example works fine. But why are my placemarks not drawn? From where do I get the current stable release sources? Maybe this fixes the problem. |
KDE Developer
|
|
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell