📄 setunits.htm
字号:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<HTML>
<HEAD>
<TITLE>Untitled</TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
var docString = document.location.search;
var t_set;
if (opener) {
if (opener.name=="MapFrame") {
t_set = opener.parent.MapFrame;
} else {
t_set = opener;
}
} else {
if (parent.MapFrame) {
t_set = parent.MapFrame;
} else {
t_set=document;
}
}
var ScaleBarUnits = "FEET";
var MapUnits = "METERS";
function setValues() {
var f = document.Measure;
//var t = parent.MapFrame;
//f.cDisplayUnits.value = t_set.ScaleBarUnits;
}
function resetClick() {
t_set.resetClick();
if (opener)
window.close();
else
document.location = "text.htm";
}
function cancelClick() {
if (t_set.toolMode == 20) {
t_set.updateMeasureBox();
}
//if (docString=="") {
if (opener)
window.close();
else
document.location = "text.htm";
//} else {
// t_set.writeOptionForm();
//}
}
function setDUnits() {
ScaleBarUnits = t_set.ScaleBarUnits;
var f = document.forms[0];
var i = f.newDUnits.selectedIndex;
//var oldUnits = f.cDisplayUnits.value;
//alert(i);
var k = f.newDUnits.options[i].value;
var m = "FEET";
t_set.ScaleBarUnits = k;
if (t_set.drawScaleBar2) {
switch (k) {
case "MILES":
t_set.ScaleBar2Units = "KILOMETERS";
break;
case "KILOMETERS":
t_set.ScaleBar2Units = "MILES";
break;
case "FEET":
t_set.ScaleBar2Units = "METERS";
break;
case "METERS":
t_set.ScaleBar2Units = "FEET";
break;
}
}
if (t_set.setMapUnits) {
i = f.newMUnits.selectedIndex;
m = f.newMUnits.options[i].value;
t_set.MapUnits = m;
}
//f.cDisplayUnits.value = k;
if (t_set.toolMode == 20) {
//t_set.resetClick();
var tDist = convertUnits(t_set.totalMeasure,ScaleBarUnits,k);
t_set.totalMeasure = tDist;
//alert(t_set.totalMeasure);
tDist = convertUnits(t_set.currentMeasure,ScaleBarUnits,k);
t_set.currentMeasure = tDist;
t_set.updateMeasureBox();
if (t_set.drawScaleBar) t_set.sendMapXML();
} else {
//t_set.writeOptionForm();
if (t_set.drawScaleBar) t_set.sendMapXML();
}
if (opener)
window.close();
else
document.location = "text.htm";
}
function convertUnits(oldTotal,oldUnits,newUnits) {
// no decimal numbers hardcoded so that this can be used
// by locales that use comma instead of point
var newTotal=0;
if (oldUnits=="FEET") {
//FEET
if (newUnits=="MILES") {
newTotal = oldTotal / 5280;
} else if (newUnits=="METERS") {
newTotal = oldTotal * (3048/10000);
} else if (newUnits=="KILOMETERS") {
newTotal = oldTotal * (3048/10000000);
}
} else if (oldUnits=="MILES") {
//MILES
if (newUnits=="FEET") {
newTotal = oldTotal * 5280;
} else if (newUnits=="METERS") {
newTotal = oldTotal * (1609344/1000);
} else if (newUnits=="KILOMETERS") {
newTotal = oldTotal * (1609344/1000000);
}
} else if (oldUnits=="METERS") {
//METERS
if (newUnits=="FEET") {
newTotal = oldTotal * (3280839895/1000000000);
} else if (newUnits=="MILES") {
newTotal = oldTotal * (6213711922/10000000000000);
} else if (newUnits=="KILOMETERS") {
newTotal = oldTotal / 1000;
}
} else {
//KILOMETERS
if (newUnits=="FEET") {
newTotal = oldTotal * (3280839885/1000000);
} else if (newUnits=="METERS") {
newTotal = oldTotal * 1000;
} else if (newUnits=="MILES") {
newTotal = oldTotal * (6213711922/10000000000);
}
}
var u = Math.pow(10,t_set.numDecimals);
//if (u>0)
newTotal = parseInt(newTotal*u+(5/10))/u;
return newTotal;
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="Black" TEXT="White" TOPMARGIN=0 onload="window.focus(); setValues();" LEFTMARGIN=0>
<DIV ALIGN="center">
<FONT FACE="Arial" SIZE="-2"><B>
<FORM ACTION="" NAME="Measure">
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
var t_set;
if (opener) {
if (opener.name=="MapFrame") {
t_set = opener.parent.MapFrame;
} else {
t_set = opener;
}
} else {
if (parent.MapFrame) {
t_set = parent.MapFrame;
} else {
t_set=document;
}
}
var f = document.Measure;
document.writeln('<TABLE CELLSPACING="2" NOWRAP BGCOLOR="Gray" WIDTH=100%>');
document.writeln(' <TR>');
document.writeln(' <TH COLSPAN="4" ALIGN="CENTER">');
document.writeln(' <FONT FACE="Arial" SIZE="-1"><B>' + t_set.buttonList[32] + '</B></FONT>');
document.writeln(' </TH>');
document.writeln(' </TR>');
document.writeln(' <TR>');
if (t_set.setMapUnits) {
document.writeln('<td>');
document.writeln('<font face="Arial" size="-2">' + t_set.titleList[17] + '</font>');
//document.writeln(parent.MapFrame.ScaleBarUnits);
document.writeln('<select name="newMUnits">');
document.write('<option value="FEET"');
if (t_set.MapUnits=="FEET") document.write(' selected');
document.write('>' + t_set.unitList[1]);
document.write('<option value="METERS"');
if (t_set.MapUnits=="METERS") document.write(' selected');
document.write('>' + t_set.unitList[3]);
document.write('<option value="DEGREES"');
if (t_set.MapUnits=="DEGREES") document.write(' selected');
document.write('>' + t_set.unitList[0]);
document.writeln('</select>');
document.writeln('</td>');
}
document.writeln('<TD>');
document.writeln('<FONT FACE="Arial" SIZE="-2">' + t_set.titleList[16] + '</FONT>');
//document.writeln(parent.MapFrame.ScaleBarUnits);
document.writeln('<select name="newDUnits">');
document.write('<option value="FEET"');
if (t_set.ScaleBarUnits=="FEET") document.write(' selected');
document.write('>' + t_set.unitList[1]);
document.write('<option value="MILES"');
if (t_set.ScaleBarUnits=="MILES") document.write(' selected');
document.write('>' + t_set.unitList[2]);
document.write('<option value="METERS"');
if (t_set.ScaleBarUnits=="METERS") document.write(' selected');
document.write('>' + t_set.unitList[3]);
document.write('<option value="KILOMETERS"');
if (t_set.ScaleBarUnits=="KILOMETERS") document.write(' selected');
document.write('>' + t_set.unitList[4]);
document.writeln('</select>');
document.writeln('</TD>');
document.writeln('<TD>');
document.writeln(' <INPUT TYPE="Button" NAME="setDU" VALUE="' + t_set.buttonList[32] + '" onclick="setDUnits()">');
document.writeln('</TD>');
document.writeln('<TD>');
document.writeln(' ');
document.writeln(' <INPUT TYPE="Button" NAME="done" VALUE="' + t_set.buttonList[49] + '" onclick="cancelClick()">');
document.writeln(' ');
document.writeln('</TD>');
</SCRIPT>
</TR>
</TABLE>
</FORM>
</B></FONT>
</DIV>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE></TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -