[mapguide-users] Re: Start with a map coordinates passed by
parameters in the URL
Rubén Casal Prieto
terri2213 at msn.com
Thu Jan 21 11:03:07 EST 2010
Hello, thank you very much for your answers! I've done the following:
String requestParams STRX = [ "X"];
Stry 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!
--
View this message in context: http://n2.nabble.com/Start-with-a-map-coordinates-passed-by-parameters-in-the-URL-tp4425806p4434513.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list