if (snap) {
// TODO: Very simple snapping
// - Snap steps relative to the distance?
double snapDistance;
SystemOfMeasurement som = NavigatableComponent.getSystemOfMeasurement();
if (som.equals(SystemOfMeasurement.CHINESE)) {
snapDistance = snapDistanceChinese * SystemOfMeasurement.CHINESE.aValue;
} else if (som.equals(SystemOfMeasurement.IMPERIAL)) {
snapDistance = snapDistanceImperial * SystemOfMeasurement.IMPERIAL.aValue;
} else if (som.equals(SystemOfMeasurement.NAUTICAL_MILE)) {
snapDistance = snapDistanceNautical * SystemOfMeasurement.NAUTICAL_MILE.aValue;
} else {
snapDistance = snapDistanceMetric; // Metric system by default
}
double closestWholeUnit;