1. Add the convertor. JS File
<script type="text/javascript" src="http://api.map.baidu.com/getscript?v=1.4"></script><script type="text/javascript" src="http://dev.baidu.com/wiki/static/map/API/examples/script/convertor.js"></script>
2. Add Baidu map Annotation
Function loadmarker (X, Y, oap_name) {If (! X) {return} // correct the GPS deviation var iconv = ".. /.. /.. /icons/access_point_b64.gif "; var iconu = ".. /.. /.. /icons/access_point_r64.gif "; var iconsize = new bmap. size (64, 64); // mark the image size var offsetsize = new bmap. size (32, 32); // offset bit // var point = new bmap. point (x, y); var icon = new bmap. icon (iconv, iconsize, {anchor: offsetsize}); translatecallback = function (point) {map. clearoverlays (); map. setcenter (point); var marker = new bmap. marker (point, {icon: icon}); marker. addeventlistener ("Mouseover", function () {This. seticon (New bmap. icon (iconu, iconsize, {anchor: offsetsize}) ;}); marker. addeventlistener ("mouseout", function () {This. seticon (New bmap. icon (iconv, iconsize, {anchor: offsetsize}) ;}); map. centerandzoom (point, 16); map. addoverlay (Marker); var GC = new bmap. geocoder (); var infowindow1 = NULL; GC. getlocation (point, function (RS) {var addcomp = Rs. addresscomponents; infowindow1 = new bmap. infowindow ("<Div style = 'margin-top: 13px; font-size: 15px; color: red; font-weight: bold; '> "+ oap_name +" </div> <Div style = 'margin-top: 5px; font-size: 13px;'> address: "+ addcomp. province + addcomp. city + addcomp. district + addcomp. street + addcomp. streetnumber + "<br/> longitude:" + x + "<br/> latitude:" + Y + "</div>"); marker1.openinfowindow (infowindow1 );}); marker. addeventlistener ("click", function () {This. openinfowindow (infowindow1) ;}) ;}bmap. convertor. translate (New bmap. point (x, y), 0, translatecallback );}
3. The final result is as follows:
Success.
Solutions for GPS and base station location correction on Baidu Map