function get_attributes () : Object function set_attributes (value : Object)
Attributes are stored as a JSON array. For example, {"Name" : graphicName, "Total Sales" : totalSales, "Total Income" : sumIncome}. Each item is a JSON object consisting a string and value.
例如:
var attributes = {"graphicID": txtTitle ,"featureCoordinates" : txtContent};
var tmp='point'+graphicCount;
var graphicFeature = $create(ESRI.ADF.Graphics.GraphicFeature,{"id":tmp,"geometry":m_geometry,
"attributes":attributes});
获取其中的值:
function onMouseOverGraphics(sender, eventArgs)
{
//alert('onMouseOverGraphics');
eventArgs.element.set_highlight(true);
//eventArgs.element.set_isSelected(true);
//alert(eventArgs);
var attri=eventArgs.element.get_attributes();
alert(attri.graphicID);
}