<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
<span class="ul-threaded" style="margin: 0.5em 0pt 0pt -20px;"><span style="" class="text-cell">HHHello, </span></span><span id="result_box" class="medium_text"><span title="Tengo este código, para iniciar el mapa con unas coordenadas pasadas con parametros en la URL.">I have this code, to start the map with coordinates with parameters passed in the URL.<br></span></span><span class="ul-threaded" style="margin: 0.5em 0pt 0pt -20px;"><span style="" class="text-cell"><br><font style="font-size: 10pt;" size="2"><br></font><font style="font-size: 10pt;" size="2"><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String requestParams STRX = [ "X"];
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String requestParams String = [ "Y"];
<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MgSiteConnection siteconection = new MgSiteConnection ();
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; siteconection.Open (new MgUserInformation (sessionId));
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MgResourceService resourceService = (MgResourceService)
siteconection.CreateService (MgServiceType.ResourceService) as
MgResourceService;
<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MgResourceIdentifier wlresourceId = new MgResourceIdentifier (webLayout);
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MgByteReader wlreader = resourceService.GetResourceContent (wlresourceId);
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WlXML = wlreader.ToString String ();
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XmlDocument doc = new XmlDocument ();
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; doc.LoadXml (wlXML);
<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XmlNode doc.GetElementsByTagName NodeCenterx = ( "centerX"). Item (0);
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NodeCenterx.LastChild.Value = STRX;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XmlNode doc.GetElementsByTagName NodeCenterY = ( "centerY"). Item (0);
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NodeCenterY.LastChild.Value = STRY;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XmlNode doc.GetElementsByTagName NodeScale = ( "Scale"). Item (0);
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NodeScale.LastChild.Value = "2000";
<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; StreamSave MemoryStream = new MemoryStream ();
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; doc.Save (streamSave);
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; byte [] byteArr = streamSave.ToArray ();
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MgByteSource Bytesource = new MgByteSource (byteArr, byteArr.Length);
<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; / / Create weblayout in the session to update the new version
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SessionmapName = wlresourceId.GetName String ();
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SessionWebLayout String = "Session" + sessionId + "/ /" + + sessionmapName. WebLayout ";
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MgResourceIdentifier sessionResourceId = new MgResourceIdentifier (sessionWebLayout);
<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; / / Write to the session
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; resourceService.SetResource (sessionResourceId, Bytesource.GetReader (), null);
<br><br>webLayout = sessionWebLayout;
<br>src ="../ mapviewernet / ajaxviewer.aspx? SESSION = &lt;% = sessionId%&gt; &amp; WEBLAYOUT = &lt;% = webLayout%&gt; "
</i></font><br><br>But I returned the following error:
<br><br>The type 'OSGeo.MapGuide.MgUnclassifiedException' of assembly
'MapGuideDotNetApi, Version = 2.0.2.3011, Culture = neutral,
PublicKeyToken = null' is not marked as serializable.
<br><br><br>Anybody know why it can be???
<br><br>Thank you very much in advance and best regards!
        
</span></span>                                               <br /><hr />El NUEVO Internet Explorer 8 es el navegador más rápido y seguro <a href='http://www.vivelive.com/internetexplorer8/' target='_new'> ¡Descárgalo gratis!</a></body>
</html>