[mapguide-users] Start the map with coordinates specified in the URL

Rubén Casal Prieto terri2213 at msn.com
Thu Jan 21 11:29:28 EST 2010


HHHello, I have this code, to start the map with coordinates with parameters passed in the URL.


            String requestParams STRX = [ "X"];

            String requestParams String = [ "Y"];


            MgSiteConnection siteconection = new MgSiteConnection ();

            siteconection.Open (new MgUserInformation (sessionId));

            MgResourceService resourceService = (MgResourceService)
siteconection.CreateService (MgServiceType.ResourceService) as
MgResourceService;


            MgResourceIdentifier wlresourceId = new MgResourceIdentifier (webLayout);

            MgByteReader wlreader = resourceService.GetResourceContent (wlresourceId);

            WlXML = wlreader.ToString String ();

            XmlDocument doc = new XmlDocument ();

            doc.LoadXml (wlXML);


            XmlNode doc.GetElementsByTagName NodeCenterx = ( "centerX"). Item (0);

            NodeCenterx.LastChild.Value = STRX;

            XmlNode doc.GetElementsByTagName NodeCenterY = ( "centerY"). Item (0);

            NodeCenterY.LastChild.Value = STRY;

            XmlNode doc.GetElementsByTagName NodeScale = ( "Scale"). Item (0);

            NodeScale.LastChild.Value = "2000";


            StreamSave MemoryStream = new MemoryStream ();

            doc.Save (streamSave);

            byte [] byteArr = streamSave.ToArray ();

            MgByteSource Bytesource = new MgByteSource (byteArr, byteArr.Length);


            / / Create weblayout in the session to update the new version

            SessionmapName = wlresourceId.GetName String ();

            SessionWebLayout String = "Session" + sessionId + "/ /" + + sessionmapName. WebLayout ";

            MgResourceIdentifier sessionResourceId = new MgResourceIdentifier (sessionWebLayout);


            / / Write to the session

            resourceService.SetResource (sessionResourceId, Bytesource.GetReader (), null);


webLayout = sessionWebLayout;

src ="../ mapviewernet / ajaxviewer.aspx? SESSION = <% = sessionId%> & WEBLAYOUT = <% = webLayout%> "


But I returned the following error:


The type 'OSGeo.MapGuide.MgUnclassifiedException' of assembly
'MapGuideDotNetApi, Version = 2.0.2.3011, Culture = neutral,
PublicKeyToken = null' is not marked as serializable.



Anybody know why it can be???


Thank you very much in advance and best regards!
	
 		 	   		  
_________________________________________________________________
Los auténticos Hotmail y Messenger ahora en tu móvil. ¡Gratis!
http://serviciosmoviles.es.msn.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20100121/5dd2035e/attachment.html


More information about the mapguide-users mailing list