Import waypoint and automatical navigate to it

Started by flashman, July 30, 2014, 11:15:33 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

flashman

Hi there.



I am looking for some kind of API of OruxMaps, which gives me the possibility, to create a waypoint in an own app, send it directly to Orux (which is already running or will be started) and make it the default "Go To" destination. All this should be as fast as possible. So in best case, the private app is open, I press a button, the app calculates a waypoint, sends it to Orux, Orux becomes active app and navigates / points (direct line) to the new waypoint, without any interactions via touchscreen and Orux so far.



Would be so nice, if this is possible. Any help warmly welcome.



Kind regards,

Andrew

orux

#1
Quote from: "flashman"Hi there.



I am looking for some kind of API of OruxMaps, which gives me the possibility, to create a waypoint in an own app, send it directly to Orux (which is already running or will be started) and make it the default "Go To" destination. All this should be as fast as possible. So in best case, the private app is open, I press a button, the app calculates a waypoint, sends it to Orux, Orux becomes active app and navigates / points (direct line) to the new waypoint, without any interactions via touchscreen and Orux so far.



Would be so nice, if this is possible. Any help warmly welcome.



Kind regards,

Andrew


Hi,



OruxMaps catches geo: uris, with ACTION_VIEW Intents->geo:37.786971,-122.399677



or you can use OruxMaps intents:



//Mapa offline en posiciĆ³n actual

//Intent i = new Intent("com.oruxmaps. VIEW_MAP_OFFLINE");

//Mapa online

Intent i = new Intent("com.oruxmaps.VIEW_MAP_ONLINE");

//Waypoints

double[] targetLat = {33.4,8.3,22.2};

double [] targetLon = {33.4,8.3,22.3};

String [] targetNames = {"point alpha","point beta"};

i.putExtra("targetLat", targetLat);

i.putExtra("targetLon", targetLon);

i.putExtra("targetName", targetNames);

//Track points

double[] targetLatPoints = {33.43,8.32,22.24};

double [] targetLonPoints = {33.44,8.35,22.37};

i.putExtra("targetLatPoints", targetLatPoints);

i.putExtra("targetLonPoints", targetLonPoints);

startActivity(i);



orux

flashman

#2
Thanks a lot, works perfect. But this is the same snipped, as described on the last page of the manual.

So there are some questions left - Can the API do more?



Using the code provided, I can create waypoints or trackpoints. If I call my app twice, Orux shows points as duplicates.

Is there an ID-key management, which avoid duplicates and let me control points already created?



For example:



...

i.putExtra("targetName", targetNames);

i.putExtra("targetId",<unique_ID>);

...



And since my <unique_ID> will we alway the same per dataset, Orux won`t create it again.



So with this idea, it should be possible to remove or hide created points?

And finally: How can I start a navigation to a point just created?



...

i.setAsTarget(<unique_ID>);

startActivity(i);

...



Hope you can help, since I am sure, the Orux api is much bigger and powerful.



Thanks so much,

Andreas

orux

#3
Quote from: "flashman"Thanks a lot, works perfect. But this is the same snipped, as described on the last page of the manual.

So there are some questions left - Can the API do more?



Using the code provided, I can create waypoints or trackpoints. If I call my app twice, Orux shows points as duplicates.

Is there an ID-key management, which avoid duplicates and let me control points already created?



For example:



...

i.putExtra("targetName", targetNames);

i.putExtra("targetId",<unique_ID>);

...



And since my <unique_ID> will we alway the same per dataset, Orux won`t create it again.



So with this idea, it should be possible to remove or hide created points?

And finally: How can I start a navigation to a point just created?



...

i.setAsTarget(<unique_ID>);

startActivity(i);

...



Hope you can help, since I am sure, the Orux api is much bigger and powerful.



Thanks so much,

Andreas


Hi,



yes, there are more Intents,



int[] targetType = i.getIntArrayExtra("targetType");//waypoint type



int navigatetoindex = i.getIntExtra("navigatetoindex", -1);//waypoint index from provided waypoints to start navigation mode





