Select to view content in your preferred language

Snap to Polygon's lines

3401
8
05-21-2012 10:43 PM
SelçukTınaz
Occasional Contributor
Hi Everyone,

    I search really much but no result yet. What i need to do is to snap polygon's lines not only edges. I need to be able to snap any point around the polygon.
Is that possible in any way, is there a property or what?

Thanks in Advance
0 Kudos
8 Replies
vipulsoni
Regular Contributor
Hi Everyone,

    I search really much but no result yet. What i need to do is to snap polygon's lines not only edges. I need to be able to snap any point around the polygon.
Is that possible in any way, is there a property or what?

Thanks in Advance


Hi,

Have a look at these posts , for sure they will help you.

http://forums.arcgis.com/threads/48285-Snap-Options
http://forums.arcgis.com/threads/27004-Polygon-Editing-Capabilities-in-Silverlight-API

example - <esri:Map x:Name="MyMap" Extent="-13054165,3850112,-13027133,3863559" esri:Editor.SnapDistance="20" esri:Editor.SnapKey="S">
0 Kudos
SelçukTınaz
Occasional Contributor
Unfortunately, they are not what i want exactly. I have some polygon features.Lets say it is a triangle. Then, what i need to do is to put a point feature
on the middle of the polygon feature's line (not polygon's edges). Other explanation: one line of polygon is [0,0] - [6,6]. I want to put a point feature at [2,2].
I need to be able to snap on the line

Thanks
0 Kudos
ChristopherHill
Deactivated User
In Silverlight API v3.0 which is not yet final setting SnapToEdgeEnabled=true will allow you to snap to line edges that connect two verticies in a polygon. This property does not exist in v2.4 of the Silverlight API.

<esri:Map x:Name="MyMap" Extent="-13054165,3850112,-13027133,3863559" esri:Editor.SnapDistance="20" esri:Editor.SnapKey="S" esri:Editor.SnapToEdgeEnabled="True">
0 Kudos
SelçukTınaz
Occasional Contributor
Thanks for reply,

    First thing i am using 2.4. In javascript api, it is snaping to any point of the polygon's lines. I want to do that in silverlight but no solution yet.
İs there a way to do that in SL API 2.4 or how can i reach 3.0 api or when it is going to publish?
0 Kudos
SelçukTınaz
Occasional Contributor
Hi again,

After your reply, i installed api 3.0 and made necessary edits in my application. After all, i try esri:Editor.SnapToEdgeEnabled="True" options but when i press the
"ctrl" button to activate snap, the application crashed. When i remove only that setting, application works fine but without edge snapping.
Any help would be great

Thanks
0 Kudos
JenniferNery
Esri Regular Contributor
If you did not define esri:SnapKey, by default you can use Ctrl-key to enable snapping. Otherwise, whatever key you defined as SnapKey will be used to activate snapping. While snapping is enabled as you draw or edit your geometry, the vertex being drawn or edited will try to snap to nearby vertices (or edge if you set esri:SnapToEdgeEnabled=True).

I have not experienced app crash during snapping, can you provide us with a code snippet? Where you in the middle of Draw or Edit? Kindly explain the steps to reproduce the issue. Thanks.
0 Kudos
SelçukTınaz
Occasional Contributor
Thanks for all interest,

   But, because of my system requirements i go back to the 2.4 api and i am searching for alternative solution to the problem.

Many thanks for all again.
0 Kudos
SelçukTınaz
Occasional Contributor
Hi again me.

  After all i go back to 3.0 prerealease version. I try to snap by settings "esri:Editor.SnapToEdgeEnabled="True"" and snapKey and snapDistance. But when i press
snap button (whatever i set). The application crashed badly. Why is that? Am I doing something wrong or is it fix in 3.0 api for right now. Please help.

Thanks.
0 Kudos