[Marble-devel] Re: Show GPS Position in MarbleWidget

Dennis Nienhüser earthwings at gentoo.org
Wed Apr 13 17:09:04 CEST 2011


Hi Malte,

I extended the QML bindings now to provide access to position tracking. 
See the example [1] for the usage in QML. You get access to the current 
position (and whether it is available) and you can configure whether to 
show the track. Additionally you can set any QML element to be shown as 
the position indicator.
I'll add a center property as well next so that it's possible to do e.g. 
auto centering on the current position. If you need more, please reply; 
I'm interested to see more use cases to extend the API.

Regards,
Dennis

[1] 
https://projects.kde.org/projects/kde/kdeedu/marble/repository/revisions/master/entry/examples/qml/position-tracking/position-tracking.qml

On 01.04.2011 11:06, Malte Klug wrote:
> Hello everybody,
>
> I am fairly new to Marble, as I have only been working with it for a couple of days. What I am currently doing is using the MarbleWidget in a QML file as a part of an application. For this purpose, I have wrapped the MarbleWidget in a class inheriting from QGraphicsProxyWidget in order to register this class as a new QML type. All the configuration I needed to do (e.g. setShowCrosshairs(false)) is done in the constructor of said wrapper class. Up to here everything went well.
> Now I am trying to show the GPS position. I assumed this would be possible by calling MarbleWidget's setShowGps(true). However, this seems to have no effect at all, although showGps() returns true. My GPS position provider is gpsd, which works fine. I was able to verify this using xgps, even the Marble application itself shows the position when activated under "Current Location". I read every Marble tutorial, how-to and example I could get my hands on and also briefly checked the archive of this mailing list, but I have not found anything on how to get the GPS position shown in MarbleWidget. I do not know, whether I am totally missing out something, but I did not manage to make any progress in this, so maybe you guys could give me a hint on how I could go on/solve the issue.
> Here are some further information about the environment I am developing in: I use Ubuntu 10.10, Qt 4.7 and QtCreator.
>
> Thanks in advance
> Malte Klug



More information about the Marble-devel mailing list