百度地图使用
页面嵌入百度地图,并且使用自定义的图标标注点
?
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>百度地图</title><script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=yourAK"></script><script src="http://d1.lashouimg.com/static/js/release/jquery-1.4.2.min.js" type="text/javascript"></script></head><body><div style="width:1024px;height:768px;border:1px solid gray" id="container"></div></body></html><script type="text/javascript">var map = new BMap.Map("container");map.centerAndZoom(new BMap.Point(116.403884,39.914887), 13);map.enableScrollWheelZoom();var icon = new BMap.Icon('/assets/logo.jpg', new BMap.Size(162, 55), {anchor: new BMap.Size(30, 30)}) // logo.jpg为自定义的标注图片, anchor 设定图标位置var marker=new BMap.Marker(new BMap.Point(116.403884,39.914887),{icon: icon});map.addOverlay(marker);</script>
?