<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><ks@geograf.dk></i></b> έγραψε:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">Από: Kenneth Skovhede, GEOGRAF A/S <ks@geograf.dk><br>Θέμα: Re: [mapguide-users] Nothing is working or what I'm doing wrong?<br>Προς: "MapGuide Users Mail List" <mapguide-users@lists.osgeo.org><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>> Whatever I try to do it's just not working.<br>><br>> Add a new layer?<br>> The layer is added but never shown<br>><br>> Add a point? Nothing<br>><br>> Add a new group?<br>> The Group is added but never shown<br>><br>> So, I simple tried to change the LegendLabel of an existing layer.<br>> Nothing happened again...<br>><br>> If anyone can tell me what I am doing wrong I would appreciate it.<br>><br>> Code follows:<br>><br>><br>> using System;<br>> using System.Data;<br>> using System.Configuration;<br>> using System.Web;<br>> using System.Web.Security;<br>> using System.Web.UI;<br>> using System.Web.UI.WebControls;<br>> using System.Web.UI.WebControls.WebParts;<br>> using System.Web.UI.HtmlControls;<br>> using OSGeo.MapGuide;<br>> using System.Xml;<br>> using System.IO;<br>> using System.Text;<br>><br>> public partial
class _Default : System.Web.UI.Page<br>> {<br>> public string sessionId;<br>> public string webLayout;<br>> public MgLayer tmpLayer;<br>> protected System.Web.UI.HtmlControls.HtmlGenericControl Frame1;<br>><br>> protected void Page_Load(object sender, EventArgs e)<br>> {<br>> string physicalPath = @"C:\Program<br>><br>Files\MapGuideOpenSource\WebServerExtensions\www\webconfig.ini";<br>><br>> try<br>> {<br>> MapGuideApi.MgInitializeWebTier(physicalPath);<br>><br>><br>> passAndSession();<br>><br>><br>> //Associate a session ID with the MgSiteConnection Object<br>> MgUserInformation userInfo_new = new<br>> MgUserInformation(sessionId);<br>><br>> MgSiteConnection siteConnection = new MgSiteConnection();<br>><br>>
siteConnection.Open(userInfo_new);<br>><br>><br>><br>> // Get an instance of the required service(s)<br>> MgResourceService resourceSrvc =<br>><br>(MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);<br>> MgFeatureService featureSrvc =<br>><br>(MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService);<br>><br>><br>><br>> MgMap map = new MgMap(siteConnection);<br>><br>><br>> webLayout =<br>><br>"Library://GoSpatial/Web+Layouts/Autostrada+Brescia+Padova+Map.WebLayout";<br>><br>> MgResourceIdentifier resId = new<br>> MgResourceIdentifier("Library://GoSpatial/Maps/Italy<br>Map.MapDefinition");<br>><br>> String mapName = resId.GetName();<br>><br>> MgResourceIdentifier mapStateId = new<br>> MgResourceIdentifier("Session:" + sessionId + "//"
+<br>mapName + "." +<br>> MgResourceType.Map);<br>><br>><br>><br>> createSaveOpen(map, resourceSrvc, resId, mapName, mapStateId);<br>><br>><br>> MgLayerBase firstLayer = map.GetLayers().GetItem(0);<br>> firstLayer.SetLegendLabel("CHANGE");<br>> <br>><br>> map.Save(resourceSrvc, mapStateId);<br>> }<br>> catch (Exception ex)<br>> {<br>> throw (ex);<br>> }<br>> }<br>><br>><br>> Thx in advanced!<br>><br>> PS I have never but never in my life try to do something and in 2 weeks<br>not<br>> shown even a small improvement...<br>> <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