Points to note when using uniapp's H5 map and map key application

        Recently, I used uniapp to develop H5 and used maps. I recorded the points that need to be paid attention to when using maps.

        To use maps and positioning on the H5 side, you need to configure the secret key (key) applied for by third-party map service providers such as Tencent or Google in manifest.json. Amap requires additional configuration of securityJsCode or serviceHost. Only when the map key is configured can the map be used normally in H5. Otherwise, Map key is not configured will be reported.

The H5 end needs to be deployed on the https service         to obtain positioning information   . The local preview (localhost) can still use the http protocol.

Map key application, here is Tencent Map as an example:

        1. Enter the application address: Tencent Location Service - Based on Ecology, Connect to the Future

        2. After registering and logging in, click "Console" in the upper right corner

        3. Find "Application Management" - "My Applications" on the left side of the console

        4. Add an application and add a key to the application

        One Tencent account can apply for 5 keys, and the daily free amount is also limited.

        For the key application and use of Amap, please refer to the Amap document: Amap usage document

Guess you like

Origin blog.csdn.net/m0_60312580/article/details/132057205