Recently done a project, which has a need for a project to use Baidu Map navigation, through the reference to the relevant information Baidu map API completed an example.
Example one:
API Address: Http://developer.baidu.com/map/jsdemo.htm
The effect is as follows:
Example two:
Baidu Map API is written by the JavaScript language, before use, you need to refer to the API to the page: now the new version of the need for the key, following the old version of the
<script src= "http://api.map.baidu.com/api?v= version &services=true or false" type= "Text/javascript" ></ Script>
Show Guangzhou railway station Simple example:
Add controls on Map:
Adding controls
Map.addcontrol (New Bmap.maptypecontrol ());
Maptypecontrol---------Map Type control
Copyrightcontrol--------Copyright Control
Scalecontrol--------Scale Control
Navigationcontrol------Zoom Control
Overviewmapcontrol----Thumbnail control
To create a callout:
var marker = new Bmap.marker (point); Create callout
map.addoverlay (marker); Add annotations to the map
To create an information window:
var Infowindow = new Bmap.infowindow ("I am Here"); Create an Information Window object
Map.openinfowindow (infowindow,point); Open Information window
Baidu Map Offset:
Longitude School positive: 0.008774687519;
Latitude School positive: 0.00374531687912;