API Navitel Navigator

The Navigator supports processing of the following intents from external applications:

  • Show the map at a given point
  • To build a route to a given point by coordinates
  • Build a route to a given point by its name

1. Point display

Intent.ACTION_VIEW Intent
with URI-scheme geo (rfc5870).
Format of the geo scheme can be found at: https://en.wikipedia.org/wiki/Geo_URI_scheme

Parameters:


in:Uri:string - Uri string in the form geo:lat,long,alt, in which
lat - float, from -90 to 90, latitude
long - float, from -180 to 180, longitude
alt - float, height

Example of use:


Uri intentUri = Uri.parse("geo:37.7749,-122.4194,128");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, intentUri);
mapIntent.setPackage("com.navitel");
if (mapIntent.resolveActivity(getPackageManager()) == null) {
        // Navitel is not installed, open the page in the market
        mapIntent = new Intent(Intent.ACTION_VIEW);
        mapIntent.setData(Uri.parse("market://details?id=com.navitel"));
}
startActivity(mapIntent);

2. Building a route to a point by coordinates

intent - Intent.ACTION_VIEW
with the scheme google.navigation
Parameters:
in:Uri:string - an Uri string of the google.navigation type: ll = lat,long, in which
Lat-float, from -90 to 90, latitude
Long - float, from -180 to 180, longitude

Example of use:


Uri intentUri = Uri.parse("google.navigation:ll=37.786971,-122.399677");
Intent routeIntent = new Intent(Intent.ACTION_VIEW, intentUri);
routeIntent.setPackage("com.navitel");
if (routeIntent.resolveActivity(getPackageManager()) != null) {
        // Navitel is not installed, open the page in the market
        routeIntent = new Intent(Intent.ACTION_VIEW);
        routeIntent.setData(Uri.parse("market://details?id=com.navitel"));
}
startActivity(routeIntent);

3. Building a route to a point by point name

intent - Intent.ACTION_VIEW
With navitelApi schema: navigate / to / waypoint
Parameters:
in:Uri:string - an Uri line of the form navitelApi: navigate / to / waypoint / name, in which
Name:string - string with the name of the point

Example of use, build a route to the point Home:


Uri intentUri = Uri.parse("navitelApi:navigate/to/waypoint/Home");
Intent routeIntent = new Intent(Intent.ACTION_VIEW, intentUri);
routeIntent.setPackage("com.navitel");
if (routeIntent.resolveActivity(getPackageManager()) == null) {
        // Navitel is not installed, open the page in the market
        routeIntent = new Intent(Intent.ACTION_VIEW);
        routeIntent.setData(Uri.parse("market://details?id=com.navitel"));
}
startActivity(routeIntent);