<div>thanks a lot for your replay,yes, i'm sure, i've tried another code and with mapguide studio i see the layer that i add, it contains the line wich i insert, but on iframe (where the map is displayed) i don't see the layer and even in mapguide studio with the layers belonging to the map, i don't see the layer (it's not added), this is my complete code:</div>
<div> </div>
<div><font size="2">
<p><%</p></font><font color="#0000ff" size="2">@</font><font size="2"> </font><font color="#800000" size="2">Page</font><font size="2"> </font><font color="#ff0000" size="2">Language</font><font color="#0000ff" size="2">="VB"</font><font size="2"> </font><font color="#ff0000" size="2">AutoEventWireup</font><font color="#0000ff" size="2">="true"</font><font size="2"> </font><font color="#ff0000" size="2">CodeFile</font><font color="#0000ff" size="2">="essai.aspx.vb"</font><font size="2">
<p></p></font><font color="#ff0000" size="2">
<p>Inherits</p></font><font color="#0000ff" size="2">="essai"</font><font size="2"> %>
<p><%</p></font><font color="#0000ff" size="2">@</font><font size="2"> </font><font color="#800000" size="2">Import</font><font size="2"> </font><font color="#ff0000" size="2">Namespace</font><font color="#0000ff" size="2">="System"</font><font size="2"> %>
<p><%</p></font><font color="#0000ff" size="2">@</font><font size="2"> </font><font color="#800000" size="2">Import</font><font size="2"> </font><font color="#ff0000" size="2">Namespace</font><font color="#0000ff" size="2">="System.IO"</font><font size="2"> %>
<p><%</p></font><font color="#0000ff" size="2">@</font><font size="2"> </font><font color="#800000" size="2">Import</font><font size="2"> </font><font color="#ff0000" size="2">Namespace</font><font color="#0000ff" size="2">="System.Collections.Specialized"</font><font size="2"> %>
<p><%</p></font><font color="#0000ff" size="2">@</font><font size="2"> </font><font color="#800000" size="2">Import</font><font size="2"> </font><font color="#ff0000" size="2">Namespace</font><font color="#0000ff" size="2">="OSGeo.MapGuide"</font><font size="2"> %>
<p><%</p></font><font color="#0000ff" size="2">@</font><font size="2"> </font><font color="#800000" size="2">Import</font><font size="2"> </font><font color="#ff0000" size="2">Namespace</font><font color="#0000ff" size="2">="System.Text"</font><font size="2"> %>
<p><%</p></font><font color="#0000ff" size="2">@</font><font size="2"> </font><font color="#800000" size="2">Import</font><font size="2"> </font><font color="#ff0000" size="2">Namespace</font><font color="#0000ff" size="2">="System.Globalization"</font><font size="2"> %>
<p> </p>
<p> </p>
<p></p></font><font color="#0000ff" size="2">
<p><!</p></font><font color="#800000" size="2">DOCTYPE</font><font size="2"> </font><font color="#ff0000" size="2">html</font><font size="2"> </font><font color="#ff0000" size="2">PUBLIC</font><font size="2"> </font><font color="#0000ff" size="2">"-//W3C//DTD XHTML 1.0 Transitional//EN"</font><font size="2">
<p></p></font><font color="#0000ff" size="2">
<p>"<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>"></p>
<p> </p>
<p> </p>
<p><</p></font><font color="#800000" size="2">html</font><font size="2"> </font><font color="#ff0000" size="2">xmlns</font><font color="#0000ff" size="2">="<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>"</font><font size="2"> </font><font color="#0000ff" size="2">>
<p><</p></font><font color="#800000" size="2">head</font><font size="2"> </font><font color="#ff0000" size="2">id</font><font color="#0000ff" size="2">="Head1"</font><font size="2"> </font><font color="#ff0000" size="2">runat</font><font color="#0000ff" size="2">="server">
<p></p></font><font size="2">
<p></p></font><font color="#0000ff" size="2"><</font><font color="#800000" size="2">title</font><font color="#0000ff" size="2">></font><font size="2">selection</font><font color="#0000ff" size="2"></</font><font color="#800000" size="2">title</font><font color="#0000ff" size="2">>
<p></p></font><font size="2">
<p></p>
<p></p></font><font color="#0000ff" size="2">
<p></</p></font><font color="#800000" size="2">head</font><font color="#0000ff" size="2">>
<p><</p></font><font color="#800000" size="2">body</font><font color="#0000ff" size="2">>
<p><</p></font><font color="#800000" size="2">br</font><font size="2"> </font><font color="#0000ff" size="2">/>
<p></p></font><font size="2">
<p><%</p>
<p></p></font><font size="2">
<p></p>
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> x0 </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">String</font><font size="2"> = </font><font color="#800000" size="2">"100"
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> y0 </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">String</font><font size="2"> = </font><font color="#800000" size="2">"100"
<p></p></font><font size="2">
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> x1 </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">String</font><font size="2"> = </font><font color="#800000" size="2">"120"
<p></p></font><font size="2">
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> y1 </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">String</font><font size="2"> = </font><font color="#800000" size="2">"120"
<p></p></font><font size="2">
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> sessionid1 </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">String
<p></p></font><font size="2">
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> siteConnection </font><font color="#0000ff" size="2">As</font><font size="2"> MgSiteConnection
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> resourceSrvc </font><font color="#0000ff" size="2">As</font><font size="2"> MgResourceService
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> myLayerName </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">String</font><font size="2"> = </font><font color="#800000" size="2">"line6"
<p></p></font><font size="2">
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> mapname </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">String</font><font size="2"> = </font><font color="#800000" size="2">"Sheboygan"
<p></p></font><font size="2">
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> map </font><font color="#0000ff" size="2">As</font><font size="2"> MgMap
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> featureSrvc </font><font color="#0000ff" size="2">As</font><font size="2"> MgFeatureService
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> myLayer </font><font color="#0000ff" size="2">As</font><font size="2"> MgLayer
<p></p>
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> configPath </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">String</font><font size="2"> = </font><font color="#800000" size="2">"C:\Program Files\Autodesk\MapGuideEnterprise2008\WebServerExtensions\www\webconfig.ini"
<p></p></font><font size="2">
<p>MapGuideApi.MgInitializeWebTier(configPath)</p>
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> site1 </font><font color="#0000ff" size="2">As</font><font size="2"> MgSite = </font><font color="#0000ff" size="2">New</font><font size="2"> MgSite()
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> userInfo </font><font color="#0000ff" size="2">As</font><font size="2"> MgUserInformation = </font><font color="#0000ff" size="2">New</font><font size="2"> MgUserInformation(</font><font color="#800000" size="2">"Administrator"</font><font size="2">, </font><font color="#800000" size="2">"admin"</font><font size="2">)
<p>siteConnection = </p></font><font color="#0000ff" size="2">New</font><font size="2"> MgSiteConnection()
<p>siteConnection.Open(userInfo)</p>
<p>site1 = siteConnection.GetSite()</p>
<p>sessionid1 = site1.CreateSession()</p>
<p>userInfo.SetMgSessionId(sessionid1)</p>
<p>resourceSrvc = siteConnection.CreateService(MgServiceType.ResourceService)</p>
<p>featureSrvc = siteConnection.CreateService(MgServiceType.FeatureService)</p>
<p></p>
<p>Response.Charset = </p></font><font color="#800000" size="2">"utf-8"
<p></p></font><font size="2">
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> layerDef </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">String</font><font size="2"> = </font><font color="#800000" size="2">"Library://Samples/Sheboygan/Layers/"</font><font size="2"> + myLayerName + </font><font color="#800000" size="2">".LayerDefinition"
<p></p></font><font size="2">
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> layerDefId </font><font color="#0000ff" size="2">As</font><font size="2"> MgResourceIdentifier = </font><font color="#0000ff" size="2">New</font><font size="2"> MgResourceIdentifier(layerDef)
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> dataSource </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">String</font><font size="2"> = </font><font color="#800000" size="2">"Library://Samples/Sheboygan/Data/"</font><font size="2"> + myLayerName + </font><font color="#800000" size="2">".FeatureSource"
<p></p></font><font size="2">
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> dataSourceId </font><font color="#0000ff" size="2">As</font><font size="2"> MgResourceIdentifier = </font><font color="#0000ff" size="2">New</font><font size="2"> MgResourceIdentifier(dataSource)
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> resourceID2 </font><font color="#0000ff" size="2">As</font><font size="2"> MgResourceIdentifier = </font><font color="#0000ff" size="2">New</font><font size="2"> MgResourceIdentifier(</font><font color="#800000" size="2">"Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition"</font><font size="2">)
<p></p>
<p>map = </p></font><font color="#0000ff" size="2">New</font><font size="2"> MgMap(siteConnection)
<p>map.Create(resourceSrvc, resourceID2, mapname)</p>
<p></p>
<p>map.Save()</p>
<p>map.Open(resourceSrvc, mapname)</p>
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> myClassDef </font><font color="#0000ff" size="2">As</font><font size="2"> MgClassDefinition
<p></p></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">) </font><font color="#0000ff" size="2">Then
<p></p></font><font size="2">
<p></p>
<p></p></font><font color="#008000" size="2">'//create Feature Source
<p></p></font><font size="2">
<p>myClassDef = </p></font><font color="#0000ff" size="2">New</font><font size="2"> MgClassDefinition()
<p>myClassDef.SetName(</p></font><font color="#800000" size="2">"line6"</font><font size="2">)
<p></p></font><font color="#008000" size="2">'myClassDef.SetDescription(myLayerName + " Feature Source")
<p></p></font><font size="2">
<p></p></font><font color="#008000" size="2">'myClassDef.SetDefaultGeometryPropertyName("SHPGEOM")
<p></p></font><font size="2">
<p></p></font><font color="#008000" size="2">'Set KEY Property
<p></p></font><font size="2">
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> prop </font><font color="#0000ff" size="2">As</font><font size="2"> MgDataPropertyDefinition = </font><font color="#0000ff" size="2">New</font><font size="2"> MgDataPropertyDefinition(</font><font color="#800000" size="2">"KEY"</font><font size="2">)
<p>prop.SetDataType(MgPropertyType.Int32)</p>
<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>prop.SetNullable(</p></font><font color="#0000ff" size="2">False</font><font size="2">)
<p>myClassDef.GetProperties().Add(prop)</p>
<p>myClassDef.GetIdentityProperties().Add(prop)</p>
<p></p></font><font color="#008000" size="2">'Set ID Property
<p></p></font><font size="2">
<p>prop = </p></font><font color="#0000ff" size="2">New</font><font size="2"> MgDataPropertyDefinition(</font><font color="#800000" size="2">"ID"</font><font size="2">)
<p>prop.SetDataType(MgPropertyType.Int32)</p>
<p>myClassDef.GetProperties().Add(prop)</p>
<p></p>
<p></p>
<p></p></font><font color="#008000" size="2">'et geometry property
<p></p></font><font size="2">
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> geomProp </font><font color="#0000ff" size="2">As</font><font size="2"> MgGeometricPropertyDefinition = </font><font color="#0000ff" size="2">New</font><font size="2"> MgGeometricPropertyDefinition(</font><font color="#800000" size="2">"SHPGEOM"</font><font size="2">)
<p>geomProp.SetGeometryTypes(MgFeatureGeometricType.Point)</p>
<p>geomProp.SetHasElevation(</p></font><font color="#0000ff" size="2">False</font><font size="2">)
<p>geomProp.SetHasMeasure(</p></font><font color="#0000ff" size="2">False</font><font size="2">)
<p>geomProp.SetSpatialContextAssociation(</p></font><font color="#800000" size="2">"LL84"</font><font size="2">)
<p>myClassDef.GetProperties().Add(geomProp)</p></font><font size="2">
<p></p></font><font color="#008000" size="2">'Create the schema
<p></p></font><font size="2">
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> schema </font><font color="#0000ff" size="2">As</font><font size="2"> MgFeatureSchema = </font><font color="#0000ff" size="2">New</font><font size="2"> MgFeatureSchema()
<p>schema.SetName(</p></font><font color="#800000" size="2">"SHP_Shema"</font><font size="2">)
<p>schema.GetClasses().Add(myClassDef)</p>
<p></p>
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> sdfParams </font><font color="#0000ff" size="2">As</font><font size="2"> MgCreateSdfParams = </font><font color="#0000ff" size="2">New</font><font size="2"> MgCreateSdfParams(</font><font color="#800000" size="2">"MGA-56 (GDA94 /MGA zone 56)"</font><font size="2">, map.GetMapSRS(), schema)
<p>featureSrvc.CreateFeatureSource(dataSourceId, sdfParams)</p>
<p> </p>
<p></p>
<p></p>
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> content </font><font color="#0000ff" size="2">As</font><font size="2"> MgByteSource = </font><font color="#0000ff" size="2">New</font><font size="2"> MgByteSource(</font><font color="#800000" size="2">"C:\Program Files\Autodesk\MapGuideEnterprise2008\WebServerExtensions\www\createpoint\LayerDefinition.xml"</font><font size="2">)
<p>resourceSrvc.SetResource(layerDefId, content.GetReader(), </p></font><font color="#0000ff" size="2">Nothing</font><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>
<p></p></font><font color="#008000" size="2">'map.GetLayers().Add(myLayer)
<p></p></font><font size="2">
<p>myLayer.ForceRefresh()</p></font><font size="2">
<p></p>
<p>map.Save(resourceSrvc)</p>
<p></p>
<p></p>
<p></p>
<p></p></font><font color="#0000ff" size="2">End</font><font size="2"> </font><font color="#0000ff" size="2">If
<p></p></font><font size="2">
<p></p>
<p></p>
<p></p></font><font size="2">
<p></p></font><font color="#008000" size="2">Dim insertFeatures2 As MgInsertFeatures = New MgInsertFeatures(myLayerName, makeLine2("1", x0, y0, x1, y1))
<p></p></font><font size="2">
<p></p>
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> commands </font><font color="#0000ff" size="2">As</font><font size="2"> MgFeatureCommandCollection = </font><font color="#0000ff" size="2">New</font><font size="2"> MgFeatureCommandCollection()
<p></p></font><font color="#008000" size="2">commands.Add(insertFeatures2)
<p></p></font><font size="2">
<p></p>
<p>myLayer.UpdateFeatures(commands)</p>
<p></p>
<p></p></font><font color="#008000" size="2">
<p></p></font><font size="2">
<p></p></font><font size="2">
<p></p>
<p></p></font><font color="#008000" size="2">
<p></p></font><font size="2">
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p>%></p>
<p></p></font><font color="#0000ff" size="2">
<p><</p></font><font color="#800000" size="2">div</font><font size="2"> </font><font color="#ff0000" size="2">id</font><font color="#0000ff" size="2">="viewer">
<p></p></font><font size="2">
<p></p></font><font color="#0000ff" size="2"><</font><font color="#800000" size="2">iframe</font><font size="2"> </font><font color="#ff0000" size="2">id</font><font color="#0000ff" size="2">="carte"</font><font size="2"> </font><font color="#ff0000" size="2">width</font><font color="#0000ff" size="2">="800"</font><font size="2"> </font><font color="#ff0000" size="2">height</font><font color="#0000ff" size="2">="300"</font><font size="2"> </font><font color="#ff0000" size="2">frameborder</font><font color="#0000ff" size="2">="0"</font><font size="2"> </font><font color="#ff0000" size="2">scrolling</font><font color="#0000ff" size="2">="no"</font><font size="2"> </font><font color="#ff0000" size="2">src</font><font color="#0000ff" size="2">="<a href="http://localhost/mapguide2008/mapviewerajax/?SESSION=">http://localhost/mapguide2008/mapviewerajax/?SESSION=</a></font><font size="2"><%=sessionid1 %></font><font color="#0000ff" size="2">&WEBLAYOUT=Library%3a%2f%2fSamples%2fSheboygan%2fLayouts%2fSheboyganAsp.WebLayout"</font><font size="2"> </font><font color="#ff0000" size="2">name</font><font color="#0000ff" size="2">="fenetre"></</font><font color="#800000" size="2">iframe</font><font color="#0000ff" size="2">>
<p></p></font><font size="2">
<p></p></font><font color="#0000ff" size="2"></</font><font color="#800000" size="2">div</font><font color="#0000ff" size="2">>
<p></p></font><font size="2">
<p></p></font><font color="#0000ff" size="2"><</font><font color="#800000" size="2">br</font><font size="2"> </font><font color="#0000ff" size="2">/>
<p></p></font><font size="2"> </font><font color="#0000ff" size="2">
<p></</p></font><font color="#800000" size="2">body</font><font color="#0000ff" size="2">>
<p><</p></font><font color="#800000" size="2">script</font><font size="2"> </font><font color="#ff0000" size="2">type</font><font color="#0000ff" size="2">="text/javascript">
<p></p></font><font size="2"><font size="2">
<p></p></font><font color="#0000ff" size="2">function</font><font size="2"> refresh()
<p>{</p>
<p></p></font><font color="#008000" size="2">//carte.GetMapFrame().GetLayers(true,true);
<p></p></font><font size="2">
<p></p></font><font color="#008000" size="2">//carte.GetScriptFrame().location.href = "essai.aspx";
<p></p></font><font size="2">
<p>frames[</p></font><font color="#800000" size="2">'fenetre'</font><font size="2">].location.reload();
<p>carte.GetMapFrame().Refresh();</p>
<p></p></font><font color="#008000" size="2">//carte.ExecuteMapAction(20);
<p></p></font><font size="2">
<p></p></font><font color="#008000" size="2">//carte.GetMapFrame().ExecuteMapAction(1);
<p></p></font><font size="2">
<p></p></font><font color="#008000" size="2">//carte.GetTaskFrame().location.href = "essai.aspx"
<p></p></font><font size="2">
<p></p></font><font color="#008000" size="2">//carte.GetScriptFrame().location.href = "essai.aspx"
<p></p></font><font size="2">
<p></p></font><font color="#008000" size="2">//carte.GetMapFrame().ExecuteMapAction(20);
<p> </p>
<p></p></font><font size="2">
<p></p></font><font color="#008000" size="2">//carte.GetMapFrame().ExecuteMapAction(20);
<p></p></font><font size="2">
<p>}</p>
<p></p></font></font><font color="#0000ff" size="2">
<p></</p></font><font color="#800000" size="2">script</font><font color="#0000ff" size="2">>
<p> </p>
<p><</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">
<p></p></font><font size="2">
<p></p></font><font color="#0000ff" size="2">
<p></p></font><font size="2"><font color="#0000ff" size="2">
<p>Public</p></font><font size="2"> </font><font color="#0000ff" size="2">Function</font><font size="2"> makeLine2(</font><font color="#0000ff" size="2">ByVal</font><font size="2"> Name </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">String</font><font size="2">, </font><font color="#0000ff" size="2">ByVal</font><font size="2"> x0 </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">String</font><font size="2">, </font><font color="#0000ff" size="2">ByVal</font><font size="2"> y0 </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">String</font><font size="2">, </font><font color="#0000ff" size="2">ByVal</font><font size="2"> x1 </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">String</font><font size="2">, </font><font color="#0000ff" size="2">ByVal</font><font size="2"> y1 </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">String</font><font size="2">) </font><font color="#0000ff" size="2">As</font><font size="2"> MgPropertyCollection
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> PropertyCollection2 </font><font color="#0000ff" size="2">As</font><font size="2"> MgPropertyCollection = </font><font color="#0000ff" size="2">New</font><font size="2"> MgPropertyCollection()
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> nameProperty2 </font><font color="#0000ff" size="2">As</font><font size="2"> MgInt32Property = </font><font color="#0000ff" size="2">New</font><font size="2"> MgInt32Property(</font><font color="#800000" size="2">"ID"</font><font size="2">, 1)
<p>PropertyCollection2.Add(nameProperty2)</p>
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> wktReaderWriter2 </font><font color="#0000ff" size="2">As</font><font size="2"> MgWktReaderWriter = </font><font color="#0000ff" size="2">New</font><font size="2"> MgWktReaderWriter()
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> agfReaderWriter2 </font><font color="#0000ff" size="2">As</font><font size="2"> MgAgfReaderWriter = </font><font color="#0000ff" size="2">New</font><font size="2"> MgAgfReaderWriter()
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> geometry2 </font><font color="#0000ff" size="2">As</font><font size="2"> MgGeometry = wktReaderWriter2.Read(</font><font color="#800000" size="2">"LINESTRING XY ("</font><font size="2"> + x0 + </font><font color="#800000" size="2">" "</font><font size="2"> + y0 + </font><font color="#800000" size="2">","</font><font size="2"> + x1 + </font><font color="#800000" size="2">" "</font><font size="2"> + y1 + </font><font color="#800000" size="2">")"</font><font size="2">)
<p></p>
<p></p>
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> geometryByteReader2 </font><font color="#0000ff" size="2">As</font><font size="2"> MgByteReader = agfReaderWriter2.Write(geometry2)
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> geometryProperty2 </font><font color="#0000ff" size="2">As</font><font size="2"> MgGeometryProperty = </font><font color="#0000ff" size="2">New</font><font size="2"> MgGeometryProperty(</font><font color="#800000" size="2">"SHPGEOM"</font><font size="2">, geometryByteReader2)
<p>PropertyCollection2.Add(geometryProperty2)</p>
<p></p></font><font color="#0000ff" size="2">Return</font><font size="2"> PropertyCollection2
<p></p></font><font color="#0000ff" size="2">End</font><font size="2"> </font><font color="#0000ff" size="2">Function</font>
<p></p>
<p></p>
<p></p></font><font color="#0000ff" size="2">Function</font><font size="2"> DoesLayerExist(</font><font color="#0000ff" size="2">ByVal</font><font size="2"> LayerName </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">String</font><font size="2">, </font><font color="#0000ff" size="2">ByVal</font><font size="2"> Map </font><font color="#0000ff" size="2">As</font><font size="2"> MgMap) </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">Boolean
<p></p></font><font size="2">
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> layers </font><font color="#0000ff" size="2">As</font><font size="2"> MgLayerCollection = Map.GetLayers()
<p></p></font><font color="#0000ff" size="2">Return</font><font size="2"> (layers.Contains(LayerName))
<p></p></font><font color="#0000ff" size="2">End</font><font size="2"> </font><font color="#0000ff" size="2">Function
<p></p></font><font size="2">
<p></p>
<p></p></font><font color="#0000ff" size="2">Function</font><font size="2"> LoadTemplate2(</font><font color="#0000ff" size="2">ByVal</font><font size="2"> filePath </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">String</font><font size="2">) </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">String
<p></p></font><font size="2">
<p></p>
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> sr </font><font color="#0000ff" size="2">As</font><font size="2"> StreamReader = File.OpenText(filePath)
<p></p></font><font color="#0000ff" size="2">Dim</font><font size="2"> template </font><font color="#0000ff" size="2">As</font><font size="2"> </font><font color="#0000ff" size="2">String</font><font size="2"> = sr.ReadToEnd()
<p></p></font><font color="#0000ff" size="2">Return</font><font size="2"> template
<p></p></font><font color="#0000ff" size="2">End</font><font size="2"> </font><font color="#0000ff" size="2">Function
<p> </p>
<p></p></font><font size="2">
<p></p>
<p></p>
<p></p>
<p></p></font><font color="#0000ff" size="2">
<p></</p></font><font color="#800000" size="2">script</font><font color="#0000ff" size="2">>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p></p></font><font size="2">
<p></p>
<p></p></font><font color="#0000ff" size="2">
<p></</p></font><font color="#800000" size="2">html</font><font color="#0000ff" size="2">>
<p></p></font> <br> <br>
<hr width="90%" size="4">
<br>_______________________________________________<br>mapguide-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:mapguide-users@lists.osgeo.org" target="_blank">mapguide-users@lists.osgeo.org</a><br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><br> </div>
<div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>_______________________________________________<br>mapguide-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><br>
<a onclick="return top.js.OpenExtLink(window,event,this)" 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>