We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All
SamplesMap KitHarmonyOS Sample Code

HarmonyOS Sample Code

The Map Java SDK for HarmonyOS provides a set of APIs for map development in HarmonyOS. The map data covers most countries and regions outside the Chinese mainland, and supports multiple languages. Map Kit uses the WGS 84 GPS coordinate system, which can meet most map development requirements outside the Chinese mainland. It allows you to easily add map functions to your HarmonyOS app. Click here to learn more.

The sample code covers the usage of most Map Kit APIs. Guided by the demo, you will learn how to implement the following functions:

  • Map display: Displays features such as buildings, roads, water systems, and Points of Interest (POIs).
  • Map interaction: Controls the interaction gestures and buttons on the map.
  • Map drawing: Adds map elements such as location markers, map layers, and various shapes.
Expand

Sample Code

Find It on Gitee

Find It on GitHub

DevEco Studio sample code

Click here

Click here

NOTE

Before using the sample code, read the README file in the sample project carefully. Run the sample code only after you complete the following operations:

  1. Sign in to AppGallery Connect, download the agconnect-services.json file of your app, and copy the file to the app directory of the sample project.

  2. Open the build.gradle file in the sample project, and change the value of applicationId to your app package name.

Search
Enter a keyword.