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

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Fri Jan 22 03:10:57 EST 2010


What line of code throws the exception?

Regards, Kenneth Skovhede, GEOGRAF A/S

On 21-01-2010 17:29, Rubén Casal Prieto wrote:
> 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!
> ------------------------------------------------------------------------
> El NUEVO Internet Explorer 8 es el navegador más rápido y seguro 
> ¡Descárgalo gratis! <http://www.vivelive.com/internetexplorer8/>
>
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>    
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20100122/39067a73/attachment.html


More information about the mapguide-users mailing list