Smart Editor Rounding Coordinates

1965
12
02-01-2019 08:11 AM
AnnieBrough
New Contributor III

I am using the Smart Editor widget in WAB to create and then move point features to specific XY locations. However, upon doing so I noticed that when I enter an X or Y coordinate with 6 decimal places, it is automatically rounded to 3 decimal places. This is extremely infuriating as it is placing my point 30+ metres away from where it should be. When recording the exact location of something in a forest, this 30+ metres introduces significant and unnecessary error. I have been unable to find a setting in the widget where I can configure this differently, however, the number of decimal places in the Coordinate widget CAN be changed. Unfortunately, changing this widget's settings does not affect the Smart Editor XY decimals. 

So my question is, has anyone been able to adjust the number of decimal places for the XY coordinates in the Smart Editor widget?? 

0 Kudos
12 Replies
RobertScheitlin__GISP
MVP Emeritus

Annie,

   Are you using "Map Spatial Reference" or "Latitude/Longitude" in the popup?

0 Kudos
AnnieBrough
New Contributor III

I am using "Latitude/Longitude" in the pop-up but tried both options and they both round the decimals to three.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Annie,

   The fix can be made in the XYCoordinate.html if you are using Portal or WAB Dev editions:

Lines 13 and 18

<div class="esriCTPopupContainer" data-dojo-attach-point="coordinatesPopup">
    <div class="esriCTFieldDropdownContainer">
        <div class="esriCTSelectTitle" title="${nls.coordinatesSelectTitle}">${nls.coordinatesSelectTitle}</div>
        <div class="esriCTFieldInput">
            <select style="width: 340px;" data-dojo-attach-point="coordinatesDropDown" data-dojo-type="dijit/form/Select">
                <option value="Map Spatial Reference">${nls.mapSpecialReferenceDropdownOption}</option>
                <option value="Latitude/Longitude">${nls.latLongDropdownOption}</option>
            </select>
        </div>
    </div>
    <div class="esriCTTextBoxContainer">
        <div class="esriCTSelectTitle" data-dojo-attach-point="xAttributeTextBoxLabel">${nls.xAttributeTextBoxLabel}</div>
        <div class="esriCTControlWidth" style="width: 340px;" data-dojo-attach-point="xAttributeTextBox" data-dojo-type="dijit/form/NumberTextBox" data-dojo-props="intermediateChanges:true, constraints:{pattern: '0.##########'}">
        </div>
    </div>
    <div class="esriCTTextBoxContainer">
        <div for="yAttributeTextBox" class="esriCTSelectTitle" data-dojo-attach-point="yAttributeTextBoxLabel">${nls.yAttributeTextBoxLabel}</div>
        <div class="esriCTControlWidth" style="width: 340px;" data-dojo-attach-point="yAttributeTextBox" data-dojo-type="dijit/form/NumberTextBox" data-dojo-props="intermediateChanges:true, constraints:{pattern: '0.##########'}">
        </div>
    </div>
</div>
AnnieBrough
New Contributor III

Thank you for the help Robert, but I would rather not have to download and host WAB just to make this minor change. Perhaps I should pose this suggestion in the Idea Board?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Yes that is a good route. You should also make a call to esri tech support and get an enhancement request logged for this too.

0 Kudos
by Anonymous User
Not applicable

Robert- I too have this issue and it sounds like your suggestion will fix it. However, I cannot seem to locate the "XYCoordinate.html" file. Would you be able to generally point me as to where this file is located in the web appbuilder folder structure? A search through the entire directory yielded no results unfortunately...

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Matt,

   The XYCoordinate.html is right in the widgets\SmartEditor folder.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Annie,

Don't forget to mark this question as answered by clicking on the "Mark Correct" link on the reply that answered your question.

0 Kudos
AiroboticsLtd
New Contributor II

The code snippet does not fix the problem, the tool keeps round the coordinates into 3 decimal places.

Both in the SmartEditor Form and in the related attributes (these attrubutes are auto-updated using the smart attribute action)

0 Kudos