The front end of combat - the introduction of Baidu map

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/qq_36251118/article/details/82894569

Proceed as follows:

1. Open Baidu map generator, Address: http://api.map.baidu.com/lbsapi/creatmap/index.html

2. In the "central point positioning", switch cities, to find the specific location;

3. In the "map set" according to their own preferences to modify the appearance of the map (width and height may modify the map, the map zoom status, etc.);

4. In the "Add Dimension", add the location and the information they want to label;

5. In the "second step of obtaining the code" click "Get Code" button;

6. Save the step of generating the code for the html file, open the browser you can see Baidu own definition of the map.

Note: If you want to map to an existing Web page, you can use iframe tags, such as:

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

You may also encounter problems:

Many people in the auto-generated code into the page, marked icon is not displayed. Through access to information, a lot of people say that this is Baidu library there is a problem. The solution is simple, only need to change the image path code label icon on it.

var icon = new BMap.Icon("http://map.baidu.com/image/us_mk_icon.png",)

Guess you like

Origin blog.csdn.net/qq_36251118/article/details/82894569