//主要通过改变工具栏上工具对应的图片的标题来实现(测试通过改变它的toolTip,但是未成功)
var mapprintdiv = document.getElementById("PrintMapDiv");
var toolbarobj = $find("Toolbar1");
var toolbar = (toolbarobj != null) ? Toolbars[toolbarobj._uniqueID] : null;
var toolbarItemName = "PrintMap";
var imageTag = "Toolbar1PrintMapImage"; //这个的名称的规则是"Toolbar1"+toolbarItemName+"Image"
var img = document.images[imageTag];
if (mapprintdiv.style.visibility == "hidden") {
mapprintdiv.style.top = 50;
mapprintdiv.style.left = 50;
mapprintdiv.style.visibility = "visible";
if (toolbar != null) { //改变工具的提示
img.alt = "关闭地图打印";
img.title = "关闭地图打印";
switchImageSourceAndAlphaBlend(img, toolbar.items[toolbarItemName].defaultImage); //这个应该是esri封装的js函数
}
}
else {
mapprintdiv.style.visibility = "hidden";
if (toolbar != null) {//改变工具的提示
img.alt = "地图打印";
img.title = "地图打印";
switchImageSourceAndAlphaBlend(img, toolbar.items[toolbarItemName].defaultImage);
}
}