How to make freehand draw work in EditorWiget?

648
3
11-04-2010 10:45 AM
XiujuZhou
New Contributor III
I tried to use freehand draw in EditorWiget for my polygon by check box of it. but it didn't draw, instead the mouse pans map or zoom in map. What should I do to make it work? Thanks for any help!
0 Kudos
3 Replies
JenniferNery
Esri Regular Contributor
Does the EditorWidget show the template for that layer?  If no, be sure to specify an ID for that layer. The EditorWidget ignore layers that do not have an ID. The EditorWidget's LayerIDs property is optional but if you have set this, be sure that it includes the ID of the FeatureLayer with Polygon geometry. Also when working with FeatureLayers with Polyline/Polygon geometries, GeometryService property is required. 

Below is an example of minimal settings for EditorWidget:
  
                  <esri:EditorWidget Map="{Binding ElementName=MyMap}"                                       
                                      GeometryServiceUrl="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"/>


At the right-end of the EditorWidget is Add Options button "...", when you click on this and the Add Options popup is shown, check Freehand checkbox. Select a feature type in your polygon layer and begin drawing.
0 Kudos
XiujuZhou
New Contributor III
EditorWidget is set up like yours and also set LayerIDs="WCR" which is polygon. I check Freehand checkbox, nothing shows, and I cannot do freehand draw. when I click template picker, just draw polygon not freehand.


Does the EditorWidget show the template for that layer?  If no, be sure to specify an ID for that layer. The EditorWidget ignore layers that do not have an ID. The EditorWidget's LayerIDs property is optional but if you have set this, be sure that it includes the ID of the FeatureLayer with Polygon geometry. Also when working with FeatureLayers with Polyline/Polygon geometries, GeometryService property is required. 

Below is an example of minimal settings for EditorWidget:
  
                  <esri:EditorWidget Map="{Binding ElementName=MyMap}"                                       
                                      GeometryServiceUrl="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"/>


At the right-end of the EditorWidget is Add Options button "...", when you click on this and the Add Options popup is shown, check Freehand checkbox. Select a feature type in your polygon layer and begin drawing.
0 Kudos
JenniferNery
Esri Regular Contributor
What version of the API are you using? Can you share your code where you create the Map and layers? The ID of the FeatureLayer is also "WCR"? Do you apply any style to your EditorWidget? Are you doing other customizations? When Freehand is checked, it should be reflected when you draw the polygon. I cannot replicate the issue using this sample in our SDK: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ToolkitEditorWidget
0 Kudos