visconsin.aspx Top
<%@ Page Language="VB" Debug="True" %>
<%@ Register TagPrefix="ttkGIS" Namespace="TatukGIS.IS" Assembly="TatukGIS.IS" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.OleDB" %>
<script runat="server">
dim layer as string
Sub Page_Load(sender As Object, e As EventArgs)
Select Case MapList.SelectedItem.Value
Case 4
DropDownList_QName.Visible=True
DropDownList_QRelation.Visible=True
TextBox_QValue.Visible=True
QButton.Visible=True
Case Else
DropDownList_QName.Visible=False
DropDownList_QRelation.Visible=False
TextBox_QValue.Visible=False
QButton.Visible=False
End select
if Not Page.IsPostBack then
DropDownList_County.DataTextField = "COUNTY"
DropDownList_County.DataValueField="COUNTY"
DropDownList_County.DataSource = "CountyQuery()"
DropDownList_County.DataBind()
Session("County") = DropDownList_County.SelectedItem.Text
Table_data.Visible = False
CheckBoxFlash.Checked = True
end if
Select Case MapList.SelectedItem.Value
Case 1
layer = "County names"
Case 2
layer = "County names"
Case 3
layer = "County names"
Case 4
if DropDownList_QName.SelectedItem.Value = 1 then
layer = "Human Population"
end if
if DropDownList_QName.SelectedItem.Value = 2 then
layer = "Milk cows"
end if
if DropDownList_QName.SelectedItem.Value = 3 then
layer = "Cows per person"
end if
if DropDownList_QName.SelectedItem.Value = 4 then
layer = "NIPF area"
end if
if DropDownList_QName.SelectedItem.Value = 5 then
layer = "NIPF area"
end if
End select
End Sub
Sub GIS_FullExtent_Click(sender As Object, e As ImageClickEventArgs)
GIS.FullExtent
End Sub
Sub GIS_ZoomIn_Click(sender As Object, e As ImageClickEventArgs)
Select Case GIS_Options.SelectedItem.Value
Case 1
GIS.Center(e.X, e.Y)
GIS.Zoom = GIS.Zoom*2
Case 2
GIS.Center(e.X, e.Y)
GIS.Zoom = GIS.Zoom*8
Case Else
GIS.ZoomIn
End select
End Sub
Sub GIS_ZoomOut_Click(sender As Object, e As ImageClickEventArgs)
Select Case GIS_Options.SelectedItem.Value
Case 1
GIS.Center(e.X, e.Y)
GIS.Zoom = GIS.Zoom/2
Case 2
GIS.Center(e.X, e.Y)
GIS.Zoom = GIS.Zoom/8
Case Else
GIS.ZoomOut
End select
End Sub
Sub GIS_Smaller_Click(sender As Object, e As ImageClickEventArgs)
GIS.Width = Unit.Pixel( GIS.Width.Value - 54 )
GIS.Height = Unit.Pixel( GIS.Height.Value - 40 )
Legend.Height = Unit.Pixel( Legend.Height.Value - 40 )
End Sub
Sub GIS_Larger_Click(sender As Object, e As ImageClickEventArgs)
GIS.Width = Unit.Pixel( GIS.Width.Value + 54 )
GIS.Height = Unit.Pixel( GIS.Height.Value + 40 )
Legend.Height = Unit.Pixel( Legend.Height.Value + 40 )
End Sub
Sub GIS_Load(sender As Object, e As EventArgs)
Select Case MapList.SelectedItem.Value
Case 1
GIS.Open( Page.MapPath( "data/ForestTypes.ttkgp" ) )
Case 2
GIS.Open( Page.MapPath( "data/NIPFinTax.ttkgp" ) )
Case 3
GIS.Open( Page.MapPath( "data/FarmsNum.ttkgp" ) )
Case 4
Select Case DropDownList_QName.SelectedItem.Value
Case 1
GIS.Open( Page.MapPath( "data/PeoplePpl.ttkgp" ) )
Case 2
GIS.Open( Page.MapPath( "data/MilkCows.ttkgp" ) )
Case 3
GIS.Open( Page.MapPath( "data/CowsPerson.ttkgp" ) )
Case 4
GIS.Open( Page.MapPath( "data/NIPF1.ttkgp" ) )
Case 5
GIS.Open( Page.MapPath( "data/NIPF2.ttkgp" ) )
End select
End select
GIS.SetParameters("btnFullExtent.Pos", "(10,10)")
GIS.SetParameters("btnZoom.Pos", "(40,10)")
GIS.SetParameters("btnZoomEx.Pos", "(70,10)")
GIS.SetParameters("btnDrag.Pos", "(100,10)")
GIS.SetParameters("btnSelect.Pos", "(130,10)")
End Sub
Sub GIS_Click(sender As Object, e As ImageClickEventArgs)
If ( GIS.Flash = True ) and ( GIS.Mode = XgisMode.Select )
GIS_Identify(sender, e)
Else
Select Case GIS_Options.SelectedItem.Value
Case 1
GIS_ZoomIn_Click(sender, e)
Case 2
GIS_ZoomIn_Click(sender, e)
Case 3
GIS.Center(e.X, e.Y)
Case 4
GIS_Identify(sender, e)
Case Else
GIS.ZoomOut
End select
End if
End Sub
Sub GIS_Identify(sender As Object, e As ImageClickEventArgs)
dim cname as string
dim dataSet as System.Data.DataSet
dim uid as integer
uid = GIS.Locate( layer, e.X, e.Y)
cname = GIS.Field( layer, uid, "COUNTY")
Session("oldCounty") = Session("County")
Session("County") = cname
If cname <> "" then
Table_data.visible = True
fname.Text=GIS.Field( layer, uid, "COUNTY")
farea.text=FormatNumber(GIS.Field( layer, uid, "AREA")/4046.86, 0, -1, -1, -1) & " acres"
fpeople.text=FormatNumber(GIS.Field( layer, uid, "POPULATN"), 0, -1, -1, -1)
faforest.text=FormatNumber(GIS.Field( layer, uid, "Forest_ac"), 0, -1, -1, -1) & " acres"
fnfarms.text=FormatNumber(GIS.Field( layer, uid, "farms_num"), 0, -1, -1, -1)
fafarms.text=FormatNumber(GIS.Field( layer, uid, "farms_ac"), 0, -1, -1, -1) & " acres"
facorn.text=FormatNumber(GIS.Field( layer, uid, "CornAcres"), 0, -1, -1, -1) & " acres"
fcows.text=FormatNumber(GIS.Field( layer, uid, "Milk_Cows"), 0, -1, -1, -1)
Else
Table_data.visible = False
End If
End Sub
Sub Legend_Load(sender As Object, e As EventArgs)
Legend.GIS_Viewer = GIS
End Sub
Function CountyQuery() As System.Data.DataSet
Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=" + Page.MapPath("data\wisconsin.mdb")
Dim dbConnection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(connectionString)
Dim queryString As String = "SELECT DISTINCT [Wisconsin].[COUNTY] FROM [Wisconsin] WHERE [wisconsin].[COUNTY] > '' ORDER BY [wisconsin].[COUNTY]"
Dim dbCommand As System.Data.IDbCommand = New System.Data.OleDb.OleDbCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection
Dim dataAdapter As System.Data.IDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter
dataAdapter.SelectCommand = dbCommand
Dim dataSet As System.Data.DataSet = New System.Data.DataSet
dataAdapter.Fill(dataSet)
Return dataSet
End Function
Sub DropDownList_County_SelectedIndexChanged(sender As Object, e As EventArgs)
Session("oldCounty") = Session("County")
Session("County") = DropDownList_County.SelectedItem.Text
Table_data.visible = False
End Sub
Sub DropDownList_Change(ByVal sender As Object, ByVal e As EventArgs)
GIS.Update()
End Sub
Sub QButton_Click(ByVal sender As Object, ByVal e As EventArgs)
GIS.Update()
End Sub
Sub GIS_Paint(sender As Object, e As PaintEventArgs)
if Page.IsPostBack then
if (strcomp(Session("County"), Session("oldCounty"), 1) <> 0) then
GIS.FitScope (layer, "COUNTY = '" &Session("County") &"'")
GIS.Zoom=GIS.Zoom*0.6
Session("oldCounty") = Session("County")
end if
end if
Gis.Draw()
End Sub
Sub GIS_AfterPaint(sender As Object, e As PaintEventArgs)
Dim QName, QRelation as string
Dim QValue as integer
Dim County as string
QName = DropDownList_QName.SelectedItem.Value
QRelation = DropDownList_QRelation.SelectedItem.Value
if isNumeric(TextBox_QValue.Text) then
QValue = cint(TextBox_QValue.Text)
else
TextBox_QValue.Text = 0
QValue = 0
end if
if MapList.SelectedItem.Value = 4 then
Select Case DropDownList_QName.SelectedItem.Value
Case 1
GIS.DrawScope( layer, "populatn " & QRelation & QValue, "FlushP" )
Case 2
GIS.DrawScope( layer, "MILK_COWS " & QRelation & QValue, "FlushM" )
Case 3
GIS.DrawScope( layer, "MILK_COWS/POPULATN " & QRelation & QValue, "FlushM" )
Case 4
GIS.DrawScope( layer, "TaxLawYes " & QRelation & QValue, "FlushM" )
Case 5
GIS.DrawScope( layer, "TaxLawNo " & QRelation & QValue, "FlushM" )
End select
end if
GIS.DrawScope( layer, "COUNTY = '" &Session("County") & "'", "FlushC" )
End Sub
Protected Sub CheckBoxFlash_Changed(ByVal sender As Object, ByVal e As System.EventArgs)
If GIS.Flash Then
GIS.Flash = False
Else
GIS.Flash = True
End If
UpdatePanel1.Visible = not GIS.Flash
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>TatukGIS IS LITE Sample - Wisconsin Thematic Map</title>
<link href="style.css" type="text/css" rel="stylesheet" />
</head>
<body>
<h1>Wisconsin Thematic Map
</h1>
<h2 class="comment"><a href="../samplesLITE.htm">TatukGIS Internet Server LITE Samples</a></h2>
<form runat="server" action="">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<asp:ImageButton id="GIS_Smaller" onclick="GIS_Smaller_Click" runat="server" ImageUrl="/TatukGIS_IS8/img/smaller.gif"></asp:ImageButton>
<asp:ImageButton id="GIS_Larger" onclick="GIS_Larger_Click" runat="server" ImageUrl="/TatukGIS_IS8/img/larger.gif"></asp:ImageButton>
</td>
<td>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" Visible="False">
<ContentTemplate>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<asp:ImageButton id="GIS_FullExtent" onclick="GIS_FullExtent_Click" runat="server" ImageUrl="/TatukGIS_IS8/img/fullextent.gif"></asp:ImageButton>
<asp:ImageButton id="GIS_ZoomOut" onclick="GIS_ZoomOut_Click" runat="server" ImageUrl="/TatukGIS_IS8/img/zoomout.gif"></asp:ImageButton>
<asp:ImageButton id="GIS_ZoomIn" onclick="GIS_ZoomIn_Click" runat="server" ImageUrl="/TatukGIS_IS8/img/zoomin.gif"></asp:ImageButton>
</td>
<td>
<asp:RadioButtonList id="GIS_Options" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Value="1" Selected="True">Zoom x2</asp:ListItem>
<asp:ListItem Value="2">Zoom x8</asp:ListItem>
<asp:ListItem Value="3">Center</asp:ListItem>
<asp:ListItem Value="4">Select</asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td colspan="2">
<ttkGIS:XGIS_ViewerIS id="GIS" onclick="GIS_Click" runat="server" OnPaint="GIS_Paint" Width="370px" Height="300px" OnLoad="GIS_Load" BorderColor="CornflowerBlue" BorderWidth="1px" ImageType="PNG24" OnAfterPaint="GIS_AfterPaint" Flash="True"></ttkGIS:XGIS_ViewerIS>
<ttkGIS:XGIS_LegendIS id="Legend" runat="server" Width="178px" Height="300px" OnLoad="Legend_Load" BorderColor="Desktop" BorderWidth="1px" BackColor="LightSteelBlue" ImageCompression="30" BorderStyle="Solid"></ttkGIS:XGIS_LegendIS>
</td>
</tr>
<tr>
<td colspan="2">
<asp:CheckBox ID="CheckBoxFlash" runat="server"
AutoPostBack="True"
OnCheckedChanged="CheckBoxFlash_Changed" Text="Flash control" />
</td>
</tr>
</table>
<div> </div>
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:Table id="Table1" runat="server" Width="555px" BackColor="#E9E9E9">
<asp:TableRow>
<asp:TableCell>
<asp:Label runat="server" id="Label1" cssclass="bold">Choose thematic map: </asp:Label>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:RadioButtonList runat="server" AutoPostBack="True" RepeatDirection="Vertical" ID="MapList">
<asp:ListItem Value="1" Selected="True">Forest Area & Types</asp:ListItem>
<asp:ListItem Value="2">Non Industrial Private Forest Land (NIPF) Inclusion in Forest Tax Law Program</asp:ListItem>
<asp:ListItem Value="3">Farms Area & Numbers/Price</asp:ListItem>
<asp:ListItem Value="4">Analysis</asp:ListItem>
</asp:RadioButtonList>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:DropDownList id="DropDownList_QName" runat="server">
<asp:ListItem Value="1">Human Population of County</asp:ListItem>
<asp:ListItem Value="2">Milk Cows</asp:ListItem>
<asp:ListItem Value="3">Milk Cows/Person</asp:ListItem>
<asp:ListItem Value="4">NIPF acres in Forestry Tax Law Program</asp:ListItem>
<asp:ListItem Value="5">NIPF acres Not in Forestry Tax Law Program</asp:ListItem>
</asp:DropDownList>
<asp:DropDownList id="DropDownList_QRelation" runat="server">
<asp:ListItem Value="<="><=</asp:ListItem>
<asp:ListItem Value="<"><</asp:ListItem>
<asp:ListItem Value=">">></asp:ListItem>
<asp:ListItem Value=">=" Selected="True">>=</asp:ListItem>
</asp:DropDownList>
<asp:TextBox id="TextBox_QValue" runat="server">0</asp:TextBox>
<asp:Button id="QButton" runat="server" Text="Show" OnClick="QButton_Click"></asp:Button>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:Label id="Label_County" runat="server" cssclass="bold" font-bold="True">Find
County:</asp:Label>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:DropDownList id="DropDownList_County" OnTextChanged="DropDownList_Change" runat="server" Width="138px" DataSource="<%# CountyQuery() %>" AutoPostBack="True" DataValueField="COUNTY" DataTextField="COUNTY" OnSelectedIndexChanged="DropDownList_County_SelectedIndexChanged"></asp:DropDownList>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
<asp:Table id="Table_data" runat="server" Width="555px" BorderColor="SteelBlue" BorderWidth="1px" BorderStyle="Solid" CellSpacing="0">
<asp:TableRow ForeColor="Transparent" BackColor="LightSteelBlue">
<asp:TableCell ColumnSpan="2" Font-Bold="True" HorizontalAlign="Center" BorderColor="Transparent" Text="C O U N T Y A T T R I B U T E S"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell Width="200px" Font-Bold="True" HorizontalAlign="Left" Text="County Name:"></asp:TableCell>
<asp:TableCell Width="350px" HorizontalAlign="Left" ID="fname"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell Width="200px" Font-Bold="True" HorizontalAlign="Left" Text="County Area:"></asp:TableCell>
<asp:TableCell Width="350px" HorizontalAlign="Left" ID="farea"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell Width="200px" Font-Bold="True" HorizontalAlign="Left" Text="Human Population:"></asp:TableCell>
<asp:TableCell Width="350px" HorizontalAlign="Left" ID="fpeople"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell Width="200px" Font-Bold="True" HorizontalAlign="Left" Text="Forest area:"></asp:TableCell>
<asp:TableCell Width="350px" HorizontalAlign="Left" ID="faforest"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell Width="200px" Font-Bold="True" HorizontalAlign="Left" Text="Farms area:"></asp:TableCell>
<asp:TableCell Width="350px" HorizontalAlign="Left" ID="fafarms"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell Width="200px" Font-Bold="True" HorizontalAlign="Left" Text="Number of farms:"></asp:TableCell>
<asp:TableCell Width="350px" HorizontalAlign="Left" ID="fnfarms"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell Width="200px" Font-Bold="True" HorizontalAlign="Left" Text="Acreage planted to corn:"></asp:TableCell>
<asp:TableCell Width="350px" HorizontalAlign="Left" ID="facorn"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell Width="200px" Font-Bold="True" HorizontalAlign="Left" Text="Milk Cows:"></asp:TableCell>
<asp:TableCell Width="350px" HorizontalAlign="Left" ID="fcows"></asp:TableCell>
</asp:TableRow>
</asp:Table>
</ContentTemplate>
</asp:UpdatePanel>
<p>
</form>
</body>
</html>