Select to view content in your preferred language

Rotating points dynamically with Editor widget

1578
3
06-03-2012 06:27 PM
AndrewLeane
Emerging Contributor
Hi all,

Is there a way to dynamically rotate a point, in much the same way as lines and polygons can be rotated via the editor widget? (e.g. polygons but not points can be rotated in this example http://help.arcgis.com/en/webapi/javascript/arcgis/demos/ed/ed_editing_widget.html )

I can rotate a point via setting an 'angle' attribute in ArcMap for rotation, and then editing the value in the attribute editor, but this seems very clunky compared to the dynamic rotation available for lines and polygons. 

I realize for circular points this would be useless, but I am using a PictureMarkerSymbol for arrows which point in various directions, and with attribute editing it is very difficult to quickly pick the direction you want the arrow to point.

Thanks for the help
3 Replies
CraigNewell
New Contributor
I am also facing the same challenge and am hopeful that ESRI will decide, in a future release, to support the Edit Tool rotating a point.  I am also placing a PictureMarkerSymbol onto my map, using a Point geometry base and want to use the elegant Edit Tool rotation interface to allow my users to manipulate the picture symbol.

I've tried a few approaches:
1) replacing the point geometry with a multi-point, but the Edit Toolbar continues to lack support for rotating this object
2) replacing with a line geometry, but then I can no longer use my image (via the PictureMarkerSymbol) as it now fails to render
3) replacing with an extent geometry, but this also does not support the rotation operation
3) Changing from a PictureMarkerSymbol to a PictureFillSymbol, and using a polygon geometry.  This allowed me to draw the polygon shape, and displayed my image (repeating) within the shape.  It also support rotation, but as I rotated the shape, my image continued to align itself in the original direction.

I've been forced to create my own workaround using javascript mouse events.  It allows me to rotate my original PictureMarkerSymbol through directly manipulating the symbol's angle value.  But the interface provided by the Edit tool is more intuitive.

Perhaps there is a different approach I haven't yet tried.  Otherwise, I'm hopeful that support for rotating a point can be added to the Edit toolbar.
ZachLiu1
Deactivated User
I would think the last choice will be a good choice if there's still no native rotate function for points.

So, when "draw-end" event fires, you can dynamically create a small polygon of an arrow shape around the event point and add it to the map.

Of course when you rotate polygons, the picture fill will not rotate accordingly. So the only choice seems to just use single color fill.

It may not be very pretty, but it may get the job done.
0 Kudos
ChristianDebono
Emerging Contributor
Dear Craig Newell,

I am facing the same problem as you did, can you specify how you implemented your workaround for this problem.

Thanks