How to introduce Baidu map to your web page

Source: Internet
Author: User

1. Open "Baidu Map Generator" and enter the following interface:

2. In the "Location Center point", switch the city, find the specific location;

3. In "Set up map", modify the appearance of the map according to your preference (can modify the width of the map, the map's zoom state, etc.);

4. In "Add callout", add the location and information you want to label;

Note: The callout can change the label icon, can write the label name and note, in the generator can be marked up to 10 locations, more than 10 parts are not displayed;

Workaround: Manually add the information of the marker point directly in the generated source code (modify the latitude and longitude of the mark point yourself), the test can show more than 10 points of the label; (for reference only)

5. In the "second Step Get Code", click the "Get Code" button;

6. Save the code generated in the previous step as an HTML file, and you can see your own defined Baidu map when the browser opens.

Note: If you want to add a map to an existing Web page, you can use the IFRAME tag, such as:

<iframe src= "map.html" width= "" "height=" frameborder= "0" scrolling= "no" ></iframe>

Problems that you may encounter:

Many people do not display the callout icon when they insert the generated code into the page. After consulting the data, many people say that this is the problem of Baidu Library. The workaround is simple, just change the image path of the callout icon in the code.

var icon = new Bmap.icon ("Http://map.baidu.com/image/us_mk_icon.png",)

How to introduce Baidu map to your web page

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.