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