Routing API

This page details all of the available NEON API functionality contained within the static API class NeonRouting

Download Route Destinations in Area

Once route destinations have been created using the NEON Command PC Application, they are stored in a NEON cloud account. Once you have successfully logged in to that account, you can request to download all route destinations that are in an area specified by a Latitude-Longitude Rectangle. Usually, this rectangle would be specified by the area of a satellite map that a user is viewing. The work to download the route destinations is performed on the provided handler, and results are returned via the INeonRouteDestinationListener. If this is the first time the NEON Location Service has been asked to download this area, it will perform a network operation to retrieve the route destinations. All subsequent requests will return locally cached route destinations. Route destinations returned to the listener can be displayed on a map, and, as long as the current position has valid route to the route destination, can be used to retrieve a route or start turn-by-turn navigation.

void downloadRouteDestinationsInArea(LatLongRect bounds, Handler h, INeonRouteDestinationListener callback)

Get routable destinations

This call will return all route destinations that are connected to the user’s current position with a valid route (after excluding supplied RouteFilters). That is, if the user’s current position is inside a particular building, this call will return all route destinations that can be routed to inside that building and all connected buildings. Whereas downloadRouteDestinationsInArea() will download all route destinations whether they can be routed to from the current position or not, this call will only provide valid destinations. To specify a maximum distance from the user’s current position, provide a distanceThresholdMeters, which will limit results to all destinations less than that distance in meters. This call is more suited to providing the user with a list of nearby destinations.

List<NeonRouteDestination> getRoutableDestinations(List<RouteFilter>)
List<NeonRouteDestination> getRoutableDestinations(List<RouteFilter>, int distanceThresholdMeters)

Get routable categories

This call will return all route categories as long as at least one of the route destinations marked with that category can be reached from the user’s current position (after excluding supplied RouteFilters). That is, if the user’s current position is inside a particular building, this call will return all route categories that can be routed to inside that building and all connected buildings. This call can provide the user with a list of categories which can be used in the routeToCategory(...) API function.

List<String> getRoutableCategories(List<RouteFilter>)

Route To Destination

Given a destination ID (the ID of a neon route destination) and a list of filters to apply to the route, routeToDestination() will return a route from the user’s current position to the destination to the provided routeListener. The returned route is a list of Route Nodes that can be displayed to preview the route. This route can then be used to start turn-by-turn navigation.

void routeToDestination(String destinationID, List<RouteFilter> routeFilters, Handler h, INeonRouteListener routeListener)

Route To Category

Given a category name (returned from getRoutableCategories()) and a list of filters to apply to the route, routeToCategory() will return a route from the user’s current position to the nearest destination marked with that category to the provided routeListener. The returned route is a list of Route Nodes that can be displayed to preview the route. This route can then be used to start turn-by-turn navigation.

void routeToCategory(String categoryName, List<RouteFilter> routeFilters, Handler h, INeonRouteListener routeListener)

Start Turn-by-turn Navigation

Submit a route obtained by routeToDestination() or routeToCategory() to begin turn-by-turn navigation along that route. Periodic updates suitable for display on screen will be return to the provided INeonTurnByTurnListener.

void startTurnByTurnNavigation(Route route, Handler h, INeonTurnByTurnListener turnByTurnListener)

Cancel Turn-by-turn Navigation

This will cancel any currently active turn-by-turn directions.

void cancelTurnByTurnNavigation()