Launching a navigation app with destination pre-populated

家住魔仙堡 提交于 2021-01-29 19:05:04

问题


I want to start a turn by turn navigation app (which does not use mobile data) with its destination. I use cordova and javascript. I can launch sygic and herewego with the code below but I cannot pass the destination after numerous changes. The destination is in latitude/longitude format.

I don't mind which app is used as long as it starts ready to navigate to a destination. I would be grateful for any tips.

   window.plugins.launcher.launch({
        packageName:'com.sygic.aura',  // com.here.app.maps
  }    , hereSuccessCallback, hereErrorCallback);

回答1:


An older thread, but might be useful if someone else is looking for similar issue. On android the HERE WE GO app can be opened with intents by passing the following properties

action com.here.maps.DIRECTIONS
category CATEGORY_DEFAULT
data URI here.directions://v1.0/mylocation/37.870090,-122.268150,Downtown%20Berkeley?ref=<Referrer>&m=w

On iOS

Open a URL with a custom here-route URL Scheme:
//mylocation/latitude,longitude with WGS 84 compliant latitude and longitude geocoordinates of the destination
Alternatively, you can replace the geocoordinate pair with a Place ID (as returned by a Places API query) to get directions to a specific POI instead of a latitude/longitude pair,URLencoded string as the name of the destination?ref=<Referrer>referrer (and can be something like your app or company name) &m=w to indicates the routing mode (m=w stands for walk, m=d for drive)

For instance, here-route://mylocation/37.870090,-122.268150,Downtown%20Berkeley?ref=<Referrer>&m=w requests a route by foot to a destination in downtown Berkeley by a company called Referrer.

(documentation)



来源:https://stackoverflow.com/questions/56395840/launching-a-navigation-app-with-destination-pre-populated

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!