[Marble-devel] Drawing a box on the map

Kyle Shannon ksshannon at gmail.com
Fri Feb 17 16:12:49 UTC 2012


Thanks, I do have a namespace declaration.  Here is my exact code and
output from the slot I catch the RubberBand signal with (CPLSPrintf is just
a sprintf function from another lib):

code:
QString kml;
kml = CPLSPrintf(
"<kml xmlns=\"http://earth.google.com/kml/2.0\">\n"\
" <Placemark>\n"\
" <LinearRing>\n"\
" <extrude>0</extrude>\n"\
" <tessellate>0</tessellate>\n"\
" <altitudeMode>clampToGround</altitudeMode>\n"\
" <coordinates>\n"\
" %lf,%lf,0.0\n"\
" %lf,%lf,0.0\n"\
" %lf,%lf,0.0\n"\
" %lf,%lf,0.0\n"\
" %lf,%lf,0.0\n"\
" </coordinates>\n"\
" </LinearRing>\n"\
" </Placemark>\n"\
"</kml>\n",
coords[0], coords[1],
coords[2], coords[1],
coords[2], coords[3],
coords[0], coords[3],
coords[0], coords[1]);
qDebug() << kml;
marbleWidget->model()->addGeoDataString(kml);

Output I just print out the string:
Marble: Starting selection
Marble: Leaving selection
"<kml xmlns="http://earth.google.com/kml/2.0">
<Placemark>
<LinearRing>
<extrude>0</extrude>
<tessellate>0</tessellate>
<altitudeMode>clampToGround</altitudeMode>
<coordinates>
-11.705869,14.224237,0.0
-4.725890,14.224237,0.0
-4.725890,8.913964,0.0
-11.705869,8.913964,0.0
-11.705869,14.224237,0.0
</coordinates>
</LinearRing>
</Placemark>
</kml>
"
Segmentation fault
kshannon at ubuntu:~/src/windninja/trunk$

I will file a bug report later today.  Thanks.

kss

/**
 *
 * Kyle Shannon
 * ksshannon at gmail.com
 *
 */



On Wed, Feb 15, 2012 at 14:11, Thibaut Gridel <tgridel at free.fr> wrote:

> Hello,
>
> On Tuesday 14 February 2012, Kyle Shannon wrote:
> >  Also addGeoDataString doesn't have much for documentation.
>
> We welcome patches there!
>
> >  Does it take a kml?  I am getting a seg fault with a string (generated
> > from the selection):
>
> Yes it does, however we can improve this because we handle other formats
> from
> file parsing nowadays.
>
> You need to put the namespace, like:
>
> mapWidget->model()->addGeoDataString(
> "<kml xmlns=\"http://earth.google.com/kml/2.0\">"
> "<Placemark>"
> ...
> "</Placemark>"
> "</kml>"
> );
>
> Best Regards,
> Thibaut
> _______________________________________________
> 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/20120217/84578f44/attachment.html>


More information about the Marble-devel mailing list