grantscarroll

Programmatically change drawing tool

Discussion created by grantscarroll on Apr 1, 2012
Latest reply on Apr 1, 2012 by grantscarroll
Hi all

I'm creating an app that will be used exclusively with touch devices, the app will be used to edit point and line features in the field. What I would like to do is have the line feature edit tool default to the free hand tool, i'm not quite sure how to do this though. I am using a template picker so that the users can select which type of feature they are creating, can I set the drawing tool when the template is selected as below ?

 dojo.connect(templatePicker, "onSelectionChange", function () {
                var selected = templatePicker.getSelected();
                if (selected) {
                  $('#featuresDialog').dialog('close');
                  selected.template.drawingTool = 'esri.layers.FeatureTemplate.TOOL_FRREEHAND';
                  updateTitle("Current template: " + $('#webmapTitle').html(selected.template.name));
                }
            });


Do i have the correct syntax ? As when i do this the tool is still defaulted to the normal line drawing tool.

Thanks in advance

Grant

Outcomes