[mapguide-users] Set feature properties to a point

yof85 loref85 at yahoo.com.ar
Fri Mar 1 07:16:52 PST 2013


Hello, I'm struggle with this

I create a point, these are my properties of my feature class definition

MgDataPropertyDefinition identityProperty = new
MgDataPropertyDefinition("KEY");
identityProperty.SetDataType(MgPropertyType.Int32);
identityProperty.SetAutoGeneration(true);
identityProperty.SetReadOnly(true);
clsProps.Add(identityProperty);

MgDataPropertyDefinition nameProperty = new
MgDataPropertyDefinition("NAME");
nameProperty.SetDataType(MgPropertyType.String);
clsProps.Add(nameProperty);

MgGeometricPropertyDefinition geometryProperty = new
MgGeometricPropertyDefinition("GEOM");
geometryProperty.SetGeometryTypes(MgFeatureGeometricType.Point);
clsProps.Add(geometryProperty);

In order to draw my point I make this collection

MgPropertyCollection propertyCollection = new MgPropertyCollection();

MgStringProperty nameProperty = new MgStringProperty("NAME", name);
propertyCollection.Add(nameProperty);

MgWktReaderWriter wktReaderWriter = new MgWktReaderWriter();
MgAgfReaderWriter agfReaderWriter = new MgAgfReaderWriter();

MgGeometry geometry = wktReaderWriter.Read("POINT XY (" +
x.ToString().Replace(",",".") + " " + y.ToString().Replace(",",".") + ")");
MgByteReader geometryByteReader = agfReaderWriter.Write(geometry);
MgGeometryProperty geometryProperty = new MgGeometryProperty("GEOM",
geometryByteReader);	propertyCollection.Add(geometryProperty);

My point in the map is selectable. I get to see my point in the map, but how
can I see the property "NAME" and the value in the properties section of the
map? this is the JSON string I see when I click on my created point

{"Points" : [{"values" : [], "zoom" : {"x" : -107.329103, "y" : 44.902578
}}]}

I think the "values" section of the JSON has to be set with the "NAME"
property, this is where I'm stuck

Thanks in advance




--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Set-feature-properties-to-a-point-tp5037772.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list