<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://www.forbst.com"></script>
<title>点击标注点,可查看由文本,图片构成的复杂型信息窗口</title>
<style type="text/css">
body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;}
</style>
</head>
<body>
<div id="div_map" style="width:100%;height:100%;"></div>
<script type="text/javascript">
var map=null;
map=new STMapObj("div_map");
map.locateMap(new STMapPoint(121.477547,31.227133),3);
//map.setDragMap(false);//不能被拖动3
//map.setZoomCompVisible(true);//缩放控件
//map.setScaleCompVisible(false);//比例尺控件
//map.layerControl("raser",true);
LocationPoint();
function LocationPoint(){
var poly = new STMapMarker();
poly.id="testline6"; //【必选】对象 id
poly.point=new STMapPoint(121.47727877909848,31.227720161691113); //【必选】经纬度坐标 STMapPoint 类型
poly.img="../img/carAPI.png"; //【必选】对象的图片地址 url
poly.label=""; //【可选】鼠标提示
poly.size="" //【可选】图片长宽 参数为 STMapSize 类型,默认为图片本身尺寸
poly.anchor="TL" // 【可选】定位锚点,BC (下边中心点)BL (左下角)BR (右下角)TL (左上角)TC (上边中心点)TR (右上角)ML (左边中心点)MR (右边中心点)CENTER (图片中心点)
poly.infowin=true; //【可选】是否点击显示信息窗口,默认为 true。
poly.title=""; //属性信息库标题,支持 html 代码
poly.content="<h4 style='margin:0 0 5px 0;padding:0.2em 0'>上海音乐厅</h4>" +
"<img style='float:right;margin:4px' id='imgDemo' src='../img/shmusic.png' width='150' height='104' title='天安门'/>" +
"<p style='margin:0;line-height:1.5;font-size:13px;text-indent:2em'>上海音乐厅欧式风格的建筑,气派十足;幽雅庄重的装修,很典雅。</p>" +
"</div>"; //属性信息框内容,支持 html 代码
poly.moveable = false; //是否可以拖动
map.addOverlay(poly);
}
</script>
<div style="display: none">
<script type="text/javascript">
var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cspan id='cnzz_stat_icon_1000501913'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s11.cnzz.com/z_stat.php%3Fid%3D1000501913' type='text/javascript'%3E%3C/script%3E"));
</script>
</div>
</body>
</html>