Hi Kenneth, Hi All,

I would like to create new Line (MgFeatureGeometricType.Curve) Layer , and create line feature in this new Layer , I worked with follwoing steps:

1.Take Layer Definition for Exsisting Line Layer and SetResource as following

MgByteReader byteReader = resourceService.GetResourceContent(layerDefResId);
XmlDocument doc = new XmlDocument();
String xmlLayerDef = byteReader.ToString();
doc.LoadXml(xmlLayerDef);
String xmlString = doc.DocumentElement.OuterXml;
MgResourceIdentifier layerDefId = new MgResourceIdentifier("Session:" + GetParameter(this.args, "SESSION") + "//NewLayer.LayerDefinition"); resourceService.SetResource(layerDefId, new MgByteReader(xmlString, "text/xml"), null);


2. Insert New Layer

layers.Insert(layers.IndexOf(layer), newLayer);


3.Create Line Geometry

MgLinearRing Line = geometryFactory.CreateLinearRing(coordinateColl);
MgGeometry Geom = geometryFactory.CreatePolygon(Line, null);

4.Write Geometry and Update Featur Service

propertyValues.Add(new MgGeometryProperty("Geometry", byteReader1));
updateCommands.Add(new MgInsertFeatures(className, propertyValues));
MgFeatureService featureService = (MgFeatureService)this.site.CreateService(MgServiceType.FeatureService); featureService.UpdateFeatures(layerResId, updateCommands, false);

5. Save map and refresh

after previouse steps No thing appear , No bugs , No Result , Only NewLayer Created


Can you help me plz to update Exsisting Line Layer ?

Best Regards
Akram
_______________________________________________
mapguide-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapguide-users

Reply via email to