Select to view content in your preferred language

Change the selected symbol size in feature template

980
2
Jump to solution
12-05-2012 05:57 AM
SaugatJoshi
Deactivated User
Hi all,

I am using the editor tool to draw line in th application. However, when I draw the lines it appears to be really thick. The service I published for this has the size configured to be 1 pt, however ArcGIS 10.1 somehow defaults it to 6 pt for some reason. As a reson I was thinking to change the size of the graphics symbol when feature template is selected....however I am not able to get hold of the symbol size nor override it. In the Editor widget we have
case (Geometry.POLYLINE):       {        //var drawLineSymbol:Symbol = new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, 0, 1, 1);        //var drawLineSymbol:Symbol = new SimpleLineSymbol();                        if (event.selectedTemplate.featureLayer.renderer != null)        {                  drawTool.lineSymbol = event.selectedTemplate.featureLayer.renderer.getSymbol(event.selectedTemplate.featureTemplate.prototype);        }        else if (event.selectedTemplate.featureLayer.symbol)        {         drawTool.lineSymbol = event.selectedTemplate.featureLayer.symbol;        }                drawTool.activate(DrawTool.POLYLINE);        break;       }


I was trying to get hold of drawTool.lineSymbol's width property like
drawTool.lineSymbol.width
. However I cannot get it. Is there any other way to do this. Thanks.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Saugat,

The DrawTool.lineSymbol returns a Symbol and not a SimpleLineSymbol so you need to cast it to a SimplLineSymbol.

(DrawTool.lineSymbol as SimpleLineSymbol).width = 1;

View solution in original post

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus
Saugat,

The DrawTool.lineSymbol returns a Symbol and not a SimpleLineSymbol so you need to cast it to a SimplLineSymbol.

(DrawTool.lineSymbol as SimpleLineSymbol).width = 1;
0 Kudos
SaugatJoshi
Deactivated User
Thanks Robert, this fixed the problem.
0 Kudos