Select to view content in your preferred language

Skin or Style Draw \ Edit Tool? i.e. Control edit vertex transparency

631
1
02-12-2012 05:09 PM
DanielBaternik
Deactivated User
Hi,

I'd like to skin\style the edit \ drawing tools to make them a little more interactive for the user. As a start, i'd like to have the edit vertices change transparency on mouse out\over.

In my case, i have a polyline, where on mouse out i'd like to dim the edit vertex polygons so that the user can see the structure of the line in detail without the edit vertices obstructing their view. On mouse over, i'd like to have those edit vertices become opaque once again. Or perhaps only show the active edit vertex as opaque.

I looked at the hooks for the symbols and i didn't see anything. Has anyone tried this before? Skins would be ideal. However maybe the answer is to extend a symbol and inject mouse event logic.

cheers
Tags (2)
0 Kudos
1 Reply
DanielBaternik
Deactivated User
FYI

This code works....still open to better solutions

   
    // Add the geometry as a graphic to the graphics layer
    editGraphic = new Graphic(permitApplicationModel.activePermit.Permit.TravelPermit.Shape, routeSymbol);
    
    // Define edit vertex skin
    (editTool.vertexSymbol as SimpleMarkerSymbol).alpha = 0;
    (editTool.vertexSymbol as SimpleMarkerSymbol).outline.alpha = 0.3;
       
    editTool.addEventListener("vertexMouseOver", function():void
    {
     (editTool.vertexSymbol as SimpleMarkerSymbol).alpha = 1;
     (editTool.vertexSymbol as SimpleMarkerSymbol).outline.alpha = 1;
    });
    
    editTool.addEventListener("vertexMouseOut", function():void
    {
     (editTool.vertexSymbol as SimpleMarkerSymbol).alpha = 0;
     (editTool.vertexSymbol as SimpleMarkerSymbol).outline.alpha = 0.3;
    });

    graphicsLayerRoute.add(editGraphic);
    
    // Initiate editing
    editTool.addEventListener(EditEvent.GEOMETRY_UPDATE, routeModified);
    editTool.activate(EditTool.EDIT_VERTICES, [ editGraphic ]);
0 Kudos