How to set Measure as Initial Mouse Mode
If you want to have Measure activated and shown in the moment the viewer is initialized, you need to set the InitalMouseMode accordingly. The MouseMode ID for the Measure Mode is 100. So the code needs to look like this:
How to define Initial Coordinates
In some cases you want to show a certain measured part right from the beginning on. The parameter for this is measure_Initial.
This section shows you how you can retrieve the values for this parameter.
Step 1: Go to the browser and open the site which contains your viewer. Open the console with F12. Note: the parameter debug needs to be set to true.
Step 2: You need to give your viewer an ID in order to refer to it. In the example, we chose id=”measure”
Step 3: Type document.getElementById(‘measure’).testAPIListenersStart().
This command starts the API Listener Test (you can read more about the API here.)
Step 4: Go to the viewer, activate Measure and measue the part which you would like to have as inital measurement.
Step 5: Select the listener [onMeasureEnd] in the console and open the details with the arrow next to Arguments.
Step 6: The values shown under 3: (green selection in the image below), are the values that need to be set in measure_Initial:
measure_Initial=”0.23781512605042016, 0.6447761194029851, 0.23949579831932774, 0.9044776119402985“. You can copy them out of the console easily.