Hi,<div><br></div><div>Im using marble lib from the svn, latest revision, and I would like to know about the placemarks.</div><div>I want to set Placemarks on the marble widget with the names of points in a route (programatically), like the runners example in the techbase to mark a point somewhere with a label and a dot.</div>
<div>I have viewed the marble code and the techbase runners Example to get some clues, and I wrote the next code:</div><div><br></div><div><meta name="qrichtext" content="1"><style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#808000;">void</span><span style=" color:#c0c0c0;"> </span>MainWindow<span style=" color:#000000;">::</span>setPlaces<span style=" color:#000000;">()</span></pre>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#000000;">{</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">    </span><span style=" color:#800080;">QVector</span><span style=" color:#000000;">&lt;</span>GeoDataPlacemark<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">*&gt;</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">*</span>vector<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">new</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">QVector</span><span style=" color:#000000;">&lt;</span>GeoDataPlacemark<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">*&gt;;</span></pre>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">    </span><span style=" color:#808000;">foreach</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">(</span><span style=" color:#c0c0c0;"> </span>LCDestinationInfo<span style=" color:#c0c0c0;"> </span>point<span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span>viaPoints<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">)</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">{</span></pre>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span>GeoDataPlacemark<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">*</span>placemark<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">new</span><span style=" color:#c0c0c0;"> </span>GeoDataPlacemark<span style=" color:#000000;">(</span><span style=" color:#c0c0c0;"> </span>point<span style=" color:#000000;">.</span>name<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">);</span></pre>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span>placemark<span style=" color:#000000;">-&gt;</span>setCoordinate<span style=" color:#000000;">(</span><span style=" color:#c0c0c0;"> </span>GeoDataPoint<span style=" color:#000000;">(</span><span style=" color:#c0c0c0;"> </span>point<span style=" color:#000000;">.</span>gdCoordinate<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">)</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">);</span></pre>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span>placemark<span style=" color:#000000;">-&gt;</span>setDescription<span style=" color:#000000;">(</span><span style=" color:#008000;">&quot;Add</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">a</span><span style=" color:#c0c0c0;"> </span><span style=" color:#008000;">description!&quot;</span><span style=" color:#000000;">);</span></pre>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span>GeoDataLookAt<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">*</span>lookAt<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">new</span><span style=" color:#c0c0c0;"> </span>GeoDataLookAt<span style=" color:#000000;">(</span><span style=" color:#c0c0c0;"> </span>theMap<span style=" color:#000000;">-&gt;</span>lookAt<span style=" color:#000000;">()</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">)</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">;</span></pre>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span>lookAt<span style=" color:#000000;">-&gt;</span>setLatitude<span style=" color:#000000;">(</span><span style=" color:#c0c0c0;"> </span>point<span style=" color:#000000;">.</span>gdCoordinate<span style=" color:#000000;">.</span>latitude<span style=" color:#000000;">()</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">);</span></pre>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span>lookAt<span style=" color:#000000;">-&gt;</span>setLongitude<span style=" color:#000000;">(</span><span style=" color:#c0c0c0;"> </span>point<span style=" color:#000000;">.</span>gdCoordinate<span style=" color:#000000;">.</span>longitude<span style=" color:#000000;">()</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">);</span></pre>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span>placemark<span style=" color:#000000;">-&gt;</span>setLookAt<span style=" color:#000000;">(</span><span style=" color:#c0c0c0;"> </span>lookAt<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">);</span></pre>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span>vector<span style=" color:#000000;">-&gt;</span>append<span style=" color:#000000;">(</span><span style=" color:#c0c0c0;"> </span>placemark<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">);</span></pre>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">    </span><span style=" color:#000000;">}</span></pre>
<pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">    </span>MarblePlacemarkModel<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">*</span>placemarkModel<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">static_cast</span><span style=" color:#000000;">&lt;</span>MarblePlacemarkModel<span style=" color:#000000;">*&gt;(</span><span style=" color:#c0c0c0;"> </span>theMap<span style=" color:#000000;">-&gt;</span>placemarkModel<span style=" color:#000000;">()</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">);</span></pre>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">    </span>placemarkModel<span style=" color:#000000;">-&gt;</span>setPlacemarkContainer<span style=" color:#000000;">(</span><span style=" color:#c0c0c0;"> </span>vector<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">);</span></pre>

<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#000000;">}</span></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
<span style=" color:#000000;"><br></span></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#000000;"><font class="Apple-style-span" face="arial, helvetica, sans-serif">The code runs without problems, nothing is painted on the map at the locations. After the application&#39;s window lost focus (i launch a calculator or show the yakuake window), the program crashes.This make me think about an update in the marble widget and the inserted placemarks making some unexpected thing together.</font></span></pre>
<div><br></div>Maybe im not using the right class (GeoDataPlacemark). I have seen on the documentation the classes VisiblePlacemark, PlacemarkLayout, and PlacemarkPainter, but i could not find how to use them.</div><div><br>
</div><div>I also tried to use marbleWidget&#39;s addPlacemarkFile() method (and did further tests with marble -the application-  opening a kml file) with sample <a href="http://code.google.com/apis/kml/documentation/kml_tut.html#placemarks">xml</a> from google kml documentation, but nothing is rendered on the map (i think the placemarks are not visible or not drawn, just added invisible placemarks -like bookmarks-). I noted that if i placed placemarks with a <a href="http://code.google.com/apis/kml/documentation/kml_tut.html#paths">path</a> the path is drawn on the map (with the addPlacemarkFile() method), which makes me think that drawing <a href="http://code.google.com/apis/kml/documentation/kml_tut.html#placemarks">Placemarks</a> is not implemented in marble when loading placemarks from kml files. </div>
<div><br></div><div>I also found PlacemarkTextAnnotation class, and the osmannotate plugin but this is not compiled (commented on the CMakeLists.txt). Is it not finished?</div><div><br></div><div>I found a <a href="http://www.youtube.com/watch?v=hTKc546-gjQ">video</a> that shows annotations, a feature near to what i want... but that seems to be old (1 year) and not present on the marble source code. And a blog post about adding <a href="http://techespanto.wordpress.com/2010/05/05/gsoc-10-proposal-adding-bookmark-and-annotation-feature-in-kde-marble/">annotations for a GSOC project</a> (some months ago).</div>
<div><br></div><div>Well, any help will be appreciated. </div><div>Thanks.</div><div><br>-- <br>Miguel Chavez Gamboa<br><br>
</div>