[Marble-devel] Adding placemarks to MarbleWidget

Torsten Rahn tackat at t-online.de
Tue Sep 1 10:56:05 CEST 2009


Hi Kishore,

Am Dienstag 01 September 2009 08:46:20 schrieb Kishore:
> 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

It would be cool if we had something like clustering somehow supported for the 
MarbleWidget directly (ideally on GeoGraphicsItem / GeoGraphicsScene level). 
:-) Of course this would then also need to work together with anti-
item-/label-collision support.

> > For drawing custom placemarks and lines between them, also have a look
> > at trippy:
> > http://github.com/mghansen256/trippy/tree/master
> 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!

Regarding Event-Handling you can also take a look at the OnlineService Plugins 
how they handle events. Marble 0.8 only really actively supports painting via 
the GeoPainter -- everything else needs to be implemented manually.

Of course the future solution will be to use GeoGraphicsItems. As you have 
figured out already the GraphicsItem stuff is still in development (that's why 
you only find it in the development version in SVN trunk)

So currently there is no ready to use GeoGraphicsScene there yet. But of 
course we want to have that for the next 0.9 release.

> > 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, if somebody created a patch which would allow an application to have an 
"own", "private" custom plugin and that could be registered on the fly that 
would probably be the best solution.

Oh another thing: If you feel that there is documentation missing for some 
feature and if you feel that you can provide some paragraphs for the wiki then 
don't hesitate to add stuff to http://techbase.kde.org/Projects/Marble . Just 
make sure that you tell us about it once you are done so we can review it ---  
either on this mailing list or on IRC / #marble.

Thanks,

Torsten

> 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.
> 



More information about the Marble-devel mailing list