Hi Padmini..<br> In which file u wrote this code?or is it an in-built file?<br><br><div class="gmail_quote">On Thu, Dec 18, 2008 at 3:52 PM, padmini godavarthi <span dir="ltr"><<a href="mailto:godavarthi.padmini@gmail.com">godavarthi.padmini@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
Hi,<br>
Iam using Mapguide Opensource 2.0 (with .net 2.0 +IIS 5.1)<br>
<br>
I want to query the parcel_id and zoomed it on the map<br>
<br>
may code is<br>
<br>
<br>
NameValueCollection serverVars = Request.ServerVariables;<br>
String strServerVars = "";<br>
foreach (String str in serverVars.AllKeys)<br>
{<br>
<br>
strServerVars += "<br>" + str;<br>
<br>
}<br>
String platform = serverVars["SERVER_SOFTWARE"];<br>
String queryStr = serverVars["QUERY_STRING"];<br>
string queryStr1 = serverVars["Form"];<br>
NameValueCollection requestParams = Request.HttpMethod == "POST" ?<br>
Request.Form : Request.QueryString;<br>
String sessionId = Request.QueryString["SESSION"];<br>
//String sessionId = Request.QueryString["SESSION"]; ;<br>
<br>
string realPath = Request.ServerVariables["APPL_PHYSICAL_PATH"];<br>
String configPath = realPath + "webconfig.ini";<br>
MapGuideApi.MgInitializeWebTier(configPath);<br>
<br>
MgUserInformation userInfo = new MgUserInformation(sessionId);<br>
<br>
MgSiteConnection siteConnection = new MgSiteConnection();<br>
siteConnection.Open(userInfo);<br>
<br>
MgResourceService resService =<br>
(MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);<br>
MgFeatureService featureService =<br>
(MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService);<br>
<br>
MgMap map = new MgMap();<br>
map.Open(resService, "oramap");<br>
<br>
<br>
MgFeatureQueryOptions nameQuery = new MgFeatureQueryOptions();<br>
<br>
//nameQuery.SetFilter(ConfigurationManager.AppSettings["FieldToFilter"] +<br>
"=" + Globals.gURLParam);<br>
nameQuery.SetFilter("PARCEL_ID" + "=" + "670_111");<br>
MgResourceIdentifier parcelId = new<br>
MgResourceIdentifier("Library://Orasample/resora.FeatureSource");<br>
MgFeatureReader featureReader =<br>
featureService.SelectFeatures(parcelId, "GEOM_TABLE", nameQuery);<br>
<br>
//Highlight the query result on the map<br>
MgSelection selection = new MgSelection(map);<br>
MgLayer layer = (MgLayer)map.GetLayers().GetItem("GEOM_TABLE");<br>
<br>
<br>
featureReader = featureService.SelectFeatures(parcelId,<br>
"GEOM_TABLE", nameQuery);<br>
selection.AddFeatures(layer, featureReader, 0);<br>
String selectXML = selection.ToXml();<br>
selection.Save(resService, "oramap");<br>
Page.ClientScript.RegisterStartupScript(Page.GetType(), "test",<br>
"select('" + selectXML + "');", true);<br>
}<br>
<br>
but i got an error at<br>
<br>
MgFeatureReader featureReader = featureService.SelectFeatures(parcelId,<br>
"GEOM_TABLE", nameQuery);<br>
<br>
<br>
1)can u plz tell me what do u man by faeture class name?<br>
from where i will gt it?<br>
<br>
Thanks and Regards,<br>
Padmini.<br>
<font color="#888888">--<br>
View this message in context: <a href="http://www.nabble.com/Zoom-To-Selection-tp21070073p21070073.html" target="_blank">http://www.nabble.com/Zoom-To-Selection-tp21070073p21070073.html</a><br>
Sent from the MapGuide Users mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
mapguide-users mailing list<br>
<a href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Nisha P<br>IIITM-K<br><a href="mailto:nisha@iiitmk.ac.in">nisha@iiitmk.ac.in</a><br>