AnsweredAssumed Answered

Cannot call method 'trim' of undefined when trying to draw a graphic on the map

Question asked by xupla on Mar 13, 2014
Latest reply on Mar 20, 2014 by JGravois-esristaff
I am trying to add a free hand polygon to my map, but it is giving me the error "Cannot call method 'trim' of undefined". Have followed the samples but still no luck on getting it working. The code can be found below.

 function initSelectToolbar(event) {               selectionToolbar = new Draw(event.map);               var selectQuery = new Query();                on(selectionToolbar, "DrawEnd", function (geometry) {                   selectionToolbar.deactivate();                   selectQuery.geometry = geometry;                   featureLayer.selectFeatures(selectQuery,               FeatureLayer.SELECTION_NEW);                    var symbol;                   selectionToolbar.deactivate();                   map.showZoomSlider();                   symbol = new SimpleFillSymbol("none", new SimpleLineSymbol("dashdot", new Color([255, 0, 0]), 2), new Color([255, 255, 0, 0.25]));                   alert(geometry.type);                   var graphic = new Graphic(geometry, symbol);                   map.graphics.add(graphic);               });                         }


Thanks for the help.

Outcomes