Sample code:var pt = new esri.geometry.Point(x,y,map.spatialReference)var pms = new new esri.symbols.PictureMarkerSymbol('/images/pin.png');var attr = {"Xcoord":evt.mapPoint.x,"Ycoord":evt.mapPoint.y,"Plant":"Mesa Mint"};var infoTemplate = new InfoTemplate("Vernal Pool Locations","Latitude: ${Ycoord} <br/> Longitude: ${Xcoord} <br/> Plant Name:${Plant}");var graphic = new Graphic(pt,pms,attr,infoTemplate);map.graphics.add(graphic)where attr will be the attributes of the feature, and anything inside ${} is one of the field names in attr. I normally like to create a separate graphics layer so not to pollute map.graphics, and you will have more control over the graphics added.Hope it helps.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.