私はGoogle Maps Geocoding APIを使用します。
例:
var xhr = new XMLHttpRequest(),
route = "E261", // route name
latlng = "52.3547673,16.8840211"; // lat and lng
xhr.open("GET", "https://maps.googleapis.com/maps/api/geocode/json?latlng=" + latlng, true);
xhr.addEventListener("load", function() {
var response = JSON.parse(xhr.response).results;
response.forEach(function(result) {
if (result.types.indexOf("route") !== -1 && result.formatted_address.indexOf(route) !== -1)
console.log("route found");
});
});
xhr.addEventListener("error", function() {
// handle error
});
xhr.send();
このJavaコードではJavaScriptに変換するのは簡単相対的であるべきで、あなたのユースケースhttps://github.com/graphhopper/graphhopper/blob/master/core/src/に適合させるためにmain/java/com/graphhopper/util/InstructionList.java#L317 – Karussell
JavaコードをIONIC/CORDOVAアプリケーションに直接使用することはできますか? –
私が言ったように、これをJavaScriptに変換する必要があります。このトピックに関連するビットは、graphhopperが実際にJavaで書かれているが、ブラウザではteavmを介して実行できます:https://karussell.wordpress.com/2014/05/04/graphhopper-in-the-browser-teavm-オフラインルーティング - via-openstreetmap-in-javascript /これで、コードオフアプリでオフライン**ルーティングを再開できます。 – Karussell