AnsweredAssumed Answered

How do I programmatically create freehand polylines?

Question asked by mastayner on Sep 24, 2013
Latest reply on Sep 24, 2013 by mastayner
How do I programmatically create freehand polylines?

I tried following what was done in this thread.

Here is my code:

var templatePicker = new esri.dijit.editing.TemplatePicker({           featureLayers: templateLayers,           rows: 'auto',           columns: 'auto',           style:'height:98%;width:98%;'         },'templatePickerDiv');                  templatePicker.startup();         var settings = {           templatePicker: templatePicker,           map: map,           layerInfos:layers,           toolbarVisible: false,           createOptions: {             polygonDrawTools:[esri.dijit.editing.Editor.CREATE_TOOL_FREEHAND_POLYGON],            polylineDrawTools:[esri.dijit.editing.Editor.CREATE_TOOL_FREEHAND_POLYLINE]             }         }            on(templatePicker, "SelectionChange", function() {    selectedTemplate = templatePicker.getSelected();    if (selectedTemplate) {     switch (selectedTemplate.featureLayer.geometryType) {      case "esriGeometryPoint":      alert("point");       drawToolbar.activate(esri.toolbars.Draw.POINT);       break;      case "esriGeometryPolyline":       alert("line");       selectedTemplate.template.drawingTool === 'esriFeatureEditToolFreehand';       break;      case "esriGeometryPolygon":       selectedTemplate.template.drawingTool === 'esriFeatureEditToolFreehand' ? drawToolbar.activate(esri.toolbars.Draw.FREEHAND_POLYGON) : drawToolbar.activate(esri.toolbars.Draw.POLYGON);       break;     }    }   }); 

The alert fires, which tells me I'm getting to the right place, but the line still uses the traditional draw.

This example is supposed to draw freehand, but it doesn't work for me either.  Does it work for you?