Select to view content in your preferred language

GeometryService.UNIT_YARD in a esri.tasks.DistanceParameters

936
4
02-11-2014 07:09 AM
AdrianMarsden
Honored Contributor
Hi

i'm trying to finish my custom measure tool (the esri widget isn't up to the job)  and trying to allow users to change units.  I have code, not dis-similar to https://developers.arcgis.com/javascript/jssamples/util_buffergraphic.html

However, whilst I can happily change to UNIT_FOOT,  UNIT_METER even UNIT_US_NAUTICAL_MILE I can't seem to get UNIT_YARD to work.

Looking at the DistanceParameters - it appears to store these as valies - so UNIT_METER is returned in the console as 9001. However UNIT_YARD returns UNDEFINED - surely that is a valid unit?

Cheers

ACM
0 Kudos
4 Replies
derekswingley1
Deactivated User
Check out the server REST API help for info on possible values. Starting from the buffer help, you can get to two pages that list possible units from the description for the "unit" parameter:

http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constant...
http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#//000w00000041000000
0 Kudos
AdrianMarsden
Honored Contributor
So many yards - who knew? 😉

So which of the 8 yards iis the good old fashioned British yard?
0 Kudos
AdrianMarsden
Honored Contributor
0 Kudos
derekswingley1
Deactivated User
Yeah, I think that's the one. Or you could use use feet and multiply by three.
0 Kudos