1.Problem description:
A lot of marker points have been added, and customInfoWindow is set for each marker point, but can only one customInfoWindow be displayed at a time?
Solution:
Marker's InfoWindow can only display one at a time.
2.Problem description:
In map selection,
1. What are the advantages and disadvantages of using Huawei Map Kit versus using SDKs such as Amap and Tencent?
Does Kit require commercial authorization? What's the price?
3. Is there any difference in the final App package size between the two options?
4. For meta services, does it support third-party map SDK?
Solution:
1. Map Kit is a Hongmeng system capability that is embedded in the operating system; the third-party map SDK allows applications to add dependencies and import them into application packages as needed, with different usage methods;
2. Just follow the guidance document to activate the map service. Whether to charge and the fee standard shall be subject to the official document;
3. Using Map Kit system capabilities, the size of the application package will be smaller;
4. Support
3.Problem description:
The map written according to the reference on the official website still does not display.
Test application created in AppGallery Connect, client_id of metadata has been configured
The map is gray and not displayed
I don’t know what the problem is. There is no error message in the console. The positioning is successful and the blue dots appear, but the map is not displayed.
Solution:
Follow the steps below to check the map service, especially the signature certificate fingerprint.
1. Generally, the map is not displayed, which may be related to the fact that the SHA256 fingerprint certificate configuration, network, positioning permissions, and map services are not opened, etc. If the permissions have just been configured, it will take 24 hours to take effect (you can set the mobile phone system time back 24 hours ).
The clientid under the metadata node in the .json5 file is written correctly—the client_id information needs to be written directly in it. The value in the resource file cannot be referenced through the $ symbol. This reference method cannot be parsed currently;
3. You need to check whether the current signature certificate fingerprint is also automatically signed. It needs to be changed to manual signature and needs to be consistent with the certificate fingerprint configured on the AGC.
The signing certificate uses the configuration method in this option "Select SHA256 public key fingerprint"
a. Generate configuration fingerprint:
/consumer/cn/doc/harmonyos-guides/push-preparations-0000001727885250#section388942317518
b. Configure certificate fingerprint:
/consumer/cn/doc/app/agc-help-signature-info-0000001628566748#section5181019153511
4.Problem description:
Add the image (circular cut image) in the rawfile folder as the Marker source image, and the actual effect appears with black edges. What is the reason?
Solution:
This is a normal phenomenon of the map function. The black border is to distinguish the boundary of each icon and prevent the stacking of elements from being confusing. There is currently no way to remove it.
5.Problem description:
The map components all reported the error "The API is not supported on all devices. Use the canIUse condition to determine whether the API is supported."
Solution:
The interface is not supported by all devices and requires permission settings, so an error will be reported.
Solution:
1. Check the syscap information in the error message
2. Add judgment at the interface call point, for example:
if (canIUse("")){
//TODO:
}
6.Problem description:
The map component cannot be displayed
import { MapComponent, mapCommon, map } from '@';
...
= async (err, mapController) => {
if (!err) { //The code does not report an error and err is empty
= mapController;
("mapLoad", () => {
(, `on-mapLoad`);
});
}
};
The api configuration in the project configuration of App gallery Connect has configured the map, and the client_id has been added in module.json5.
DevEco uses the auto sign method, but the fingerprint of the certificate selected when configuring the certificate fingerprint cannot be consistent with the fingerprint configuration of devEco. Is this the reason?
Solution:
If you choose auto sign mode in Sign Configs, please follow the steps below to verify whether your certificate configuration is correct:
1. Remember the folder address of the certificate in Store file(*.p12) in Sign Configs;
2. Open AppGallery Connect, select the "Certificate, APP ID and Profile" service, click "Certificate" -> "Add Certificate", and upload the first step in the "Select Certificate Request File (CSR)" option in the pop-up box csr file of the project in the folder address, and then submit;
3. Enter the "My Project" service, click "Add Public Key Fingerprint (HarmonyOS API 9 and above)" in "Application" in "General", select the certificate added in the second step in the pop-up box, and select confirm;