Note: To access all shared projects, get information about environment setup, and view other guides, please visit Explore-In-HMOS-Wearable Index.
This codelab shows how to use MapKit to implement routing functionality on HarmonyOS.
The project (MapRoutingTask) demonstrates how to visualize start and end points on a map and dynamically draw a connecting route.
- Set start and end points with markers
- Dynamically draw route with
MapArcParams
- Handle map callbacks and controller with
MapComponent
- Languages: ArkTS, ArkUI
- Frameworks: HarmonyOS SDK 5.0.2(14)
- Tools: DevEco Studio 5.1.0.828
- Libraries: @kit.MapKit
entry/src/main/ets/
├── entryability
│ └── EntryAbility.ets
├── entrybackupability
│ └── EntryBackupAbility.ets
└── pages
└── Index.ets
- HarmonyOS devices with MapKit support (e.g. Huawei Watch 5, compatible phones/emulators)
-
You must manually sign the application before running it.
-
Otherwise, the map will appear as a white screen with no information.
MapRoutingTask is distributed under the terms of the MIT License.
See the LICENSE file for more information.