Shawn,
You didn't mention which API or web app tool your are working with. Assuming it is JavaScript, are you working with Web Application Builder for developers? If so, there are several custom widgets that are close, if not exactly what you are looking for. For example Measure Widget 1.1.1 for Web App Builder
others can be found Web AppBuilder Developer Edition – Customization Resource List
in any case, it would help others to know the development environment you are using, and if you Moving Content to a location that fits, you may get more specific help. E.g.
Web AppBuilder Custom Widgets
Web AppBuilder for ArcGIS (more for the ArcGis online version)
or any number of sub places Web Developers
This is indeed for Javascript for the web appbuilder for developers