var i = 0; function addGraphic(pt) { console.log("addingGraphic"); i++; var symbol = new SimpleMarkerSymbol( SimpleMarkerSymbol.STYLE_CIRCLE,12); var template = new InfoTemplate("results", "${*}"); var attr = {}; attr["asdf"] = "J" + i; var graphic = new Graphic(pt, symbol, attr,template); map.graphics.add(graphic); //featureLayer.applyEdits([graphic], null, null); //console.log(" Fire on everything!"); }
var i = 0; var geometry; function addGraphic(pt){ var symbol = new SimpleMarkerSymbol( SimpleMarkerSymbol.STYLE_CIRCLE, 12); i++; graphic = new Graphic(pt, symbol,attr); map.graphics.add(graphic); var attr = {}; attr["asdf"] = i; new esri.geometry.Point(pt, map.spatialReference); var newFeature = new esri.Graphic(geometry, null,null); graphic.setAttributes(attr); featureLayer.applyEdits([graphic], null, null); console.log(" Fire on everything!");
var geometry; function addGraphic(pt){ var symbol = new SimpleMarkerSymbol( SimpleMarkerSymbol.STYLE_CIRCLE, 12); graphic = new Graphic(pt, symbol,attr); map.graphics.add(graphic); var i ; var attr = {}; attr["asdf"] ="J"+ i + 1; new esri.geometry.Point(pt, map.spatialReference); var newFeature = new esri.Graphic(geometry, null,null); graphic.setAttributes(attr); featureLayer.applyEdits([graphic], null, null); console.log(" Fire on everything!");
var i= i + 1; var attr = {"cycle":"J"+ i}; featureLayer.applyEdits([graphic], null, attr); console.log(" Fire on everything!");
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.