Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the Mini Program Map component

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

In this article, the editor introduces in detail "how to use the Mini Program map component". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to use the Mini Program map component" can help you solve your doubts. Let's follow the editor's ideas to slowly deepen, together to learn new knowledge.

WeChat Mini Programs Map component has been upgraded to support multiple sets of map templates. Developers can choose their favorite styles according to the usage scenarios.

Developers only need to enable Tencent location service in the Mini Program development tool, select styles online, and make simple settings in the code in Mini Program to produce instant results everywhere.

Tencent location service provides WeChat Mini Programs with basic punctuation capabilities, map components such as line and circle drawing interfaces, and map API location service capabilities such as location display and map selection, allowing developers to freely implement their WeChat Mini Programs products. On this basis, Tencent location service WeChat Mini Programs JavaScript SDK is a LBS data service toolkit specially provided for Mini Program developers. You can call Tencent location service data services such as POI retrieval, keyword input prompts, address resolution, inverse address resolution, administrative division and distance calculation in Mini Program, to make your Mini Program more powerful!

How to enable Tencent location service

1. Apply for developer key (key): apply for a key

two。 Download WeChat Mini Programs JavaScriptSDK, WeChat Mini Programs JavaScriptSDK v1.0

3. Set the secure domain name. In "Settings"-> "Development Settings", set the legal domain name of request, and add https://apis.map.qq.com.

4. Mini Program exampl

/ / introduce SDK core class

Var QQMapWX = require ('.. /.. / libs/qqmap-wx-jssdk.js')

Var qqmapsdk

Page ({

OnLoad: function () {

/ / instantiate the API core class

Qqmapsdk = new QQMapWX ({

Key: 'applied key'

});

}

OnShow: function () {

/ / call the API

Qqmapsdk.search ({

Keyword: 'hotel'

Success: function (res) {

Console.log (res)

}

Fail: function (res) {

Console.log (res)

}

Complete: function (res) {

Console.log (res)

}

});

})

Use restriction

In order to ensure the stability of our services, we have imposed the following limits on the amount of calls to each service interface of each key:

Daily transfer volume: 10 thousand times / Key

Number of concurrency: 5 times / key / s.

Developers who exceed the number of daily calls and concurrency can be solved in the following ways:

1. For the same request with multiple frequency, the dependence on online service invocation can be reduced by caching the result and accessing the update regularly.

two。 For those who really need a large quota to meet the application needs, please send an editing email to: mapapi@vip.qq.com;mapbd@tencent.com according to the [quota Application template] (template is in email body format, do not send an attachment). We will evaluate your application and approve it (within 3 working days). After approval, we will get the quota you applied for.

After reading this, the article "how to use the Mini Program Map Assembly" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it. If you want to know more about the article, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report