Select to view content in your preferred language

Analysis widget change default unit for summarize nearby

1341
3
Jump to solution
05-16-2021 05:21 AM
VictorTey
Esri Contributor

Hi, I am trying to change the default unit for 

VictorTey_0-1621167151138.png

 

They are currently set to Miles and I want to change it to KM.

VictorTey_1-1621167187972.png

 

My organization is set to Metric

VictorTey_2-1621167408566.png

 

In Widget.js -> _switchToAnalysisTool, I also tried to set the unit via the arg which works for create buffer.

VictorTey_3-1621167464492.png

 

Any suggestions?

@RobertScheitlin__GISP  (Any advise from you is much appreciated 🙂 )

 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

@VictorTey,

I have not tested this but it should be as simple as adding these lines to the same function:

        if(this.currentToolSetting.title === 'summarizeNearby'){
          args.units = "Kilometers";
        }

 

View solution in original post

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus

@VictorTey,

I have not tested this but it should be as simple as adding these lines to the same function:

        if(this.currentToolSetting.title === 'summarizeNearby'){
          args.units = "Kilometers";
        }

 

0 Kudos
VictorTey
Esri Contributor

Hi @RobertScheitlin__GISP  I have not idea how you know that but it works. I had a break point on the submit hoping to see it in the argument but I don't see units there.  Did you know to use units from the rest endpoint ? Again thank you so much 🙂 

https://developers.arcgis.com/rest/analysis/api-reference/summarize-nearby.htm

 

VictorTey_0-1621333313287.png

 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

@VictorTey 

I just looked at the available properties for the tool in the documentation. 
https://developers.arcgis.com/javascript/3/jsapi/summarizenearby-amd.html#properties

 

0 Kudos