[mapguide-users] Zoom To Selection
Nisha P
nishap97 at gmail.com
Wed Mar 11 06:17:18 EDT 2009
Hi Padmini..
In which file u wrote this code?or is it an in-built file?
On Thu, Dec 18, 2008 at 3:52 PM, padmini godavarthi <
godavarthi.padmini at gmail.com> wrote:
>
>
> Hi,
> Iam using Mapguide Opensource 2.0 (with .net 2.0 +IIS 5.1)
>
> I want to query the parcel_id and zoomed it on the map
>
> may code is
>
>
> NameValueCollection serverVars = Request.ServerVariables;
> String strServerVars = "";
> foreach (String str in serverVars.AllKeys)
> {
>
> strServerVars += "<br>" + str;
>
> }
> String platform = serverVars["SERVER_SOFTWARE"];
> String queryStr = serverVars["QUERY_STRING"];
> string queryStr1 = serverVars["Form"];
> NameValueCollection requestParams = Request.HttpMethod == "POST" ?
> Request.Form : Request.QueryString;
> String sessionId = Request.QueryString["SESSION"];
> //String sessionId = Request.QueryString["SESSION"]; ;
>
> string realPath = Request.ServerVariables["APPL_PHYSICAL_PATH"];
> String configPath = realPath + "webconfig.ini";
> MapGuideApi.MgInitializeWebTier(configPath);
>
> MgUserInformation userInfo = new MgUserInformation(sessionId);
>
> MgSiteConnection siteConnection = new MgSiteConnection();
> siteConnection.Open(userInfo);
>
> MgResourceService resService =
>
> (MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);
> MgFeatureService featureService =
>
> (MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService);
>
> MgMap map = new MgMap();
> map.Open(resService, "oramap");
>
>
> MgFeatureQueryOptions nameQuery = new MgFeatureQueryOptions();
>
> //nameQuery.SetFilter(ConfigurationManager.AppSettings["FieldToFilter"] +
> "=" + Globals.gURLParam);
> nameQuery.SetFilter("PARCEL_ID" + "=" + "670_111");
> MgResourceIdentifier parcelId = new
> MgResourceIdentifier("Library://Orasample/resora.FeatureSource");
> MgFeatureReader featureReader =
> featureService.SelectFeatures(parcelId, "GEOM_TABLE", nameQuery);
>
> //Highlight the query result on the map
> MgSelection selection = new MgSelection(map);
> MgLayer layer = (MgLayer)map.GetLayers().GetItem("GEOM_TABLE");
>
>
> featureReader = featureService.SelectFeatures(parcelId,
> "GEOM_TABLE", nameQuery);
> selection.AddFeatures(layer, featureReader, 0);
> String selectXML = selection.ToXml();
> selection.Save(resService, "oramap");
> Page.ClientScript.RegisterStartupScript(Page.GetType(), "test",
> "select('" + selectXML + "');", true);
> }
>
> but i got an error at
>
> MgFeatureReader featureReader = featureService.SelectFeatures(parcelId,
> "GEOM_TABLE", nameQuery);
>
>
> 1)can u plz tell me what do u man by faeture class name?
> from where i will gt it?
>
> Thanks and Regards,
> Padmini.
> --
> View this message in context:
> http://www.nabble.com/Zoom-To-Selection-tp21070073p21070073.html
> Sent from the MapGuide Users mailing list archive at Nabble.com.
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
--
Nisha P
IIITM-K
nisha at iiitmk.ac.in
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20090311/b3def960/attachment.html
More information about the mapguide-users
mailing list