[FAQ] summary of common problems in accessing HMS core map service

Time:2022-5-24

HMS core map service(map Kit) provides developers with a set of SDK called by map development, helps global developers realize personalized map presentation and interaction, easily integrates map related functions in applications, and improves user experience in an all-round way.

In our daily work, we will receive many comments from developers about the problems encountered in the integrated map service. Here we share and summarize the typical problems, hoping to provide reference for other developers who encounter similar problems

1. How to solve the problem that the map cannot be loaded after applying the integrated map service (display grid map / only some maps)?

(1) Check whether the map kit switch is not turned on or the certificate fingerprint is configured incorrectly. Refer to codelab

(2) Please check whether the HMS version is 4.0.0 or above. SDK version is 6.0 At x, the version of HMS core (APK) needs to be upgraded to 6.0 X

(3) Whether the app ID in the project is consistent with that on appgallery connect.

(4) Fingerprint sha256 is not configured. The signature certificate fingerprint needs to be generated locally, and then configured in appgallery connect.

(5) If the appgallery connect configuration file of the application is not configured, copy the “agconnect services. JSON” file to the application level root directory.

(6) Configure signatures in Android. Copy the signature file generated by the generated signature certificate to the “app” directory of the project, and configure the signature in the “build. Gradle” file.

2. How to get your real-time location through map service?

(1) You can enable my location () tagging

hMap.setMyLocationEnabled(true);

hMap.getUiSettings().setMyLocationButtonEnabled(true);

Specific use detailsReference documents

(2) Getposition() gets the current position of the tag ()

Specific use detailsReference documents

3. After the map is loaded, the watermark, compass, my position, zoom button and other controls are not displayed, only the map is displayed. Why?

(1) Check the setting of the zorderontop property. Zorderontop (true): indicates that the map is displayed at the top level and will overwrite other controls. Zorderontop (false): indicates that the map is not displayed at the top level, and other controls can be displayed normally.

(2) Set zoom zoomcontrolsenabled, compass compassenabled, my position setmylocationenabled and other properties to true

Specific detailsRefer to website description

4. What is the reason why my location function doesn’t work after integrating map services?

(1) Please check whether android.com is enabled permission. ACCESS_ FINE_ Location and Android permission. ACCESS_ COARSE_ Location permission. (including dynamic permission application and whether the position switch is on)

(2) Check whether the following two switches are turned on:

//Enable location layer

map.setMyLocationEnabled(true);

//Enable my location button

map.getUiSettings().setMyLocationButtonEnabled(true);

5. After integrating the map service, when 2000 markers are added, the application will get stuck?

After calling map When clearing a marker during clear(), adding a marker will lead to re aggregation and low efficiency;

You can call map When clear (), add a line of code map Setmarkersclustering (false) to prevent re aggregation during cleanup.

Learn more > >

visitOfficial website of Huawei developer Alliance
obtainDevelopment guidance document
Huawei mobile service open source warehouse address:GitHubGitee

Follow us and learn the latest technical information of HMS core at the first time~