Florida (from DCW data); Locate a City

TatukGIS Internet Server LITE Samples

Choose City

Source code    Project files

This IS LITE sample shows how to build project files to present selected data with a dependence on scale. Zoom in a little and select any city from the "Choose City" drop down list. The map view will move to highlight the area centered on that city, with no change in the map scale.

This sample is created using a TIFF format raster image and a vector map layer held in a SQL database. The SQLLayers function provides for the storage of all the vector geometry in a single SQL database file.

The list of cities presented in the sample is built from the table "1pppoint_FEA" from the SQLLayer stored in dcw_data.mdb. The list is dynamically connected to the vector data. Any changes made to the vector data are reflected to the list of cities.

Notice that the descriptions for the vectors are not written in the florida.ttkgp file. The "ini" is used instead to describe each layer separately, similar to the Locate a district sample.


florida.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">

    Sub Page_Load(sender As Object, e As EventArgs)
        if Not Page.IsPostBack then
            DropDownList1.DataTextField = "PPPTNAME"
            DropDownList1.DataValueField="PPPTNAME"
            DropDownList1.DataSource = "FloridaQuery()"
            DropDownList1.DataBind()
        end if
    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)
        GIS.ZoomIn
    End Sub

    Sub GIS_ZoomOut_Click(sender As Object, e As ImageClickEventArgs)
        GIS.ZoomOut
    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 )
    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 )
    End Sub

    Sub GIS_Load(sender As Object, e As EventArgs)
        GIS.Open( Page.MapPath( "data/florida.ttkgp" )
    End Sub

    Function FloridaQuery() As System.Data.DataSet
        Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; "&
                                         Page.MapPath( "data/dcw_data.mdb" )
        Dim dbConnection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(connectionString)

        Dim queryString As String = "SELECT DISTINCT [1pppoint_FEA].[PPPTNAME] FROM [1pppoint_FEA] WHERE [1pppoint_FEA].[PPPTNAME] > '' ORDER BY [1pppoint_FEA].[PPPTNAME]"
        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 GIS_AfterPaint(sender As Object, e As PaintEventArgs)
        Dim city as string

        city = DropDownList1.SelectedItem.Text
        GIS.DrawScope( "cities", "PPPTNAME = '" &city & "'", "FlushCt" )
    End Sub

    Sub DropDownList1_SelectedIndexChanged(sender As Object, e As EventArgs)
        Dim city as string
        Dim oldZoom

        city = DropDownList1.SelectedItem.Text
        oldZoom=GIS.Zoom
        GIS.FitScope ("cities", "PPPTNAME = '" &city &"'")
        GIS.Zoom=oldZoom
        if GIS.Zoom < 200 then
            GIS.Zoom=200
        end if
    End Sub

</script>
<html>
<head>
    <link href="style.css" type="text/css" rel="stylesheet" />
</head>
<body>
    <a name="top">
    <h1>ECW Format Landsat 7 Image Mosaic of Australia
    </h1>
    <h2 class="comment">TatukGIS IS LITE Sample
    </h2>
    <form runat="server">
        <p class="comment">
            <asp:Table id="Table1" runat="server" BackColor="#E9E9E9" Width="261px">
                <asp:TableRow>
                    <asp:TableCell>
                        <asp:Label runat="server" id="Label1" font-bold="True" cssclass="bold">Choose City</asp:Label>
                    </asp:TableCell>
                    <asp:TableCell>
                        <asp:DropDownList id="DropDownList1" runat="server" Width="138px" DataSource="<%# FloridaQuery() %>" AutoPostBack="True" DataValueField="PPPTNAME" DataTextField="PPPTNAME" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"></asp:DropDownList>
                    </asp:TableCell>
                </asp:TableRow>
            </asp:Table>
        </p>
        <table cellspacing="0" cellpadding="0" border="0">
            <tbody>
                <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_ZoomIn" onclick="GIS_ZoomIn_Click" runat="server" ImageUrl="/TatukGIS_IS8/img/zoomin.gif"></asp:ImageButton>
                        <asp:ImageButton id="GIS_ZoomOut" onclick="GIS_ZoomOut_Click" runat="server" ImageUrl="/TatukGIS_IS8/img/zoomout.gif"></asp:ImageButton>
                    </td>
                    <td align="right">
                        <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>
                </tr>
                <tr>
                    <td colspan="2">
                        <p>
                            <ttkGIS:XGIS_VIEWERIS id="GIS" runat="server" Width="460px" ImageType="PNG24" OnAfterPaint="GIS_AfterPaint" OnLoad="GIS_Load" BorderWidth="1px" BorderColor="CornflowerBlue" Height="310px"></ttkGIS:XGIS_VIEWERIS>
                        </p>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>
    </a>
</body>
</html>

                    

Florida.ttkgp    Top

                    
                    
[TatukGIS]
Label.Alocator=false

[TatukGIS Layer1]
path=florida.tif

[TatukGIS Layer2]
path=1border.ttkls

[TatukGIS Layer3]
path=2ponet.ttkls

[TatukGIS Layer4]
path=1ponet.ttkls

[TatukGIS Layer5]
path=1pppoly.ttkls

[TatukGIS Layer6]
path=1dnneta.ttkls

[TatukGIS Layer7]
path=1dnnetp.ttkls

[TatukGIS Layer8]
path=1rdline.ttkls

[TatukGIS Layer9]
path=1pppoint.ttkls
name=cities

[TatukGIS Layer10]
path=1labels.ttkls

                    

1border.ttkls.ini    Top

                    
                    
[TatukGIS Layer]
Area.Color=102:204:255
Area.OutlineColor=50:200:235
Visible=false

[TatukGIS Layer 1]
MinZoom=2000
Visible=true

                    

1ponet.ttkls.ini and 2ponet.ttkls.ini    Top

                    
                    
[TatukGIS Layer]
Visible=false

[TatukGIS Layer 1]
Query=Popytype<>2
MinZoom=400
MaxZoom=2000
Area.Pattern=Transparent
Area.OutlineColor=130:130:130
Visible=true
Label.Field=Label
Label.Pattern=Transparent
Label.OutlineWidth=0
Label.Color=Black
Label.Font.Style=Bold
Label.Font.Size=10
Label.Position=MiddleRight:Flow

[TatukGIS Layer 2]
Query=Popytype<>2
MinZoom=2000
Area.Pattern=Solid
Area.Color=204:255:204
Area.OutlineColor=130:130:130
Visible=true

[TatukGIS Layer 3]
MinZoom=400
Query=Popytype=2
Area.Pattern=Transparent
Area.OutlineColor=50:200:235
Area.OutlineWidth=-1
Visible=true


                    

1pppoly.ttkls.ini    Top

                    
                    
[TatukGIS Layer]
Visible=false

[TatukGIS Layer 1]
MinZoom=2000
Area.Color=200:200:200
Area.OutlineColor=200:180:160
Visible=true

                    

1dnneta.ttkls.ini    Top

                    
                    
[TatukGIS Layer]
Line.Color=50:200:235
'Line.Width=-1
Visible=false

[TatukGIS Layer 1]
Query=DNLNTYPE=1
MinZoom=0
MaxZoom=4000
Line.Width=-1
Visible=true

[TatukGIS Layer 2]
Query=DNLNTYPE=1
MinZoom=4000
Line.Width=-2
Visible=true
                    

1dnnetp.ttkls.ini    Top

                    
                    
[TatukGIS Layer]
Area.Color=100:230:250
Area.OutlineColor=50:200:235
Visible=false

[TatukGIS Layer 1]
MinZoom=200
Query=DNPYTYPE=1
Visible=true

                    

1rdline.ttkls.ini    Top

                    
                    
[TatukGIS Layer]
Visible=false

[TatukGIS Layer 1]
MinZoom=1000
MaxZoom=5000
Query=(RDLNTYPE=1) or (RDLNTYPE=2) or (RDLNTYPE=3)
Line.Color=240:240:240
Line.Width=-1
Visible=true

[TatukGIS Layer 2]
MinZoom=5000
Query=(RDLNTYPE=1) or (RDLNTYPE=2) or (RDLNTYPE=3)
Line.Color=240:240:240
Line.Width=-2
Visible=true

[TatukGIS Layer 3]
MinZoom=5000
Query=(RDLNTYPE>3)
Line.Color=240:240:240
Line.Width=-1
Visible=true
                    

1pppoint.ttkls.ini    Top

                    
                    
[TatukGIS Layer]
Visible=false

[TatukGIS Layer 1]
Query=(PPPTNAME<>'') and (PPPTTYPE=2)
MinZoom=800
MaxZoom=2000
Marker.Color=240:240:240
Marker.OutlineColor=100:100:100
Marker.Style=Circle
Marker.OutlineWidth=-1
Marker.Size=-4
Visible=true


[TatukGIS Layer 2]
Query=PPPTNAME<>''
MinZoom=2000
MaxZoom=8000
Marker.Color=240:240:240
Marker.OutlineColor=100:100:100
Marker.Style=Circle
Marker.OutlineWidth=-1
Marker.Size=-5
Label.Field=ppptname
Label.Pattern=Transparent
Label.OutlineStyle=Clear
Label.Font.Size=7
Label.Font.Color=100:100:100
Label.Color=100:100:100
Label.Width=5000
LabelPosition=UpRight
Visible=true

[TatukGIS Layer 3]
Query=PPPTNAME<>''
MinZoom=8000
Marker.Color=240:240:240
Marker.OutlineColor=100:100:100
Marker.Style=Circle
Marker.OutlineWidth=-1
Marker.Size=-6
Label.Field=ppptname
Label.Pattern=Transparent
Label.OutlineStyle=Clear
Label.Font.Size=7
Label.Font.Color=100:100:100
Label.Color=100:100:100
Label.Width=5000
LabelPosition=UpRight
Visible=true

[TatukGIS Layer 4]
Query=PPPTNAME=''
MinZoom=8000
Marker.Color=240:240:240
Marker.OutlineColor=100:100:100
Marker.Style=Circle
Marker.OutlineWidth=-1
Marker.Size=-4
Visible=true

[TatukGIS Layer 5]
Style=FlushCt
Visible=true
MinZoom=0
MaxZoom=1000
Marker.Color=240:240:240
Marker.OutlineColor=200:100:100
Marker.Style=Circle
Marker.OutlineWidth=-1
Marker.Size=-4
Label.Field=ppptname
Label.Pattern=Transparent
Label.OutlineStyle=Clear
Label.Font.Size=8
Label.Font.Style=Bold
Label.Font.Color=white
Label.Color=200:100:100
Label.Width=5000
Label.Position=UpRight


[TatukGIS Layer 6]
Style=FlushCt
Visible=true
MinZoom=1000
Marker.Pattern=Transparent
Marker.OutlineColor=200:100:100
Marker.Style=Circle
Marker.OutlineWidth=-2
Marker.OutlineStyle=Dash
Marker.Size=-10
Label.Field=ppptname
Label.Pattern=Solid
Label.OutlineStyle=Clear
Label.Font.Size=8
Label.Font.Style=Bold
Label.Font.Color=white
Label.Color=200:100:100
Label.Width=5000
LabelPosition=UpRight



                    

1labels.ttkls.ini    Top

                    
                    
[TatukGIS Layer]
MinZoom=0
Line.Width=0
Label.Field=Label
Label.Alignment=Follow
Label.Color=50:102:204
Label.Font.Color=50:102:204
Label.Font.Style=Italic
Visible=true