Esri / distance-direction-addin-dotnet

Add-in provides the ability to easily and quickly create geodesy lines, circles, ellipses and range rings.
Apache License 2.0
17 stars 22 forks source link

Distance and Direction: Distance Calculation should label based on units specified in Distance Calculation parameters #444

Closed csmoore closed 6 years ago

csmoore commented 7 years ago

From @elinz on February 17, 2017 17:21

Widget

Distance and Direction

Version of widget

1.0 release of Military Tools for ArcGIS

Bug or Enhancement

Perform distance calculation where center point is on New York City, time is 24 hours, rate is 60 miles per hour, which equals 1440 miles.

The widget labels the output graphic based on the Radius/Diameter units instead of the units set in the Rate parameter. For this example, I specified the rate as "Miles / Hour" so the labeled units should be Miles.

Also when you perform distance calculations the output should be labeled as "Radius" no matter if the "From" parameter is set to Radius or Diameter.

image

@kgonzago FYI.

Repo Steps or Enhancement details

Copied from original issue: Esri/solutions-webappbuilder-widgets#831

csmoore commented 7 years ago

From @adgiles on February 20, 2017 11:1

@elinz

The label is set using the units specified by the user in the drop downs. When the distance calculator is used it converts the calculated distance to the correct figure in the distance input box.

So for example if I have the units set to meters and the create circle from radius, and I use the distance calculator to work out 2 hours at 10 kilometres per hour, the units will automatically be filled in as 20,000 meters, and this value and radius will be used for the label:

1

if I have the units set to meters and the create circle from diameter, and I use the distance calculator to work out 2 hours at 10 kilometres per hour, the units will automatically be filled in as 10,000 meters, and this value and diameter will be used for the label:

1

I personally think this is how the widget should behave

csmoore commented 7 years ago

From @elinz on February 21, 2017 16:19

@adgiles @kgonzago @nfeuerstein We'll need to discuss this further and make a final decision.

csmoore commented 7 years ago

From @Dbarnes1 on March 14, 2017 20:31

@adgiles @elinz @kgonzago @nfeuerstein you can see I created an issue in Distance and Direction add-in repo that references this issue. We should address these inconsistencies for the next release.

topowright-zz commented 6 years ago

It would also be nice if we start stacking labels so that the label is not bigger than the area/feature that is being labeled. I also know that we added the capability to the GRG widget that allows for labels to work without having to change the config file on the app that is housing the widget. Could that be done apart of this as well?

@adgiles how large of an effort would that be?

adgiles commented 6 years ago

@topowright there is already an issue (#439) to address the labels to work without changing the config

BobBooth commented 6 years ago

@adgiles - is the latest version available on the Try It site? https://nationalsecurity.esri.com/solutionsweb/DistanceAndDirection/

BobBooth commented 6 years ago

@adgiles - the functionality seems to be working, but there is one usability issue. If you create a circle by clicking a point, then want to change the units of the label (but keep the center point and distance), when you use the dropdown, the value in the distance box does not update. This is not a problem if you click back in the Rate box and hit Enter, but if you click the OK button, you get a new circle of different radius. This seems strange. So, for example, I click a point, units are Meters, and in the Distance Calculator, I set the Time for 1 Hour and the Rate for 70 Miles per Hour. I get: image.png It is the correct size and the right number of meters, but now I realize that I want the label to be in Miles. I click the radius Units dropdown and set it to Miles. When I click OK, I get an 112,654.08 mile diameter 'circle' image.png If the value in Radius updated when I changed the units, this would not happen. I can make it work as expected/designed by changing the Units to Miles and then clicking in the Time or Rate boxes and hitting Enter.

topowright-zz commented 6 years ago

@adgiles We need to recalculate the radius/diameter value when someone selects a different unit of measure. Currently if you do not update the rate in the distance calculator and you choose a different radius/diameter unit of measure the tool will not update:
image

STEPS TO REPLICATE: 1.Enter a starting location 2.Enter a time 3.Enter a rate Expected results: The updated value for distance is calculated correctly 4.Change the units for the radius/diameter value Values do not update I used one hour of travel at 60 miles per hour and then changed the units to kilometers from miles for the value of the radius/diameter @BobBooth this is what i gathered from your message above. I thought it would be better if we wrote the exact steps to allow @adgiles to understand how to replicate the issue.

adgiles commented 6 years ago

Added a check to see if the distance calculator is open when the distance units change, if so, recalculate the radius value based on the time and rate.

The reason why we need the check to see if the calculator is open is we don't want the value to change when a user is not using the calculator

@topowright @BobBooth please verify once PR #485 has been merged

BobBooth commented 6 years ago

I have tested this issue using the latest copy of the widget from the repo on my local machine in WAB 2.6, and it now works correctly. (thanks @ACueva for the help getting WAB running). I believe this issue may be closed now. @topowright @adgiles

BobBooth commented 6 years ago

Added steps to checklist test to exercise these changes. https://github.com/ArcGIS/solutions-defense-test-catalog/pull/86

topowright-zz commented 6 years ago

This needs to be reviewed by a PE before we can move this to done.

ACueva commented 6 years ago

Worked with @BobBooth and reviewed these changes. Walked through the items added to the checklist test, verified these fixes are working.