I'm currently using the JS API 3.x. I need to convert between linear units and I'm wondering if there is a utility I can use within the API to facilitate this. Basically, I need to convert meters to all possible linear units such as yards, feet...
Thanks,
Hi @Danik-B , perhaps something like the geometryEngine could help?
https://developers.arcgis.com/javascript/3/jsapi/esri.geometry.geometryengine-amd.html#planarlength
Hi @Noah-Sager . I was looking at the geometryEngine but I couldn't see a method to just convert unit values. I don't have geometry I just have a value and need to be able to convert it to any esriUnit. I'm sure the API has a function to do it but I couldn't find it in the reference docs.
Ah, ok. I was thinking the distance() method. If you just want to convert a value to a different unit type, I'm sure there's a generic javascript function or some simple math you could use in the app. I could be wrong, but I don't think we have such a function as part of the API.