Hi again, i hope this mail does not get splitted like the others.<div><br></div><div>I modified the CMakeList.txt, to install the missing headers. Used the next code, but on the map the route is not shown, just the source (A) and Destination (B) Points are drawn. </div>
<div><br></div><div>---Code---</div><div><br></div><div>connect(theMap-&gt;model()-&gt;routingManager()-&gt;routingModel(), SIGNAL(routeCalculated(int)), SLOT(routeCalculated(int)));</div><div>connect(theMap-&gt;model()-&gt;routingManager(), SIGNAL(routeRetrieved(GeoDataDocument*)), SLOT(routeRetrieved(GeoDataDocument*)));</div>
<div><br></div><div><div>RouteRequest * request = theMap-&gt;model()-&gt;routingManager()-&gt;routeRequest();</div><div>request-&gt;setRoutePreference(RouteRequest::Pedestrian);</div><div>GeoDataCoordinates source( -118.14498, 34.0259, 0.0, GeoDataCoordinates::Degree );</div>
<div>request-&gt;append(source);</div><div>GeoDataCoordinates destination( -118.0918, 34.0230, 0.0, GeoDataCoordinates::Degree );</div><div>request-&gt;append(destination);</div><div>theMap-&gt;model()-&gt;routingManager()-&gt;retrieveRoute( request );</div>
<div>int routeCount = theMap-&gt;model()-&gt;routingManager()-&gt;routingModel()-&gt;rowCount();</div></div><div><br></div><div>---Code---</div><div><br></div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>
The routeRetrieved signal from ther RoutingManager is emitted, the routeCount gets 0, and routingModel&#39;s signal routeCalculated(int) is not emitted. </div><div>Why? Am I missing something to calcuate the route?</div><div>
<br></div><div>If I use the MarbleControlBox and I enable its routing tab, in the routing tab, i can see four &quot;points&quot;, A,B,C and D, I suppose because of the RouteRequest-&gt;Add(). And if I remove by hand the A and B which are not drawn (i cant see them in all the globe), everything works fine.</div>
<div><br></div><div>But if i do not remove the A and B points (sources and destination that I think are set by the MarbleControlBox), and set the work Offline (of the RoutingManager) as:</div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>
<br></div><div>1.- setWorkOffline(true): I can see the &quot;Get Directions&quot; button with a couple of circles spinning, which i can think it is busy getting the route directions, and it never finishes, it gets the street names, city,etc... A and B are empty, my added points are C and D, which i think this is the reason.</div>
<div><br></div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>2.- setWorkOffline(false), It gets a &quot;0.0 km (Yours)&quot;, it gets the street names, city,etc... but no route is calculated (again, A and B are empty, B and C are my added points).</div>
<div><br></div><div>How can i programatically remove the empty positions A and B or replace the empty ones by the source and destination coordinates i created? I tried with RouteRequest-&gt;remove() but did not worked.</div>
<div><br></div><div>My intention is not to use the MarbleControlBox, because user intervention is not needed in my application, the source and destination points are taken from a database and should be set programatically.</div>
<div><br></div><div>Thanks for your help.<br><br><div class="gmail_quote">On Thu, Oct 7, 2010 at 1:07 AM, Dennis Nienhüser <span dir="ltr">&lt;<a href="mailto:earthwings@gentoo.org">earthwings@gentoo.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
the routing related classes are not yet exported: There&#39;ll be some API changes<br>
in them in the near future that will change the way route request options are<br>
set and some other changes to make it easily usable from the outside. I want<br>
to export them for KDE 4.6, however, to support that kind of usage.<br>
<br>
If you&#39;re willing to adapt your code to any API changes, you can manually<br>
export the missing headers (RoutingModel, RoutingManager, RouteRequest may be<br>
enough) now. I haven&#39;t fully tested that yet, YMMV. It&#39;s probably a good idea<br>
to CC yourself to bug 248086 [1] which I&#39;ll update with the progress on this.<br>
Note that the code posted in comment #1 in that bug is already a bit outdated,<br>
RouteSkeleton is now RouteRequest and shouldn&#39;t be created on its own, but<br>
requested from the RoutingManager.<br>
<br>
Regards,<br>
Dennis<br>
<br>
[1] <a href="https://bugs.kde.org/show_bug.cgi?id=248086" target="_blank">https://bugs.kde.org/show_bug.cgi?id=248086</a><br>
<br>
Am Donnerstag, 7. Oktober 2010, um 06:03:50 schrieb Miguel Chavez Gamboa:<br>
<div><div></div><div class="h5">&gt; Hi,<br>
&gt;<br>
&gt;<br>
&gt; Sorry for the inconvenience caused by my previous mail with formated text,<br>
&gt; this goes in plain text.<br>
&gt;<br>
&gt;<br>
&gt; Im trying to incorporate marble and its new offline routing capabilities in<br>
&gt; my own project, and Im reading the marble source code and the<br>
&gt; documentation. From the marble source code, i got some code to start and<br>
&gt; experiment.<br>
&gt;<br>
&gt; The next code (adapted from marble source) is causing me some troubles.<br>
&gt;<br>
&gt; RoutingManager *routingManager = theMap-&gt;model()-&gt;routingManager();<br>
&gt; RoutingModel   *routingModel   = routingManager-&gt;routingModel();<br>
&gt; bool hasRoute = routingModel-&gt;rowCount(); //here is the problem<br>
&gt;<br>
&gt; My includes are:<br>
&gt;<br>
&gt; #include &lt;marble/global.h&gt;<br>
&gt; #include &lt;marble/MarbleModel.h&gt;<br>
&gt; #include &lt;marble/RoutingManager.h&gt;<br>
&gt;<br>
&gt; The third line (getting the rowCount), causes the compilation to fail with<br>
&gt; the error:<br>
&gt; error: invalid use of incomplete type ‘struct Marble::RoutingModel’<br>
&gt; As I have seen, the RoutingModel Class is defined (as Class RoutingModel;)<br>
&gt;  in RoutingManager.h, but included in the ControlView.cpp file as &#39;<br>
&gt; #include &quot;routing/RoutingModel.h&quot; &#39; .<br>
&gt;<br>
&gt; Are the &quot;routing&quot;-folder headers  inside the marble lib sources not<br>
&gt; installed (at /usr/include/marble) ?<br>
&gt; Is this intentional, only for the Marble application (not the library) ?<br>
&gt;<br>
&gt; What is the correct way to incorporate routing capabilities to another<br>
&gt; application? What Classes to use? The RoutingManager?<br>
&gt;<br>
&gt;<br>
&gt; Im using the marble code from the anonymous kde svn repository (svn://<br>
&gt; <a href="http://anonsvn.kde.org/home/kde/trunk/KDE/kdeedu/marble/src" target="_blank">anonsvn.kde.org/home/kde/trunk/KDE/kdeedu/marble/src</a>).<br>
&gt;<br>
&gt; Thanks in advance,<br>
<br>
</div></div>_______________________________________________<br>
Marble-devel mailing list<br>
<a href="mailto:Marble-devel@kde.org">Marble-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/marble-devel" target="_blank">https://mail.kde.org/mailman/listinfo/marble-devel</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Miguel Chavez Gamboa<br><br>
</div>