DEV Community

HarmonyOS
HarmonyOS

Posted on

Map does not display.

Read the original article:Map does not display.

Problem Description

  • When invoking the map component, an error occurs, and the map does not display.
  • When using the site location search API, no results are returned, and there are no error logs.

Background Knowledge

Map Kit (Map Service) provides developers with powerful and convenient mapping capabilities, enabling global developers to achieve personalized map display, location search, and route planning, among other functions, and easily complete map construction tasks. You can effortlessly integrate map-related features into HarmonyOS applications/meta-services, comprehensively enhancing user experience.

For development preparation, please refer to the Map Development Preparation guide.

Troubleshooting Process

  • Check the network status of the device.
  • Verify if the map service has been pre-enabled on AppGallery Connect and ensure that the map service is activated before applying for the Profile file. After enabling the map service, it may take up to one day to take effect.
  • You can temporarily bypass this by going to Settings - Date & Time - turning off automatic setting, and manually setting the date +1 day.
  • Check if the application is running on a real device.
  • Ensure that the certificate in the manual signature has been updated.
  • Check if the configuration "useNormalizedOHMUrl": true is enabled.
  • Verify if the location permissions ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION are granted.
  • Refer to 1002600003 to complete the application identity verification.

Analysis Conclusion

The white screen on the map not displaying is due to a lack of permissions. To use the map service, it is necessary to configure the map service in the AGC backend and manually sign it.

When using the site location search service, it also requires enabling the map service and performing manual signing. The steps can be referred to in Analysis Conclusion 1.

Solution

  1. Enable the map service in the AGC backend.
  2. Manually configure the signature information.
  3. Configure the clientID.

Verification Result

  • Works as expected in watch 5

Written by Mehmet Karaaslan

Top comments (0)