G
G
gibsonen2019-01-29 14:06:25
Java
gibsonen, 2019-01-29 14:06:25

How to build a route from current location to latitude, longitude?

Hello, tell me how to make it so that it does not show me a point by coordinates, but builds a route from the current location to latitude, longitude. At the moment I have done this:

private void showMap(Uri geoLocation) {
        Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setData(geoLocation);
        if (intent.resolveActivity(getPackageManager()) != null) {
            startActivity(intent);
        }
    }

I need the user to click on the button and he was asked to choose which map to open, after: from the current location to the selected point, he would build a route

I generate Uri like this: Is there any ready-made library? For example, if a user has 3 applications installed: 2gis, Yandex maps and Google maps, so that the application makes it possible to select one of them
Uri.parse("geo:" + latitude + "," + longitude);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Zagaevsky, 2019-01-29
@zagayevskiy

As far as I know, there is no generally accepted scheme for routes. That is, such an intent cannot be built. It is possible to look in PackageManager'e, what applications are, for the most popular cartographic do everything by hand.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question