Motorcycle Planning
Overview
Starting with Navigation SDK v8.0.0, the SDK fully supports motorcycle route planning and navigation. The key difference from car navigation is that motorcycle route planning incorporates vehicle-specific information—such as the license plate number and engine displacement—into the route calculation strategy.
Important: Motorcycle route planning is a paid feature. Whether you are requesting a trial or planning for production use, you must submit a business cooperation ticket through our ticket system. Otherwise, route calculation will fail by default.
Most motorcycle navigation features are identical to those for car navigation. To implement motorcycle route planning, you should first familiarize yourself with car route planning.
Notes
* To enable motorcycle route planning, set the vehicle type (type) to 11.
* You must also specify the motorcycle's engine displacement and license plate number.
* The route planning method for motorcycles is the same as for cars. See car route planning for details.
* Motorcycle route planning strategies reuse the AMapNaviDrivingStrategy enum, with four dedicated strategy values ranging from 2001 to 2004.
Route Planning Strategies
The Navigation SDK provides four motorcycle route planning strategies, defined in the AMapNaviDrivingStrategy enum as follows:
Route Planning
The route calculation interface for motorcycles is identical to that for cars. The SDK distinguishes between vehicle types using the vehicle information object. When AMapNaviVehicleInfo.type is set to 11, the route is calculated for a motorcycle.
// Set motorcycle vehicle information
AMapNaviVehicleInfo *info = [[AMapNaviVehicleInfo alloc] init];
info.vehicleId = @"京BT8888";
info.motorcycleCC = 100;
info.type = 11;
[[AMapNaviDriveManager sharedInstance] setVehicleInfo:info];Usage Guide
Step 1: Set the Start and End Points
// Initialize start and end points using POI information
self.startPOIInfo = [[AMapNaviPOIInfo alloc] init];
self.startPOIInfo.mid = @"B0FFFAB6J2";
self.endPOIInfo = [[AMapNaviPOIInfo alloc] init];
self.endPOIInfo.mid = @"B0FFIA9OE8";Step 2: Calculate the Route
// Calculate a route using start and end POI information
[[AMapNaviDriveManager sharedInstance] calculateDriveRouteWithStartPOIInfo:self.startPOIInfo
endPOIInfo:self.endPOIInfo
wayPOIInfos:nil
drivingStrategy:AMapNaviMotorStrategyMultipleDefault];Step 3: Handle the Result
When the route is calculated successfully, the driveManager:onCalculateRouteSuccessWithType: callback is triggered. In this callback, you can display the calculated route or directly start navigation.
- (void)driveManager:(AMapNaviDriveManager *)driveManager onCalculateRouteSuccessWithType:(AMapNaviRoutePlanType)type
{
NSLog(@"onCalculateRouteSuccess");
// Display the route or start navigation
}