What geo Uri format needed for navigator to go to the location?
  • I'm writing a Android app that issues an Intent with a geo Uri. navigator is given as a choice by the system but I get error message: Address not found. What does the geo Uri need to be for navigator to go to the location?  My code:
    Uri loc = Uri.parse("geo:0,0" +"?q="+latD+","+longD+"("+locName +")&z="+zoom);
    Where locName is my nickname for the location.
    Here's a sample:
     Uri=geo:0,0?q=36.8671,-93.4398(Cox Ford)&z=17


  • 11 Comments sorted by
  • I think you need to convert co-ordinates to miliseconds, i.e.
    36.8671,-93.4398 = 132721560  -336383280
  • That Uri works with Google Maps and Map Quest.  I would expect that if naviagtor lists itself as a choice with those other programs as an app to display a location, it would take the location's coordinates in the same units as the others.

    When you say "I think" what do you mean?  Have you tried it?
  • I am not a programer, so 'I think' that it is what you should try as I have no idea what are you doing.

  • I have an app that can read waypoints(lat/long/nickname) from different sources like .kml files.  The user can select one and ask that it be found on a map.  The program issues an Intent with the geo Uri as shown earlier. The Android system then presents a list of apps that have Intent-filters that say that they can handle the Intent that was sent.  The user then selects an app and the app positions itself at the lat/long given in the geo Uri.
    The Uri used works with Google Earth, Maps and Map Quest.  navigator gives an error.

    Your suggestion says that navigator needs special conversion of the lat/long to correctly respond to the Intent my program sends.

    Thanks for your responses.
  • Just tried changing the format for the lat and long to millisecs and got the same error:
    Address not found

    My geo Uri:
    Uri=geo:0,0?q=132721560,-336383280(Cox Ford)&z=17
  • I apologise, I was wrong, please use decimal degrees
  • Thanks for the response.

    I used decimal degrees originally as shown in the first post on Nov 13.
    Uri=geo:0,0?q=36.8671,-93.4398(Cox Ford)&z=17

    Because Maps and MapQuest both worked with that format, I expected navigator to also work.

    Another possibility that I haven't tried is:
     Uri=geo:36.8671,-93.4398?q=36.8671,-93.4398(Cox Ford)&z=17

    Does navigator have any doc for Android developers where there could be an example of this?
  • Hi Norm, we do support same set of formats as google does (http://developer.android.com/guide/appendix/g-app-intents.html), the thing is you are using "q" parameter  that means query and that means Navigator searches the internet for it. So use the format w/o q parameter ie "geo:36.8671,-93.4398?z=17".

    Regards PetrS.

  • Thanks, I'll try that.

    I guess I was just lucky that the format I was using did as I expected.  I like being able to give a name to the placemarker that is shown.

    Meanwhile I will work on an app that reads waypoint files and allows the user to select which ones to copy into the navigator's  favourites.xml file,
  • I tried two variations of the geo Uri:
    1)  Uri=geo:36.8671,-93.4398?z=17
    With this navigator did not give the "Address not found" message but it did not show any map. It displayed a blank screen
    With MapQuest  it position to an unknown location

    2)act=android.intent.action.VIEW dat=geo:36.8671,-93.4398?q=36.8671,-93.4398(Cox Ford)&z=17 flg=0x3000000 cmp=com.mapfactor.navigator/.map.MapActivity} from pid 17663
    navigatior gave the "Address not found" with this Uri
    MapQuest positioned to the location as expected

    The above tests were on the virtual Android machine running in Oracle's VirtualBox
    I checked that navigator had the map where the position is by using an entry from the MyPlaces list. 

    On my Nexus7
    With this Uri=geo:36.8671,-93.4398?q=36.8671,-93.4398(Cox Ford)&z=17
    GoogleEarth and Maps positioned to the desired location
    navigator gave the "Address not found" message

  • In re-testing with my program I found that this kind of Uri works with navigator:

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion