WEX5 Actual combat Baidu map JavaScript API integration

Source: Internet
Author: User

WEX5 provides a BMAP component to call Baidu Maps, in the Baidu map API, there are many versions of the API for developers to call. In WEX5 development, the JavaScript API is integrated, tested, and successful. Today, starting from 0, step-by-step operation, in the future will produce more complex map and positioning effects, we learn together and progress together.

A demo effect:

Two design ideas:

Use the HTML page to load the Baidu map, and then put the HTML page in the IFRAME page.

Three code implementations:

1 apply for Baidu member, and apply for Baidu API AK (developer key)

All third-party integrations require a key, which is the equivalent of an ID assigned to the current user request, and the server uses the requested ID to determine the requested user information. In short, it is the key that confirms which developer submitted the request and to which developer to return the response data.

2 Creating an App

(note) IP whitelist, in fact, is to visit the site filter, if you allow all developer key under the website access, with the wildcard * can

3 Select the development version, today we are facing the web development, choose the lightweight JavaScript API

(note) The system generates an AK string after submission

4 Create HTML file, clear all code in source mode

5 Find API Demo code template, copy all to HTML source, replace AK

WEX5 Actual combat Baidu map JavaScript API integration

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.