I'm new at ArcGIS programming, I'm trying to input attribute for the polygon with draw script using ArcGIS API for JavaScript based on this: https://developers.arcgis.com/javascript/3/jssamples/toolbar_draw.html.
I try to input the attribute via windows pop up(the windows pop up was for base form input) using event draw complete,based on this: https://developers.arcgis.com/javascript/3/jsapi/draw-amd.html#event-draw-complete, but i fail because i don't know how to using it. My code was like this :
function initToolbar() {
tb = new Draw(map);
tb.on("draw-complete", addToMap);
// event delegation so a click handler is not
// needed for each individual button
on(dom.byId("tool"), "click", function(evt) {
if (evt.target.id == "tool") {
return;
}
var tool = evt.target.id.toLowerCase();
//map.hideZoomSlider();
tb.activate(tool);
});
}
function addToMap(evt) {
tb.deactivate();
//map.showZoomSlider();
switch (evt.geometry.type){
case "point":
case "multipoint":
symbol = new SimpleMarkerSymbol();
break;
case "polyline":
symbol = new SimpleLineSymbol();
break;
default:
symbol = new SimpleFillSymbol();
break;
}
var graphic = new Graphic(evt.geometry, symbol);
map.graphics.add(graphic);
}
Anyone can tell me, how to input attribute with another method ?