<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
 </head><body>
 
 
  <p style="margin: 0pt;"><span><span></span></span></p> 
  <p style="margin: 0px; ">Hi,</p> 
  <p style="margin: 0px; "> </p> 
  <p style="margin: 0px; ">after updating from repository i am facing a problem importing</p> 
  <p style="margin: 0px; ">KML with GroundOverlayTag .</p> 
  <p style="margin: 0px; ">GroundOverlay worked perfect in previous version (from 14.05.2012)</p> 
  <p style="margin: 0px; "> </p> 
  <p style="margin: 0px; ">The referenced image is not displayed on the map because of</p> 
  <p style="margin: 0px; ">the <em>GeoImageGraphicsItem::paint()</em> is never called.</p> 
  <p style="margin: 0px; "> </p> 
  <p style="margin: 0px; ">paint() is not called because of:</p> 
  <p style="margin: 0px; "> </p> 
  <p style="margin: 0px; "><em>GeometryLayer::render(...)</em></p> 
  <p style="margin: 0px; "><em>... </em></p> 
  <p style="margin: 0px; "><em>QList<GeoGraphicsItem*> items = d->m_scene.items( viewport->viewLatLonAltBox(), maxZoomLevel );</em></p> 
  <p style="margin: 0px; "><em>... </em></p> 
  <p style="margin: 0px; "> </p> 
  <p style="margin: 0px; ">returns allways a empty list.</p> 
  <p style="margin: 0px; ">Doing more investigation i found that:</p> 
  <p style="margin: 0px; "> </p> 
  <p style="margin: 0px; "><em>void GeometryLayerPrivate::createGraphicsItemFromOverlay( const GeoDataOverlay *overlay )</em></p> 
  <p style="margin: 0px; "><em>{</em></p> 
  <p style="margin: 0px; "><em>  ...</em></p> 
  <p style="margin: 0px; "><em>  m_scene.addItem( item ); </em></p> 
  <p style="margin: 0px; "> </p> 
  <p style="margin: 0px; ">creates and adds the GeoImageGraphicsItem to the scene, but the methode:</p> 
  <p style="margin: 0px; "> </p> 
  <p style="margin: 0px; "><em>void GeoGraphicsScene::addItem( GeoGraphicsItem* item )</em><br/><em>{</em><br/><em>    // Select zoom level so that the object fit in single tile</em><br/><em>    int zoomLevel;</em><br/><em>    qreal north, south, east, west;</em><br/><em>    item->latLonAltBox().boundaries( north, south, east, west );</em></p> 
  <p style="margin: 0px; "> </p> 
  <p style="margin: 0px; ">allways returns 0 for the north, south, east, and west values.</p> 
  <p>Problem: the <em>GeoGraphicsItemPrivate - GeoDataLatLonAltBox m_latLonAltBox;</em></p> 
  <p>is never set. </p> 
  <p> </p> 
  <p>I see that in GeometryLayerPrivate::createGraphicsItemFromOverlay(...),</p> 
  <p>the LatLonBox is set for the GeoImageGraphicsItem:</p> 
  <p><em>imageItem->setLatLonBox( groundOverlay->latLonBox() );</em></p> 
  <p> </p> 
  <p>But this has no effect for the <em>GeoGraphicsItemPrivate::m_latLonAltBox</em> member</p> 
  <p> </p> 
  <p>For a quick bugfix i add this line to:</p> 
  <p><em>void GeometryLayerPrivate::createGraphicsItemFromOverlay( const GeoDataOverlay *overlay )</em><br/><em>{</em><br/><em>    GeoGraphicsItem* item = 0;</em><br/><em>    if ( overlay->nodeType() == GeoDataTypes::GeoDataGroundOverlayType ) {</em><br/><em>        GeoDataGroundOverlay const * groundOverlay = static_cast<GeoDataGroundOverlay const *>( overlay );</em><br/><em>        GeoImageGraphicsItem *imageItem = new GeoImageGraphicsItem;</em><br/><em>        imageItem->setImageFile( groundOverlay->absoluteIconFile() );</em><br/><em>        imageItem->setLatLonBox( groundOverlay->latLonBox() );</em><br/><em>        item = imageItem;</em></p> 
  <p>        <strong>//new - enz</strong></p> 
  <p><strong>        item->setLatLonAltBox( groundOverlay->latLonBox() );</strong></p> 
  <p> </p> 
  <p>and now the GroundOverlay import works, the images is displayed.</p> 
  <p> </p> 
  <p>maybe there is a better bugfix, i cant find, what code change is</p> 
  <p>the main reason for this bug,</p> 
  <p> </p> 
  <p>br, konrad enzensberger </p> 
  <p> </p> 
  <p> </p> 
  <p> </p> 
  <p> </p> 
  <p style="margin: 0px; "> </p> 
  <p style="margin: 0px; "> </p> 
  <p style="margin: 0px; "> </p>
 
</body></html>