UMN-LATIS / leaflet-treering

Use link below to test non-released changes.
https://umn-latis.github.io/leaflet-treering/
0 stars 1 forks source link

H-Bar Appearance Changes & Additions #74

Closed thorn573 closed 4 years ago

thorn573 commented 4 years ago
Figure 1. Figure 2.

How the h-bar legs (sections perpendicular to line between mouse & point) are created has been simplified (Figure 1). At its core, the h-bar legs are a 90 degree rotation of the section between the mouse & point. Also, the legs have been extended by 1.3 times the distance between the mouse & point.

A new button under 'Image and Measurement Settings' will toggle a path guide on and off. The path guide helps users make straight measurement paths. Path guide are created by (Figure 2):

  1. Finding the X-value some distance (100 pixels in this case) from the mouse or point along the linear line created by the mouse & point.
  2. Plugging it into the linear equation of the line between the mouse & point to find the Y-value.
  3. Using Leaflet's polyline to draw a line between the calculated X & Y-value.

An undefined slope due to a vertical line (mouse is directly blow or above the point) have been accounted for (line 870-871).

cmcfadden commented 4 years ago

looks great aside from that possible orphaned variable!