Baidu Map generates static images based on URL address parameters

 

 

Reference: http://www.cnblogs.com/lonelyxmas/p/4208083.html

 

 

 

Original: [Baidu Map API] Release the static map API! Just one URL, you can display customized Baidu map!

 

Summary:

Baidu map static map API! You don't need to take any "special" action to display this image on your page.

JavaScript is not required. We just create a URL and put it in the <img> tag. You can embed customized Baidu map images into your own web pages.

--------------------------------------------------------------------------------------------------------------

Quick example

Return to the map with the center point at Baidu Building, and mark it here. In this example, the center point center and the label position markers are specified.

The parameters of center and markers can be text or Baidu coordinates. Any geographic coordinates can be converted to Baidu coordinates. For details, please contact: [email protected]

http://api.map.baidu.com/staticimage?center=百度大厦&markers=百度大厦

<iframe id="iframe_0.2701659341858007" style="margin: 0px; padding: 0px; border: none; width: 20px; height: 20px;" src="data:text/html;charset=utf8,%3Cstyle%3Ebody%7Bmargin:0;padding:0%7D%3C/style%3E%3Cimg%20id=%22img%22%20src=%22http://dev.baidu.com/wiki/static/map/API/img/staticimage.png?_=4208083%22%20style=%22border:none;max-width:987px%22%3E%3Cscript%3Ewindow.onload%20=%20function%20()%20%7Bvar%20img%20=%20document.getElementById('img');%20window.parent.postMessage(%7BiframeId:'iframe_0.2701659341858007',width:img.width,height:img.height%7D,%20'http://www.cnblogs.com');%7D%3C/script%3E" frameborder="0" scrolling="no"></iframe>

List of service parameters

Parameter Name Required Default Value Description
width no 400 Image width. Value range: (0, 1024].
height no 300 Image height. Value range: (0, 1024].
center no Beijing The location of the center point of the map. The parameters can be latitude and longitude coordinates or a name.
zoom no 11 map level. Value range: [1, 18].
bbox no null Map field of view. Format: minX,minY,maxX,maxY.
markers no null Labels, which can be described by latitude and longitude or address/place name; multiple labels are separated by vertical bars.
markerStyles no null Label style, the format is: size,label. Separate multiple styles with vertical bars. There is an index correspondence with markers.

Terms of Use and Restrictions

Request frequency: Dedicated IP 10/sec

URL length 2048

The maximum number of displayed point markers is 20

---------------------------------------------------------------------------------------------------------

Reference URL: http://dev.baidu.com/wiki/map/index.php?title=%E9%9D%99%E6%80%81%E5%9B%BEAPI

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326448722&siteId=291194637