Professional Documents
Culture Documents
php
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
?>
<?php
require_once '../utilityfunctions.php';
require_once '../JSON.php';
require_once 'classes/theme.php';
$args = ($_SERVER['REQUEST_METHOD'] == "POST") ? $_POST : $_GET;
$errorMsg = null;
$errorDetail = null;
try
{
MgInitializeWebTier($configFilePath);
$theme = new Theme($args);
$layerNames = $theme->GetMapLayerNames();
}
catch (MgException $mge)
{
$errorMsg = $mge->GetMessage();
$errorDetail = $mge->GetDetails();
}
catch (Exception $e)
{
$errorMsg = $e->GetMessage();
}
?>
<html>
<head>
<title>Theme Layer</title>
<link rel="stylesheet" href="../styles/gt.css" type="text/css">
<script language="javascript" src="../../viewerfiles/browserdetect.js"></scr
ipt>
<script language="javascript" src="../json.js"></script>
<script language="javascript">
var READY_STATE_UNINITIALIZED
var READY_STATE_LOADING
= 0;
= 1;
var READY_STATE_LOADED
var READY_STATE_INTERACTIVE
var READY_STATE_COMPLETE
= 2;
= 3;
= 4;
SET_FILL_FROM_COLOR
SET_FILL_TO_COLOR
SET_LINE_FROM_COLOR
SET_LINE_TO_COLOR
var
var
var
var
fillFromColor
fillToColor =
lineFromColor
lineToColor =
= 1;
= 2;
= 3;
= 4;
= "FF0000";
"0000FF";
= "000000";
"000000";
= "COMMAND=GETLAYERINFO";
+= "&SESSION=" + encodeURIComponent(session);
+= "&MAPNAME=" + encodeURIComponent(mapName);
+= "&LAYERNAME=" + encodeURIComponent(layerSelect.value);
if (msie)
reqHandler = new ActiveXObject("Microsoft.XMLHTTP");
else
reqHandler = new XMLHttpRequest();
reqHandler.open("POST", "themecontroller.php", false);
reqHandler.setRequestHeader("Content-Type", "application/x-www-formurlencoded");
reqHandler.send(reqParams);
layerInfo = reqHandler.responseText.parseJSON();
propertySelect.options.length = 0;
for (var i = 0; i < layerInfo.properties.length; i++)
{
propertySelect.options[i] = new Option(layerInfo.properties[i].n
ame, i, false, false);
}
OnPropertyChange();
scaleSelect.options.length = 0;
for (var i = 0; i < layerInfo.scaleRanges.length; i++)
{
scaleSelect.options[i] = new Option(layerInfo.scaleRanges[i], i,
false, false);
}
}
function OnPropertyChange()
{
var propertySelect = document.getElementById("propertySelect");
var distroSelect = document.getElementById("distroSelect");
PopulateMinMaxCount(propertySelect.value);
distroSelect.options.length = 0;
if (propertySelect.selectedIndex >= 0)
{
for (var i = 0; i < layerInfo.properties[propertySelect.value].d
istroTypes.length; i++)
{
distroSelect.options[i] = new Option(distNameArray[layerInfo
.properties[propertySelect.value].distroTypes[i]], distValueArray[layerInfo.prop
erties[propertySelect.value].distroTypes[i]], false, false);
}
}
OnDistroChange();
}
function OnDistroChange()
{
var distroSelect = document.getElementById("distroSelect");
var numRules = document.getElementById("numRules");
if (distroSelect.value == distValueArray[0])
{
numRules.disabled = true;
numRules.value = featureCount;
}
else
{
numRules.disabled = false;
numRules.value = ruleCount;
}
}
function PopulateMinMaxCount(propertyIndex)
{
var layerSelect = document.getElementById("layerSelect");
reqParams = "COMMAND=GETPROPERTYMINMAXCOUNT";
reqParams += "&SESSION=" + encodeURIComponent(session);
reqParams += "&MAPNAME=" + encodeURIComponent(mapName);
reqParams += "&LAYERNAME=" + encodeURIComponent(layerSelect.value);
reqParams += "&PROPERTYNAME=" + encodeURIComponent(layerInfo.propert
ies[propertyIndex].name);
if (msie)
</select>
</td>
</tr>
<tr><td colspan="2"># of Rules:</td></tr>
<tr>
<td colspan="2" class="RegText">
<input maxlength="10" class="Ctrl" id="numRules" value="8" style="wi
dth: 100%">
</td>
</tr>
<tr><td colspan="2" class="Spacer"></td></tr>
<tr><td colspan="2" class="SubTitle">Scale Range</td></tr>
<tr>
<td colspan="2" class="RegText">
<select size="1" class="Ctrl" id="scaleSelect" style="width: 100%">
</select>
</td>
</tr>
<tr><td colspan="2" class="Spacer"></td></tr>
<tr><td colspan="2" class="SubTitle">Style Ramp</td></tr>
<tr><td>Fill Transparency:</td></tr>
<tr>
<td colspan="2" class="RegText">
<input class="Ctrl" id="fillTrans" type="text" maxlength="3" value=
"0" style="width:90%"> %
</td>
</tr>
<tr><td colspan="2" class="Spacer"></td></tr>
<tr><td>Fill Color:</td></tr>
<tr>
<td valign="top">
From:<br>
<span class="Swatch" id="fillFromSwatch" style="co
lor: #FF0000; background-color: #FF0000"> transparent </span> &nb
sp;
<input class="Ctrl" type="button" value="..." style="width: 22px;" o
nClick="PickColor(SET_FILL_FROM_COLOR,false,false)">
</td>
<td valign="top">
To:<br>
<span class="Swatch" id="fillToSwatch" style="colo
r: #0000FF; background-color: #0000FF"> transparent </span>  
;
<input class="Ctrl" type="button" value="..." style="width: 22px;" o
nClick="PickColor(SET_FILL_TO_COLOR,false,false)">
</td>
</tr>
<tr><td colspan="2" class="Spacer"></td></tr>
<tr><td>Border Color:</td></tr>
<tr>
<td valign="top">
From:<br>
<span class="Swatch" id="lineFromSwatch" style="co
lor: #000000; background-color: #000000"> transparent </span> &nb
sp;
<input class="Ctrl" type="button" value="..." style="width: 22px;" o
nClick="PickColor(SET_LINE_FROM_COLOR,false,false)">
</td>
<td valign="top">
To:<br>