📄 coordinat.js
字号:
// JScript File
// script untuk nampilin koordinat titik yang diklik
function getKoordinat(name, interaction)
{
if (arguments.length > 0) {
this.Init(name, interaction);
}
}
getKoordinat.prototype = new MapCommand();
getKoordinat.prototype.constructor = getKoordinat;
getKoordinat.superclass = MapCommand.prototype;
getKoordinat.prototype.Execute = function()
{
this.CreateUrl();
this.AddParamToUrl("PixelTolerance", this.pixelTolerance);
//create an XMLHttp obj to send request to server
var xmlHttp = CreateXMLHttp();
xmlHttp.open("GET", this.url, false);
xmlHttp.send(null);
//get response back
this.result = xmlHttp.responseText;
//buat alertnya
//alert("Coordinate : " + this.result);
posisi(event, this.result)
//jika ingin menampilkannya dalam div (label)
// var div = FindElement("koordinat");
// if(div.style.visibility != "visible")
// div.style.visibility = "visible";
// //display the response at client html
// div.innerHTML = "<font size=2 face=Arial><b>Koordinat:</b></font>" + this.result;
// alert(this.result);
};
function posisi(event,tip)
{
posisix= event.clientX + 2;
posisiy= event.clientY + 2;
crot = '<table cellpadding=0 cellspacing=0 border=1><tr><td bgcolor=white width=135 align=center><font size=1><b>' + tip +'</b></font><td bgcolor=gray width=10 align=center><a onclick=notip() class=kursor><b>X</b></a></table>';
document.getElementById("tips").style.display = 'block';
document.getElementById("tips").style.position='absolute';
document.getElementById("tips").style.left= posisix + 'px';
document.getElementById("tips").style.top= posisiy + 'px';
document.getElementById("tips").style.zIndex = 1;
document.getElementById("tips").innerHTML = crot;
};
function notip()
{
document.getElementById("tips").style.display = 'none';
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -