<div>hi! thanks alot for your help, i found exemple in phpsamples explaining how to get features from XMLSelection, i tried use it today, but i&#39;ve prob wich i don&#39;t understand:</div>
<div> </div>
<div>i&#39;ve prob with use the xml selection wich i get after user clic on polygone, this is javascript function i use to get selection:(i write it in textfiel and read it by Request.Form:</div>
<div>  function test()<br>    {<br>   <br> k= document.formulaire.classe.value=carte.GetMapFrame().GetSelectionXML(); <br>    </div>
<div>    }</div>
<div>for get this selection i use this code</div>
<div> selectionXml = getValue(&quot;classe&quot;)</div>
<div><br>  Private Function getValue(ByVal champ As String) As String<br>        &#39; récupère la valeur du champ [champ] de la requête postée<br>        &#39; qq chose ?<br>        If Request.Form(champ) Is Nothing Then Return &quot;&quot;<br>
        &#39; on récupère la ou les valeurs du champ<br>        Dim valeurs() As String = Request.Form.GetValues(champ)<br>        Dim valeur As String = &quot;&quot;<br>        Dim i As Integer<br>        For i = 0 To valeurs.Length - 1<br>
            valeur += valeurs(i)<br>        Next<br>        valeur = Server.UrlDecode(valeur)</div>
<div>        Return valeur<br>    End Function</div>
<div>after user clic on polygone and get xml selection , i use this code for filter and identify polygone ID:</div>
<div> Public Sub getselectionpartiel(ByVal map As MgMap, ByVal resourceService As MgResourceService, ByVal XmlSel As String)<br>        <br>    <br>        Dim k = 0<br>           If ((XmlSel &lt;&gt; Nothing) And (XmlSel &lt;&gt; &quot;&quot;)) Then</div>

<div>                    <br>            Dim selection As New MgSelection(map, XmlSel)<br>            Dim Layers As MgReadOnlyLayerCollection = selection.GetLayers()</div>
<div>            <br>            If Not Layers.GetCount = 1 Then<br>                Response.Write(&quot;More than one object was selected&quot;)</div>
<div>                Exit Sub</div>
<div>            End If</div>
<div><br>         <br>            <br>          </div>
<div>            Response.Write(&quot;calques selectionnés&quot;)<br>    </div>
<div>     <br>        End If</div>
<div>    End Sub<br> and i call this function like that:<br>    getselectionpartiel(map, resourceSrvc, selectionXml)</div>
<div>it gives me this error:</div>
<div>&quot;La référence d&#39;objet n&#39;est pas définie à une instance d&#39;un objet.&quot; in the line:<br>(the object reference is not associated to the object instance)<br>    If Not Layers.GetCount = 1 Then</div>
<div>i think that Layers is empty but when i display &quot;selectionXml&quot; by using:</div>
<div>Response.Write(selectionXml) it gives me the correct selection!!!<br>if you have some idea about the error i do,please tell it me, thanks a lot on advance<br><br></div>
<div class="gmail_quote">2009/5/26 Kenneth Skovhede, GEOGRAF A/S <span dir="ltr">&lt;<a href="mailto:ks@geograf.dk">ks@geograf.dk</a>&gt;</span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div text="#000000" bgcolor="#ffffff">The keyword for this is base64 encoding, see:<br><a href="http://lists.osgeo.org/pipermail/mapguide-users/2008-February/011245.html" target="_blank">http://lists.osgeo.org/pipermail/mapguide-users/2008-February/011245.html</a><br>
and<br><a href="http://www.mail-archive.com/mapguide-users@lists.osgeo.org/msg03312.html" target="_blank">http://www.mail-archive.com/mapguide-users@lists.osgeo.org/msg03312.html</a> 
<div>
<div></div>
<div class="h5"><br><pre cols="72">Regards, Kenneth Skovhede, GEOGRAF A/S
</pre><br><br>saloua wakrim skrev: 
<blockquote type="cite">
<div>i resolved coordinates point prob and transparency layer, now i want identify polygone wich i draw on map by user clic, i use GetSelectionXml() when user select polygone, this function gives me:</div>
<div> </div>
<div>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;FeatureSet&gt;&lt;Layer id=&quot;d610b562-ffff-ffff-8002-0016356155d0&quot;&gt;&lt;Class id=&quot;BufferLayerSchema:BufferClass&quot;&gt;&lt;ID&gt;GQAAAA==&lt;/ID&gt;&lt;/Class&gt;&lt;/Layer&gt;&lt;/FeatureSet&gt;</div>

<div> </div>
<div>i want understand how can i identify polygone (id polygone) by this description i think that i must use </div>
<div>&lt;ID&gt;GQAAAA==&lt;/ID&gt; cause i&#39;ve remarked that all what it changes when i select another polygone, but i don&#39;t see the relation with  &lt;ID&gt;GQAAAA==&lt;/ID&gt; end the ID wich i associate to my polygone when i create it.there is any relation?? thanks a lot on advance.<br>
<br></div>
<div class="gmail_quote">2009/5/20 Kenneth Skovhede, GEOGRAF A/S <span dir="ltr">&lt;<a href="mailto:ks@geograf.dk" target="_blank">ks@geograf.dk</a>&gt;</span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div text="#000000" bgcolor="#ffffff">UNIT is the coordinate system unit, eg. degrees, meters or inches.<br><br>If the layers and map have the correct coordinate systems assigned, <br>MapGuide will automatically convert the data to display correctly,<br>
so you get the correct map.<br><br>You do not have to work with the projection string manually.<br>Beware of trying to calculate coordinates manually based on the UNIT, because<br>projections are not always compatible just because the use the same UNIT.<br>
Instead, use the MgCoordinateSystem classes to convert points from one projection to another. 
<div>
<div><br><pre cols="72">Regards, Kenneth Skovhede, GEOGRAF A/S
    </pre><br><br>saloua wakrim skrev: 
<blockquote type="cite">
<div>but please if you know what that UNIT means in coordinates System say it me:</div>
<div> </div><font color="#0000ff" size="2">
<p>&lt;</p></font><font color="#800000" size="2">CoordinateSystem</font><font color="#0000ff" size="2">&gt;</font><font size="2">GEOGCS[&quot;WGS84 Lat/Long&#39;s, Degrees, -180 ==&gt; +180&quot;,DATUM[&quot;D_WGS_1984&quot;,SPHEROID[&quot;World_Geodetic_System_of_1984&quot;,6378137,298.257222932867]],PRIMEM[&quot;Greenwich&quot;,0],<strong><u>UNIT</u></strong>[&quot;Degree&quot;,0.017453292519943295]]</font><font color="#0000ff" size="2">&lt;/</font><font color="#800000" size="2">CoordinateSystem</font><font color="#0000ff" size="2">&gt; </font>cause i want draw polygone representing view of cam (dome) and it must be proportional to the real view of cam, and my layer must be added to map with another layer wich contains cams so i must know wich units is used on map(m, km, cm) or what? that what i do that i convert (m) to unit by this code: 
<div> </div>
<div><font color="#008080" size="2">
<p>MgCoordinateSystemFactory</p></font><font size="2">csFactory = </font><font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">MgCoordinateSystemFactory</font><font size="2">(); </font><font color="#008080" size="2">MgCoordinateSystem</font><font size="2"> srs = csFactory.Create(map.GetMapSRS()); </font><font color="#008080" size="2">MgCoordinateSystemMeasure</font><font size="2"> mesure = </font><font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">MgCoordinateSystemMeasure</font><font size="2">(srs); 
<p>distanceunits = pointa.Distance(pointb, mesure);</p>
<p>Response.Write(</p></font><font color="#800000" size="2">&quot;distance entre les deux points du calque en unit‚: &quot;</font><font size="2">+distanceunits.ToString()); 
<p>distancemeters = srs.ConvertCoordinateSystemUnitsToMeters(distanceunits);</p></font><font size="2">but i don&#39;t know if this layer (wich contains polygone) will be compatible with another layer or not? if you don&#39;t understand me say it me please. thanks or advance, i ask you cause i remark that you master more than onother mapguide developpers mapguide, thanks on advance.</font><font size="2"> </font><font size="2"> </font><br>
<br></div>
<div class="gmail_quote">2009/5/19 Kenneth Skovhede, GEOGRAF A/S <span dir="ltr">&lt;<a href="mailto:ks@geograf.dk" target="_blank">ks@geograf.dk</a>&gt;</span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div text="#000000" bgcolor="#ffffff">There is an example for MgCreateSdfParams() in the &quot;buffer.(php|aspx|jsp)&quot; file in the folder<br>C:\program files\MapGuideOpenSource2.0\WebServerExtensions\www\mapviewer(php|net|java)<br>
<br>It also shows how to set the coordinate system.<br>If your data has the correct projection, MapGuide will convert it to fit the map projection.<br>If that does not work, you have to manually convert the items, which is not a trivial procedure. 
<div>
<div><br><pre cols="72">Regards, Kenneth Skovhede, GEOGRAF A/S
    </pre><br><br>saloua wakrim skrev: 
<blockquote type="cite">hi! did you know lease how MgCreateSdfParams() works and what attributes i must give it cause ii think that the prob i have is coordinates i use for inserting polygone or line or point wich are not compatibl with map cordinates <br>
<br>
<div><span class="gmail_quote">2009/5/11, Kenneth Skovhede, GEOGRAF A/S &lt;<a href="mailto:ks@geograf.dk" target="_blank">ks@geograf.dk</a>&gt;:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div text="#000000" bgcolor="#ffffff">Yes, that looks right.<br><br>You must also refresh the map (refresh/pan/zoom/etc.) in the browser via javascript.<br><br>In addition to my other suggestions, you can also check the error log for messages. 
<div><span><br><pre cols="72">Regards, Kenneth Skovhede, GEOGRAF A/S
    </pre><br><br>saloua wakrim skrev: 
<blockquote type="cite">
<div>hi! please i want know if this code is that what all i must do for adding new layer to map and see it in viewer frame or i must do some relation with the feature source i create in my code?? thanks on advance</div>
<div> </div>
<div><font size="2">
<p>myLayer = </p></font><font color="#0000ff" size="2">New</font><font size="2"> MgLayer(layerDefId, resourceSrvc) 
<p>myLayer.SetName(myLayerName)</p>
<p>myLayer.SetLegendLabel(myLayerName)</p>
<p>myLayer.SetDisplayInLegend(</p></font><font color="#0000ff" size="2">True</font><font size="2">) 
<p>myLayer.SetSelectable(</p></font><font color="#0000ff" size="2">False</font><font size="2">) 
<p>map.GetLayers().Insert(0, myLayer)</p></font><font size="2">
<p>myLayer.ForceRefresh()</p></font><font size="2">map.Save(resourceSrvc)</font><br><br> </div>
<div class="gmail_quote">2009/5/10 Kenneth Skovhede, GEOGRAF A/S <span dir="ltr">&lt;<a href="mailto:ks@geograf.dk" target="_blank">ks@geograf.dk</a>&gt;</span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div text="#000000" bgcolor="#ffffff">The code looks alright.<br>Do you refresh the map afterwards?<br>What is in the &quot;insertResults&quot; ? <br>(There can be a hidden error, due to a bug in MapGuide)<br>Are you sure that the LayerDefinition matches the FeatureSource?<br>
Try to create the FeatureSource and LayerDefinition in &quot;Library://&quot; instead,<br>so you can examine the layer from Studio/Maestro.<br><pre cols="72">Regards, Kenneth Skovhede, GEOGRAF A/S
    </pre><br><br>saloua wakrim skrev: 
<blockquote type="cite">
<div>
<div>
<div>i try the following code for displaying layer wich contains line in map, so i digitize a line, create temporary feature for this line, create a layer wich contains it and add it to the map. it doesn&#39;t give me some error but  i can see the line in the map (i can draw it). Please help me. the code is following:</div>

<div> </div>
<div> <font color="#008080" size="2"> 
<p>String</p></font><font size="2">dataSource = </font><font color="#800000" size="2">&quot;Session:&quot;</font><font size="2"> + sessionid1 + </font><font color="#800000" size="2">&quot;//&quot;</font><font size="2"> + myLayerName + </font><font color="#800000" size="2">&quot;.FeatureSource&quot;</font><font size="2">; </font><font color="#008080" size="2">MgResourceIdentifier</font><font size="2"> dataSourceId = </font><font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">MgResourceIdentifier</font><font size="2">(dataSource); </font><font color="#008080" size="2">MgFeatureService</font><font size="2"> featureSrvc = (</font><font color="#008080" size="2">MgFeatureService</font><font size="2">)siteConnection.CreateService(</font><font color="#008080" size="2">MgServiceType</font><font size="2">.FeatureService); </font><font color="#0000ff" size="2">if</font><font size="2"> (DoesLayerExist(myLayerName, map) == </font><font color="#0000ff" size="2">false</font><font size="2">) 
<p>{</p>
<p> </p></font><font color="#008000" size="2">//create Feature Source </font><font color="#008080" size="2">MgClassDefinition</font><font size="2"> myClassDef = </font><font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">MgClassDefinition</font><font size="2">(); 
<p>myClassDef.SetName(myLayerName);</p>
<p>myClassDef.SetDescription(myLayerName + </p></font><font color="#800000" size="2">&quot; Feature Source&quot;</font><font size="2">); 
<p>myClassDef.SetDefaultGeometryPropertyName(</p></font><font color="#800000" size="2">&quot;SHPGEOM&quot;</font><font size="2">); </font><font color="#008080" size="2">MgDataPropertyDefinition</font><font size="2"> prop = </font><font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">MgDataPropertyDefinition</font><font size="2">(</font><font color="#800000" size="2">&quot;KEY&quot;</font><font size="2">); 
<p>prop.SetDataType(</p></font><font color="#008080" size="2">MgPropertyType</font><font size="2">.Int32); 
<p>prop.SetAutoGeneration(</p></font><font color="#0000ff" size="2">true</font><font size="2">); 
<p>prop.SetReadOnly(</p></font><font color="#0000ff" size="2">true</font><font size="2">); 
<p>myClassDef.GetIdentityProperties().Add(prop);</p>
<p>myClassDef.GetProperties().Add(prop);</p>
<p>prop = </p></font><font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">MgDataPropertyDefinition</font><font size="2">(</font><font color="#800000" size="2">&quot;ID&quot;</font><font size="2">); 
<p>prop.SetDataType(</p></font><font color="#008080" size="2">MgPropertyType</font><font size="2">.Int32); 
<p>myClassDef.GetProperties().Add(prop);</p></font><font color="#008080" size="2">MgGeometricPropertyDefinition</font><font size="2"> geomProp = </font><font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">MgGeometricPropertyDefinition</font><font size="2">(</font><font color="#800000" size="2">&quot;SHPGEOM&quot;</font><font size="2">); 
<p>geomProp.SetGeometryTypes(</p></font><font color="#008080" size="2">MgFeatureGeometricType</font><font size="2">.Curve); 
<p>myClassDef.GetProperties().Add(geomProp);</p></font><font color="#008080" size="2">MgFeatureSchema</font><font size="2"> schema = </font><font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">MgFeatureSchema</font><font size="2">(myLayerName + </font><font color="#800000" size="2">&quot;Schema&quot;</font><font size="2">, myLayerName + </font><font color="#800000" size="2">&quot;SchemaDesc&quot;</font><font size="2">); 
<p>schema.GetClasses().Add(myClassDef);</p></font><font color="#008080" size="2">MgCreateSdfParams</font><font size="2"> sdfParams = </font><font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">MgCreateSdfParams</font><font size="2">(</font><font color="#800000" size="2">&quot;MGA-56 (GDA94 / MGA zone 56)&quot;</font><font size="2">, map.GetMapSRS(), schema); 
<p>featureSrvc.CreateFeatureSource(dataSourceId, sdfParams);</p>
<p> </p>
<p> </p></font><font color="#008000" size="2">//create layer </font><font color="#008000" size="2">//String layerDef = &quot;Session:&quot; + sessionid1 + &quot;//&quot; + myLayerName + &quot;.LayerDefinition&quot;;</font><font size="2"> </font><font color="#008080" size="2">MgResourceIdentifier</font><font size="2"> layerDefId = </font><font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">MgResourceIdentifier</font><font size="2">(</font><font color="#800000" size="2">&quot;Library://essaicalque/Redline.LayerDefinition&quot;</font><font size="2">); 
<p> </p>
<p> </p></font><font color="#008080" size="2">MgByteSource</font><font size="2"> content = </font><font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">MgByteSource</font><font size="2">(</font><font color="#800000" size="2">@&quot;C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\essaiselect2\Layerdef.xml&quot;</font><font size="2">); 
<p>resourceSrvc.SetResource(layerDefId, content.GetReader(), </p></font><font color="#0000ff" size="2">null</font><font size="2">); </font><font color="#008000" size="2">//code enlev‚ d&#39;ici: ajouter layer resource … la carte</font><font size="2"> </font><font color="#008000" size="2">//il faut ajouter l&#39;autre code: add layer resource to map</font><font size="2"> </font><font color="#008000" size="2">//DOMDocument domdoc = new DOMdocument();</font><font size="2"> </font><font color="#008080" size="2">MgLayer</font><font size="2"> result=add_layer_resource_to_map(layerDefId,resourceSrvc,myLayerName,myLayerName,map); 
<p>}</p></font><font color="#008080" size="2">MgInsertFeatures</font><font size="2"> insertFeatures = </font><font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">MgInsertFeatures</font><font size="2">(myLayerName, makeLine(</font><font color="#800000" size="2">&quot;1&quot;</font><font size="2">, x0, y0, x1, y1)); </font><font color="#008080" size="2">MgFeatureCommandCollection</font><font size="2"> commands = </font><font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">MgFeatureCommandCollection</font><font size="2">(); 
<p>commands.Add(insertFeatures);</p></font><font color="#0000ff" size="2">int</font><font size="2"> commandIndex = commands.IndexOf(insertFeatures); </font><font color="#008080" size="2">MgPropertyCollection</font><font size="2"> insertResults; 
<p>insertResults = featureSrvc.UpdateFeatures(dataSourceId, commands, </p></font><font color="#0000ff" size="2">false</font><font size="2">); </font><font color="#008080" size="2">MgLayer</font><font size="2"> myLayer1 = map.GetLayers().GetItem(myLayerName) </font><font color="#0000ff" size="2">as</font><font size="2"> </font><font color="#008080" size="2">MgLayer</font><font size="2">; 
<p>myLayer1.ForceRefresh();</p>
<p> </p></font><font color="#008000" size="2">//commands.Add(new MgInsertFeatures(myLayerName,makeLine(&quot;1&quot;, x0, y0, x1, y1))); 
<p> </p></font><font size="2">
<p>map.Save(resourceSrvc); </p>
<p> </p><font color="#0000ff" size="2">
<p>&lt;</p></font><font color="#800000" size="2">script</font><font size="2"> </font><font color="#ff0000" size="2">runat</font><font color="#0000ff" size="2">=server&gt;</font><font size="2"> </font><font color="#008080" size="2">Boolean</font><font size="2"> result; </font><font color="#008080" size="2">MgPropertyCollection</font><font size="2"> makeLine(</font><font color="#008080" size="2">String</font><font size="2"> Name, </font><font color="#008080" size="2">Double</font><font size="2"> x0, </font><font color="#008080" size="2">Double</font><font size="2"> y0, </font><font color="#008080" size="2">Double</font><font size="2"> x1, </font><font color="#008080" size="2">Double</font><font size="2"> y1) 
<p>{ </p></font><font color="#008080" size="2">MgPropertyCollection</font><font size="2"> PropertyCollection = </font><font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">MgPropertyCollection</font><font size="2">(); </font><font color="#008080" size="2">MgInt32Property</font><font size="2"> nameProperty = </font><font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">MgInt32Property</font><font size="2">(</font><font color="#800000" size="2">&quot;ID&quot;</font><font size="2">, 1); 
<p>PropertyCollection.Add(nameProperty); </p></font><font color="#008080" size="2">MgWktReaderWriter</font><font size="2"> wktReaderWriter = </font><font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">MgWktReaderWriter</font><font size="2">(); </font><font color="#008080" size="2">MgAgfReaderWriter</font><font size="2"> agfReaderWriter = </font><font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">MgAgfReaderWriter</font><font size="2">(); </font><font color="#008080" size="2">MgGeometry</font><font size="2"> geometry = wktReaderWriter.Read(</font><font color="#800000" size="2">&quot;LINESTRING XY (&quot;</font><font size="2"> + x0 + </font><font color="#800000" size="2">&quot; &quot;</font><font size="2"> + y0 + </font><font color="#800000" size="2">&quot;,&quot;</font><font size="2"> + x1 + </font><font color="#800000" size="2">&quot; &quot;</font><font size="2"> + y1 + </font><font color="#800000" size="2">&quot;)&quot;</font><font size="2">) </font><font color="#0000ff" size="2">as</font><font size="2"> </font><font color="#008080" size="2">MgLineString</font><font size="2">; </font><font color="#008000" size="2">//MgGeometry geometry = wktReaderWriter.Read(&quot;LINESTRING(3 4,10 50,20 25)&quot;) as MgLineString; </font><font color="#008080" size="2">MgByteReader</font><font size="2"> geometryByteReader = agfReaderWriter.Write(geometry); </font><font color="#008080" size="2">MgGeometryProperty</font><font size="2"> geometryProperty = </font><font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">MgGeometryProperty</font><font size="2">(</font><font color="#800000" size="2">&quot;SHPGEOM&quot;</font><font size="2">, geometryByteReader); 
<p>PropertyCollection.Add(geometryProperty); </p></font><font color="#0000ff" size="2">return</font><font size="2"> PropertyCollection; 
<p>} </p></font><font color="#008080" size="2">
<p>Boolean</p></font><font size="2">DoesLayerExist(</font><font color="#008080" size="2">String</font><font size="2"> LayerName, </font><font color="#008080" size="2">MgMap</font><font size="2"> Map) 
<p>{ </p></font><font color="#008080" size="2">MgLayerCollection</font><font size="2"> layers = Map.GetLayers(); 
<p>result = (layers.Contains(myLayerName));</p></font><font color="#0000ff" size="2">return</font><font size="2"> result; 
<p>}</p></font><font color="#008080" size="2">MgLayer</font><font size="2"> add_layer_resource_to_map(</font><font color="#008080" size="2">MgResourceIdentifier</font><font size="2"> layerresourceid, </font><font color="#008080" size="2">MgResourceService</font><font size="2"> rs, </font><font color="#008080" size="2">String</font><font size="2"> layername, </font><font color="#008080" size="2">String</font><font size="2"> layerlegendlabel, </font><font color="#008080" size="2">MgMap</font><font size="2"> map) 
<p>{</p></font><font color="#008080" size="2">MgLayer</font><font size="2"> myLayer = </font><font color="#0000ff" size="2">new</font><font size="2"> </font><font color="#008080" size="2">MgLayer</font><font size="2">(layerresourceid, rs); 
<p>myLayer.SetName(layername);</p>
<p>myLayer.SetLegendLabel(layerlegendlabel);</p>
<p>myLayer.SetDisplayInLegend(</p></font><font color="#0000ff" size="2">true</font><font size="2">); 
<p>myLayer.SetSelectable(</p></font><font color="#0000ff" size="2">true</font><font size="2">); 
<p> </p></font><font color="#0000ff" size="2">if</font><font size="2"> (!map.GetLayers().Contains(layername)) 
<p>{</p>
<p>map.GetLayers().Insert(0, myLayer);</p>
<p>}</p>
<p>myLayer.SetVisible(</p></font><font color="#0000ff" size="2">true</font><font size="2">); 
<p>myLayer.ForceRefresh();</p>
<p>map.Save(resourceSrvc);</p></font><font color="#0000ff" size="2">return</font><font size="2"> myLayer; 
<p>}</p></font><font color="#0000ff" size="2">
<p>&lt;/</p></font><font color="#800000" size="2">script</font><font color="#0000ff" size="2">&gt;</font> 
<p> </p>
<p> </p>
<p> </p></font></div></div></div><pre><hr width="90%" size="4">
_______________________________________________
mapguide-users mailing list
<a href="mailto:mapguide-users@lists.osgeo.org" target="_blank">mapguide-users@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
  </pre></blockquote></div><br>_______________________________________________<br>mapguide-users mailing list<br><a href="mailto:mapguide-users@lists.osgeo.org" target="_blank">mapguide-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><br>
<br></blockquote></div><br><pre><hr width="90%" size="4">
_______________________________________________
mapguide-users mailing list
<a href="mailto:mapguide-users@lists.osgeo.org" target="_blank">mapguide-users@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
  </pre></blockquote></span></div></div><br>_______________________________________________<br>mapguide-users mailing list<br><a href="mailto:mapguide-users@lists.osgeo.org" target="_blank">mapguide-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><br><br></blockquote></div><br><pre><hr width="90%" size="4">
_______________________________________________
mapguide-users mailing list
<a href="mailto:mapguide-users@lists.osgeo.org" target="_blank">mapguide-users@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
  </pre></blockquote></div></div></div><br>_______________________________________________<br>mapguide-users mailing list<br><a href="mailto:mapguide-users@lists.osgeo.org" target="_blank">mapguide-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><br><br></blockquote></div><br><pre><hr width="90%" size="4">
_______________________________________________
mapguide-users mailing list
<a href="mailto:mapguide-users@lists.osgeo.org" target="_blank">mapguide-users@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
  </pre></blockquote></div></div></div><br>_______________________________________________<br>mapguide-users mailing list<br><a href="mailto:mapguide-users@lists.osgeo.org" target="_blank">mapguide-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><br><br></blockquote></div><br><pre><hr width="90%" size="4">
_______________________________________________
mapguide-users mailing list
<a href="mailto:mapguide-users@lists.osgeo.org" target="_blank">mapguide-users@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
  </pre></blockquote></div></div></div><br>_______________________________________________<br>mapguide-users mailing list<br><a href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><br>
<br></blockquote></div><br>