locatebyattribute in c#

Delfos, Jacob Jacob.Delfos at MAUNSELL.COM
Thu May 17 01:54:32 EDT 2007


Please CC to the list if you reply, so you are more likely to get a
proper answer. 

I have no experience in C# whatsoever, but the approach that the
LocateByAttribute widget uses is that it saves each result into a
shapefile, and then adds the shapefile dynamically to the map (using
yellow outline). So you have to do something along those lines.

Regards,

Jacob



> -----Original Message-----
> From: veeraswamyd at yahoo.co.in [mailto:veeraswamyd at yahoo.co.in] 
> Sent: 17 May 2007 13:51
> To: Delfos, Jacob
> Subject: Re: locatebyattribute in c#
> 
> 
> i have already written this in c#
> my code is displaying data in the table,but i dont know the 
> code to zoom the map related to that data.
> so i want code for this part 
> my code is :
> 
> Private Sub butFind_Click(ByVal sender As System.Object, 
> ByVal e As System.EventArgs) Handles butFind.Click
>                        lblInfo.Visible = False
>                      litIdentifyResult.Text = ""
>         Dim str, st, st1 As String
>         str = ddlLayersQuery.SelectedItem.ToString
>         layer = map.getLayerByName(str)
>         st = ddlFieldsQuery.SelectedItem.ToString
>         If (layer.queryByAttributes(map, st, 
> txtName.text,mapscript.MS_MULTIPLE) = MS_RETURN_VALUE.MS_SUCCESS) Then
>             result = layer.getResults()
>             If (result.numresults > 0) Then
>                 shapeInd = result.getResult(0).shapeindex
>                 layer.open()
>                 shape = layer.getFeature(shapeInd, -1)
> 
>                             For j = 0 To result.numresults - 1
>                     shapeInd = result.getResult(j).shapeindex
>                     layer.open()
>                     shape = layer.getFeature(shapeInd, -1)
>                     For i = 0 To layer.numitems - 1
>                         litIdentifyResult.Text += "<BR><B>" + 
> layer.getItem(i) + "</B>=" + shape.getValue(i)
>                     Next
>                 Next
>                 layer.close()
>             End If
>         Else
>             lblInfo.Visible = True
>             lblInfo.Text = "No Results Found for '" & 
> txtValue.Text & "'"
>         End If
> 
>       End Sub
> 

This email and any attachments are intended solely for the named recipient and are confidential. The copying or distribution of them or any information they contain by anyone other than the named recipient is prohibited. If you have received this document in error, please notify the sender and delete all copies from your computer system and destroy all hard copies. It is the recipient's responsibility to check this email and any attachments to this email for viruses before use.



More information about the mapserver-users mailing list