SuperMap IS.NET自定义Action添加Mark
时间:2011-01-07 来源:awei20081
//当鼠标单击事件时候,触发添加Mark操作,map对象为实例化的MapControl对象
map.CustomLayer.AddMark("Mark"+Math.random(), e.mapCoord.x, e.mapCoord.y, null, null, "<img src='images/poi_search.gif' onclick='test()'/>", "", 10000, "mark", 1);
//当添加Mark后设置地图控件的操作为平移操作
var pan = new SuperMap.IS.PanAction();
map.SetAction(pan);
};
this.OnDblClick = function(e) { };
this.OnMouseMove = function(e) { };
this.OnMouseDown = function(e) { };
this.OnMouseUp = function(e) { };
this.OnContextMenu = function(e) { };
this.GetJSON = function() { return _ActionToJSON(this.type, []); }
};
//给地图控件设置
var tt = null;
function InsertTable() {
if (!tt) {
tt = new insertMarkT ();
}
map.SetAction(tt);
}
//Mark响应的鼠标单击事件
function test() {
alert("查询");
}