[Marble-devel] Re: programmatically adding an AbstractDataPlugin to MarbleWidget?

Ákos Maróy akos at maroy.hu
Thu Mar 31 21:08:37 CEST 2011


Bernhard,

> Have you tried adding your plugin by means of MarbleMap::addLayer()?
> AbstractDataPlugin inherits from LayerInterface, which is what this
> method expects.

to be more specific, I tried to replicate the results from this
tutorial: http://techbase.kde.org/Projects/Marble/LayerInterface

but I get stuck in this call:

MarbleWidget *mapWidget = new MarbleWidget;

// Create and register our paint layer
MyPaintLayer* layer = new MyPaintLayer(mapWidget);
mapWidget->map()->model()->addLayer(layer);



as there is no MarbleWidget::map() function in the current (trunk) API,
there is a MarbleWidget::model() fuction, but then the function
MarbleModel::addLayer() is non-existent by now.


looking at the stable (subversion) API, I don't see how the above would
work either, as MarbleWidget::map() is a const function, whereas
addLayer() will require a non-const pointer to work on.


thus I wonder what the current, up-to-date method for adding layers /
plugins is..


Akos



More information about the Marble-devel mailing list