[Marble-devel] Adding placemarks to MarbleWidget

Kishore kitts.mailinglists at gmail.com
Tue Sep 1 08:46:20 CEST 2009


Thanks for your reply Michael.

On Tuesday 01 Sep 2009 11:30:20 am you wrote:
> Hi Kishore,
>
> I am in a similar situation as you, currently working on clustering
> support in digikam:
> https://bugs.kde.org/show_bug.cgi?id=205001

I've learned a bunch from that patch. Thanks a lot. Also thanks for working on 
digikam! :)

> For drawing custom placemarks and lines between them, also have a look
> at trippy:
> http://github.com/mghansen256/trippy/tree/master
>
> It just subclasses MarbleWidget and then implements customPaint and does
> not use any KML. It does not implement any drag-and-drop like behavior,
> though. If you need custom mouse interaction, you could add an
> eventfilter to Marble and handle mouse clicks there (have a look at my
> patch for digikam for that).

I am currently working with the custom paint / eventfilter method but seemed a 
bit hackish. I was hoping that marble had a better mechanism as it is a 
library widget meant to be extended by applications. I looked at it basically 
as the QGraphicsView like framework for spherical globes. Nevertheless, 
MArbleWidget is quite an extensive piece of work!

> Better access to drawing functionality (GraphicsItems, etc) is only
> provided for plugins (see thread from a few days ago), and plugins have
> to be shipped as separate shared libraries. Currently there is no way to
> simply say widget->addPlugin() for a plugin residing in your executable.
> But you can write a plugin for the drawing part, and then access it from
> your client application by browsing through
> MarbleWidget::map()->renderPlugins() - that worked for me. In the long
> run, we can send a patch to Torsten for easier access.

Yes. I would like that.
> Hope that helps,
>
> Michael
>
>
>
>
>
> It does not implement any drag-and-drop like behavior, though.
>
> Kishore wrote:
> > Hi, I am using MarbleWidget in my Qt application. In my application, i
> > want the widget to put in some placemarks on the map and draw some
> > primitives (like lines between placemarks). The user should be able to
> > drag a placemark to a new location and when  he does that i need a
> > mechanism to be informed of the new location.
> >
> > What is the best way to achieve this? Looking at MarbleWidget API is not
> > obvious to me. There also is a MarbleGraphicsItem class that is probably
> > the way to go, but i see to obvious way to register my item with
> > MarbleWidget so that it is rendered and managed by it.
> >
> > I have QGraphicsScene in mind and i am trying to draw a parallel with the
> > MarbleWidget API. QGraphicsScene has addItem(QGraphicsItem *) but
> > MarbleWidget has no equivalent addItem(MArbleGraphicsItem *) API.

-- 
Cheers!
Kishore


More information about the Marble-devel mailing list