szgeoinfo.Overlay

Class: szgeoinfo.Overlay


new Overlay(point, imageurl)

地图覆盖物

Parameters:
Name Type Description
point szgeoinfo.Point

点坐标

imageurl string

图片url

Example
var center = new szgeoinfo.Point(114.031022,22.546025);
 var center = new szgeoinfo.Point(114.031022,22.546025);
 var overlay = new szgeoinfo.Overlay(center,"images/bluepoint.png");
 overlay.name = "";
 overlay.point = center;
//鼠标点击
overlay.setClickFun(function () {     
});
//鼠标悬浮
overlay.setMouseOverFun(function () {
            overlay.element.style='cursor:pointer';
            overlay.element.title="深圳";
});
//鼠标移开
overlay.setMouseOutFun(function () {     
});
map.addOverlay(overlay);
//overlay的信息窗口
overlay.showInfo("<table style='background-color: white;border: 1px solid #DDDDDD;width:100px;margin: auto'><tr><td>标题</td></tr><tr><td>福田</td></tr></table>");

map.removeOverlay(overlay);//移除单个overlay
map.clearOverlays();//清除所有的Overlay

Methods


hideInfo()

隐藏Overlay信息


setClickFun(fun)

点击事件回调

Parameters:
Name Type Description
fun function

回调函数


setMouseOutFun(fun)

鼠标悬浮移开事件回调,仅支持二维

Parameters:
Name Type Description
fun function

回调函数


setMouseOverFun(fun)

鼠标悬浮上去事件回调,仅支持二维

Parameters:
Name Type Description
fun function

回调函数


showInfo(info)

添加Overlay信息

Parameters:
Name Type Description
info string

显示文本信息