GLayer = new esri.layers.GraphicsLayer();
var graphic = new esri.Graphic(point, symbol);
name = "test";
graphic.setAttributes({"name" : name});
GLayer.add(graphic);
我创建了一个图形层。图形将添加到图形层。图形由点和符号组成。我在图形中创建了一个属性。如何获得图形所有属性的键?还是可以知道图形属性中是否存在特定键?
Read the documentation before posting please。是graphic.attributes
。
代替阅读文档,您可能还曾使用console.log(graphic)
将对象转储到控制台,在控制台中您可能发现该对象具有attributes
参数,或者您可以使用调试工具在以下其中一个上设置断点并检查graphic
对象以查看其所有键。请先尝试进行自己的研究和调查。