Trace line or polygon feature along another feature in OpenLayers

Trace control allow to trace feature along another feature. Trace along feature is required at many places, like marking on road or on utility line (water pipe, gas pipe or electric line). For details please check the source code Trace.js. I have made small modification in Snapping control of OpenLayers, added snappedFeature on snap event. Check the difference in Snapping.js.
Enable Tracing