But there aren't Intents to remove/identify the provided waypoints.





orux

flashman

#4
Great. Will try it out. Thanks for the help.

flashman

#5
This methods seems to do nothing. I tried this, but even no success:


Intent i = new Intent("com.oruxmaps.VIEW_MAP_ONLINE");
        double [] targetLat = {53.12,53.38};
        double [] targetLon = {13.12,13.22};
        String [] targetNames = {"START","ZIEL"};
        i.putExtra("targetLat", targetLat);
        i.putExtra("targetLon", targetLon);
        i.putExtra("targetName", targetNames);
        i.putExtra("navigatetoindex", 1);
        startActivity(i);


I thought this might be the way to activate navigation to waypoint "Ziel", which should have index 1, while "Start" has index zero.


int[] targetType = i.getIntArrayExtra("targetType");//waypoint type

Should give me a array of integers to do what?


int navigatetoindex = i.getIntExtra("navigatetoindex", -1);//waypoint index from provided waypoints to start navigation mode

Since its an "get" method, it should return an index? What to do with?



I am very sorry for the maybe stupid questions, but there is no reference to look at in this special case. :-)

orux

#6
Hi,



try with last beta; there was a bug with 'navigatetoindex' value.


int[] targetType = i.getIntArrayExtra("targetType");//waypoint type
this is my code, you have to 'put' the type of the wpts, if you want a different wpt type.


int navigatetoindex = i.getIntExtra("navigatetoindex", -1);//waypoint index from provided waypoints to start navigation mode
this is also my code, you are using it right.



wpt types:


        <item>Waypoint</item>
        <item>Geocache</item>
        <item>Photo</item>
        <item>Airport</item>
        <item>Bar</item>
        <item>Beach</item>
        <item>Bridge</item>
        <item>Campground</item>
        <item>Car</item>
        <item>City</item>
        <item>Crossing</item>
        <item>Dam</item>
        <item>Danger Area</item>
        <item>Drinking Water</item>
        <item>Finishing Point</item>
        <item>Fishing Area</item>
        <item>Forest</item>
        <item>Gas Station</item>
        <item>Glider Area</item>
        <item>Golf</item>
        <item>Heliport</item>
        <item>Hotel</item>
        <item>Hunting Area</item>
        <item>Information</item>
        <item>Marina</item>
        <item>Mine</item>
        <item>Parachute Area</item>
        <item>Park</item>
        <item>Parking Area</item>
        <item>Picnic Area</item>
        <item>Residence</item>
        <item>Restaurant</item>
        <item>Restroom</item>
        <item>Scenic Area</item>
        <item>School</item>
        <item>Shopping Center</item>
        <item>Shower</item>
        <item>Starting Point</item>
        <item>Skiing Area</item>
        <item>Summit</item>
        <item>Swimming Area</item>
        <item>Telephone</item>
        <item>Tunnel</item>
        <item>Ultralight Area</item>
        <item>Person</item>
        <item>Dog</item>
        <item>Dot</item>

targetType->
        <item>1</item>
        <item>2</item>
        <item>3</item>
        <item>4</item>
        <item>5</item>
        <item>6</item>
        <item>7</item>
        <item>8</item>
        <item>9</item>
        <item>10</item>
        <item>11</item>
        <item>12</item>
        <item>13</item>
        <item>14</item>
        <item>15</item>
        <item>16</item>
        <item>17</item>
        <item>18</item>
        <item>19</item>
        <item>20</item>
        <item>21</item>
        <item>22</item>
        <item>23</item>
        <item>24</item>
        <item>25</item>
        <item>26</item>
        <item>27</item>
        <item>28</item>
        <item>29</item>
        <item>30</item>
        <item>31</item>
        <item>32</item>
        <item>33</item>
        <item>34</item>
        <item>35</item>
        <item>36</item>
        <item>37</item>
        <item>38</item>
        <item>39</item>
        <item>40</item>
        <item>41</item>
        <item>42</item>
        <item>43</item>
        <item>44</item>
        <item>45</item>
        <item>46</item>
        <item>47</item>




orux