Line Style With Arrows
A colleague of mine asked me if there was a way to put arrows at the end of drawn polylines. My answer was "Not out of the box directly :-( but you can create your own line style subclass :-) And here is an implementation in action. Check out the source code here.
Comments
Any chance you have a dual map with one control implementation?
Thanks and keep up the innovation.
- marseyas
I had previously downloaded ArrowApp from the Best Practices code bundle in the ESRI Flex Code Gallery, and posted to their forum about the same issue. They directed me to you. See my forum post here.
public override function draw(sprite:Sprite, geometry:Geometry, attributes:Object, map:Map):void
{
super.draw(sprite, geometry, attributes, map);
if (geometry is Polyline)
{
sprite.graphics.lineStyle(width, color, alpha);
const polyline:Polyline = Polyline(geometry);
for each (var path:Array in polyline.paths)
{
if (path.length > 1)
{
drawPath(sprite, path, map);
}
}
}
}
Note how the super call is moved to the top ? hope this helps