<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">As far as I know, this is not possible, because <br><pre>MgMap map = new MgMap(resourceSrvc); it takes as argument a siteConnection...<br><br><br>When you say refresh the client you mean just to write one line *.js?<br>without importing anything?<br><br>I'm asking, cause parent.parent.Refresh();<br>              or<br>parent.mapFrame.Refresh();<br><br>doesn't do anything...<br></pre><br>--- Στις <b>Δευτ., 20/10/08, ο/η Kenneth Skovhede, GEOGRAF A/S <i>&lt;ks@geograf.dk&gt;</i></b> έγραψε:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">Από: Kenneth Skovhede, GEOGRAF A/S &lt;ks@geograf.dk&gt;<br>Θέμα: Re: [mapguide-users] Nothing is working or what I'm doing wrong?<br>Προς: "MapGuide Users Mail List" &lt;mapguide-users@lists.osgeo.org&gt;<br>Ημερομηνία: Δευτέρα, 20
 Οκτώβριος 2008, 16:53<br><br><pre>The viewer overwrites the runtime map on startup, so if you run this <br>before starting the viewer, your changes will be lost.<br>You should not create a new runtime map, but open the one the viewer <br>creates for you, modify it, save it, and refresh the client.<br>I belive the correct sequence would be:<br>MgMap map = new MgMap(resourceSrvc);<br>map.Open(mapName):<br><br>The viewer takes a string like:<br>"Library://Folder/MapName.MapDefinition"<br>and uses the map name:<br>"Folder/MapName"<br><br>You must use the same name in your code, or you won't get to the runtime <br>map.<br><br>If you want the layer to show when the map loads, have a look at this:<br>http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI/samples/AddInitialLayer<br><br>You can perform the same actions without the MaestroAPI if you like, but <br>you have to deal with the xml in raw form.<br><br>Regards, Kenneth Skovhede, GEOGRAF
 A/S<br><br><br><br>Galois skrev:<br>&gt; Whatever I try to do it's just not working.<br>&gt;<br>&gt; Add a new layer?<br>&gt; The layer is added but never shown<br>&gt;<br>&gt; Add a point? Nothing<br>&gt;<br>&gt; Add a new group?<br>&gt; The Group is added but never shown<br>&gt;<br>&gt; So, I simple tried to change the LegendLabel of an existing layer.<br>&gt; Nothing happened again...<br>&gt;<br>&gt; If anyone can tell me what I am doing wrong I would appreciate it.<br>&gt;<br>&gt; Code follows:<br>&gt;<br>&gt;<br>&gt; using System;<br>&gt; using System.Data;<br>&gt; using System.Configuration;<br>&gt; using System.Web;<br>&gt; using System.Web.Security;<br>&gt; using System.Web.UI;<br>&gt; using System.Web.UI.WebControls;<br>&gt; using System.Web.UI.WebControls.WebParts;<br>&gt; using System.Web.UI.HtmlControls;<br>&gt; using OSGeo.MapGuide;<br>&gt; using System.Xml;<br>&gt; using System.IO;<br>&gt; using System.Text;<br>&gt;<br>&gt; public partial
 class _Default : System.Web.UI.Page<br>&gt; {<br>&gt;     public string sessionId;<br>&gt;     public string webLayout;<br>&gt;     public MgLayer tmpLayer;<br>&gt;     protected System.Web.UI.HtmlControls.HtmlGenericControl Frame1;<br>&gt;<br>&gt;     protected void Page_Load(object sender, EventArgs e)<br>&gt;     {<br>&gt;         string physicalPath = @"C:\Program<br>&gt;<br>Files\MapGuideOpenSource\WebServerExtensions\www\webconfig.ini";<br>&gt;<br>&gt;         try<br>&gt;         {<br>&gt;             MapGuideApi.MgInitializeWebTier(physicalPath);<br>&gt;<br>&gt;<br>&gt;             passAndSession();<br>&gt;<br>&gt;<br>&gt;             //Associate a session ID with the MgSiteConnection Object<br>&gt;             MgUserInformation userInfo_new = new<br>&gt; MgUserInformation(sessionId);<br>&gt;<br>&gt;             MgSiteConnection siteConnection = new MgSiteConnection();<br>&gt;<br>&gt;            
 siteConnection.Open(userInfo_new);<br>&gt;<br>&gt;<br>&gt;<br>&gt;             // Get an instance of the required service(s)<br>&gt;             MgResourceService resourceSrvc =<br>&gt;<br>(MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);<br>&gt;             MgFeatureService featureSrvc =<br>&gt;<br>(MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService);<br>&gt;<br>&gt;<br>&gt;<br>&gt;             MgMap map = new MgMap(siteConnection);<br>&gt;<br>&gt;<br>&gt;             webLayout =<br>&gt;<br>"Library://GoSpatial/Web+Layouts/Autostrada+Brescia+Padova+Map.WebLayout";<br>&gt;<br>&gt;             MgResourceIdentifier resId = new<br>&gt; MgResourceIdentifier("Library://GoSpatial/Maps/Italy<br>Map.MapDefinition");<br>&gt;<br>&gt;             String mapName = resId.GetName();<br>&gt;<br>&gt;             MgResourceIdentifier mapStateId = new<br>&gt; MgResourceIdentifier("Session:" + sessionId + "//"
 +<br>mapName + "." +<br>&gt; MgResourceType.Map);<br>&gt;<br>&gt;<br>&gt;<br>&gt;             createSaveOpen(map, resourceSrvc, resId, mapName, mapStateId);<br>&gt;<br>&gt;<br>&gt;             MgLayerBase firstLayer = map.GetLayers().GetItem(0);<br>&gt;             firstLayer.SetLegendLabel("CHANGE");<br>&gt;             <br>&gt;<br>&gt;             map.Save(resourceSrvc, mapStateId);<br>&gt;         }<br>&gt;         catch (Exception ex)<br>&gt;         {<br>&gt;             throw (ex);<br>&gt;         }<br>&gt;     }<br>&gt;<br>&gt;<br>&gt; Thx in advanced!<br>&gt;<br>&gt; PS I have never but never in my life try to do something and in 2 weeks<br>not<br>&gt; shown even a small improvement...<br>&gt;   <br>_______________________________________________<br>mapguide-users mailing
 list<br>mapguide-users@lists.osgeo.org<br>http://lists.osgeo.org/mailman/listinfo/mapguide-users<br></pre></blockquote></td></tr></table><br>__________________________________________________<br>Χρησιμοποιείτε Yahoo!;<br>Βαρεθήκατε τα ενοχλητικά μηνύματα (spam);   Το Yahoo! Mail διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών μηνυμάτων  <br>http://mail.yahoo.gr