信息框闪了一下就没见了
<!DOCTYPE html >
<html style="width:100%;height:100%">
<head>
<meta charset="utf-8">
<title>简单demo</title>
</head>
<body style="width:100%;height:100%;margin:0;">
<div id="map" style="width:100%;height:100%;border:solid red 2px;"></div>
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3&key=f5540965ef2aafef4bd1804c816852c5"></script>
<script type="text/javascript">
(function(){
var map =new AMap.Map('map');
map.setCity('北京市');
var polyline =new AMap.Polyline();
var arr=[];//
arr.push( new AMap.LngLat(116.368904,39.913423));
arr.push( new AMap.LngLat(116.382122,39.901176));
arr.push( new AMap.LngLat(116.387271,39.912501));
arr.push( new AMap.LngLat(116.398258,39.904600));
zoom:14;
polyline.setPath(arr);
polyline.setMap(map);
AMap.event.addListener(polyline,'mouseover',function(){alert('');
});<!--鼠标划过时触发事件-->
var infoW = new AMap.InfoWindow({
colseWhenClickMap:true,
content:'我是信息框'
});
infoW.open(map,map.getCenter());
})();
<!-- var map =new AMap.Map('map');-->
</script>
</body>
</html>