[mapguide-users] Error openning a map

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Thu Oct 23 06:59:47 EDT 2008


You should not have to link the windows.
You should send in the SessionId and the mapname by querystring/form, 
and then do:

MgSiteConnection siteConnection = new MgSiteConnection();
siteConnection.Open(Request.QueryString("SESSIONID"));
MgMap map = new MgMap();
MgResourceService resService = 
(MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);
map.Open(resService, Request.QueryString("MAPNAME"));

I have not used the WebLayouts enough to tell you how to pass in those 
parameters.

Regards, Kenneth Skovhede, GEOGRAF A/S



Iñigo Mazo skrev:
>
> Thanks again Kenneth.
>
> The invocation of the method is done from a Pop-up Windows which is 
> loaded from the map's menu bar. I mean, we run the application and the 
> map shows up. Then we click on the menu and a Pop-up window is shown. 
> In that pop-up window is where we make the invocation to the method. 
> Do we have to link the pop-up window to the map beneath it?
>
>  
>
> ------------------------------------------------------------------------
>
> *De:* mapguide-users-bounces at lists.osgeo.org 
> [mailto:mapguide-users-bounces at lists.osgeo.org] *En nombre de *Kenneth 
> Skovhede, GEOGRAF A/S
> *Enviado el:* jueves, 23 de octubre de 2008 11:07
> *Para:* MapGuide Users Mail List
> *Asunto:* Re: [mapguide-users] Error openning a map
>
>  
>
> Yes, you are running the code before the viewer has started.
> You cannot use the runtime map before the viewer has started, and thus 
> created the map.
>
>
> Regards, Kenneth Skovhede, GEOGRAF A/S
>
>
>
> Iñigo Mazo skrev:
>
> Thank you Kenneth, I did you told me and now I have another problem. 
> This is my code now:
>
>  
>
>             map.Open(resService, "Sheboygan");
>
>  
>
> In this line returns this mistake: " {"Resource was not found: 
> Session:16634852-0000-1000-8000-005056c00008_en_7F0000010AFC0AFB0AFA//Sheboygan.Map"}"
>
> Do you know what the problem is?
>
> Thank you
>
>  
>
> ------------------------------------------------------------------------
>
> *De:* mapguide-users-bounces at lists.osgeo.org 
> <mailto:mapguide-users-bounces at lists.osgeo.org> 
> [mailto:mapguide-users-bounces at lists.osgeo.org] *En nombre de *Kenneth 
> Skovhede, GEOGRAF A/S
> *Enviado el:* jueves, 23 de octubre de 2008 9:21
> *Para:* MapGuide Users Mail List
> *Asunto:* Re: [mapguide-users] Error openning a map
>
>  
>
> That is one misleading message :).
>
> In line 2+3, connect, but you have no session.
> So, you cannot read anything from the session repository.
> This means the sessionid string (internal) is empty, which is the 
> exception you get.
>
> If you want to read the runtime map, you must open the connection with 
> the session ID,
> not with a username/password (line 2+3).
>
>
> Regards, Kenneth Skovhede, GEOGRAF A/S
>
>
>
> Iñigo Mazo skrev:
>
>   <http://www.avalon.com.es>
>
> 	
>
> *AVALON Tecnologías de la Información, S.L.*
>
> *Generamos /Ideas/, Construimos /Soluciones/*
>
> *http://www.avalon.com.es*
>
> *C/ Gran Vía 81, 8ª Planta Bilbao 48011 Teléfono: (+34) 94 441 51 40  
> Fax: (+34) 94 441 51 92 *
>
>  
>
> 	
>
>  
>
> 	
>
> Hello,
>
>  
>
> We have a problem openning a map with MapGuide Studio 2009. Our code 
> is this:
>
>  
>
>         MgSiteConnection siteConnection = new MgSiteConnection();
>
>         MgUserInformation userInfo = new 
> MgUserInformation("Anonymous", "");
>
>         siteConnection.Open(userInfo);
>
>         MgResourceService resService = 
> (MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);
>
>         MgFeatureService featureService = 
> (MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService);
>
>       
>         MgMap map = new MgMap();
>
>         map.Open(resService, "Sheboygan");
>
>  
>
> In this line returns this mistake: " {"Invalid argument(s):\n\t[0] = 
> \" \"\nThe string cannot be empty."} "
>
>  
>
> Thank you.
>
>  
>
> *Iñigo Mazo González
> *
> AVALON Tecnologías de la Información, S.L.
> imazo at avalon.com.es <mailto:imazo at avalon.com.es>
>
> 	
>
>  
>
>  
>
> 	
>
>  
>
> 	
>
>  
>
> 	
>
>  
>
>
>  
>
>  
>
>  
>
>  
>
>  
>  
>  
>
>
> ------------------------------------------------------------------------
>
>
>  
>  
>  
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org <mailto:mapguide-users at lists.osgeo.org>
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>   
>  
>
>
> ------------------------------------------------------------------------
>
>
>  
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org <mailto:mapguide-users at lists.osgeo.org>
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>   
-------------- next part --------------
Skipped content of type multipart/related


More information about the mapguide-users mailing list