Xbasic
what3words Function
Syntax
result as P = what3words(key as C, mode as C, input as C)
Arguments
- keyCharacter
Your what3words API key
- modeCharacter
Can be one of the following:
- Mode
- Description
- wordstolocation
Converts a what3words address to a location (lat, lng)
- locationtowords
Converts a location (lat, lng) to a what3words address
- addresstowords
Converts a standard address to a what3words address.
- inputCharacter
The address, location, or words to convert. See mode.
Returns
- resultPointer
Returns an object with result from the call.
Description
Translate a location to or from a what3words address.
Discussion
Allows you to translate an address or location to a what3words address, or a what3words address to a location. For more information on what3words go to www.what3words.com.
Example
key = "Your api key" mode = "wordstolocation" input = "traps.plan.code" dim p as p p = what3words(key,mode,input) ?p.lat = 42.423661 ?p.lng = -71.213213 mode = "addresstowords" input = "70 blanchard road, burlington ma usa" dim p as p p = what3words(key,mode,input) ?p.words = "newly.slams.roses"