<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi Konrad,<br>
    <br>
    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.<br>
    <br>
    Regards,<br>
    Dennis<br>
    <br>
    Am 20.06.2012 13:13, schrieb Konrad Enzensberger:
    <blockquote
cite="mid:1189498473.76959.1340190787071.JavaMail.open-xchange@com4.strato.de"
      type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Marble-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Marble-devel@kde.org">Marble-devel@kde.org</a>
<a class="moz-txt-link-freetext" href="https://mail.kde.org/mailman/listinfo/marble-devel">https://mail.kde.org/mailman/listinfo/marble-devel</a>
</pre>
    </blockquote>
    <br>
    <br>
  </body>
</html>