[Marble-devel] GroundOverlay

Dennis Nienhüser earthwings at gentoo.org
Wed Jun 20 12:24:07 UTC 2012


Hi Konrad,

thanks for reporting, sounds plausible. Previously a default constructed 
LatLonBox had the size of the sphere, now it is empty. The items in the 
scene are supposed to report their size to avoid needless renderings of 
them. Therefore if the size was reported as a default constructed box 
before it was (always no matter the viewport) rendered, now that bug is 
revealed. Your fix looks correct to me, I'll look into it in more detail 
this evening and commit it.

Regards,
Dennis

Am 20.06.2012 13:13, schrieb Konrad Enzensberger:
>
> Hi,
>
> after updating from repository i am facing a problem importing
>
> KML with GroundOverlayTag .
>
> GroundOverlay worked perfect in previous version (from 14.05.2012)
>
> The referenced image is not displayed on the map because of
>
> the /GeoImageGraphicsItem::paint()/ is never called.
>
> paint() is not called because of:
>
> /GeometryLayer::render(...)/
>
> /... /
>
> /QList<GeoGraphicsItem*> items = d->m_scene.items( 
> viewport->viewLatLonAltBox(), maxZoomLevel );/
>
> /... /
>
> returns allways a empty list.
>
> Doing more investigation i found that:
>
> /void GeometryLayerPrivate::createGraphicsItemFromOverlay( const 
> GeoDataOverlay *overlay )/
>
> /{/
>
> /  .../
>
> /  m_scene.addItem( item ); /
>
> creates and adds the GeoImageGraphicsItem to the scene, but the methode:
>
> /void GeoGraphicsScene::addItem( GeoGraphicsItem* item )/
> /{/
> /    // Select zoom level so that the object fit in single tile/
> /    int zoomLevel;/
> /    qreal north, south, east, west;/
> /    item->latLonAltBox().boundaries( north, south, east, west );/
>
> allways returns 0 for the north, south, east, and west values.
>
> Problem: the /GeoGraphicsItemPrivate - GeoDataLatLonAltBox 
> m_latLonAltBox;/
>
> is never set.
>
> I see that in GeometryLayerPrivate::createGraphicsItemFromOverlay(...),
>
> the LatLonBox is set for the GeoImageGraphicsItem:
>
> /imageItem->setLatLonBox( groundOverlay->latLonBox() );/
>
> But this has no effect for the 
> /GeoGraphicsItemPrivate::m_latLonAltBox/ member
>
> For a quick bugfix i add this line to:
>
> /void GeometryLayerPrivate::createGraphicsItemFromOverlay( const 
> GeoDataOverlay *overlay )/
> /{/
> /    GeoGraphicsItem* item = 0;/
> /    if ( overlay->nodeType() == 
> GeoDataTypes::GeoDataGroundOverlayType ) {/
> /        GeoDataGroundOverlay const * groundOverlay = 
> static_cast<GeoDataGroundOverlay const *>( overlay );/
> /        GeoImageGraphicsItem *imageItem = new GeoImageGraphicsItem;/
> /        imageItem->setImageFile( groundOverlay->absoluteIconFile() );/
> /        imageItem->setLatLonBox( groundOverlay->latLonBox() );/
> /        item = imageItem;/
>
> *//new - enz*
>
> *        item->setLatLonAltBox( groundOverlay->latLonBox() );*
>
> and now the GroundOverlay import works, the images is displayed.
>
> maybe there is a better bugfix, i cant find, what code change is
>
> the main reason for this bug,
>
> br, konrad enzensberger
>
>
>
> _______________________________________________
> Marble-devel mailing list
> Marble-devel at kde.org
> https://mail.kde.org/mailman/listinfo/marble-devel


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20120620/3e7b5d18/attachment.html>


More information about the Marble-devel mailing list