Whitebeam Template Reference Documentation

Site Map
 
Home
 
Application Guide
Reference
  Installation
  Configuration
  XML Markup
  JavaScript Classes
  ROM
  Templates
  Environment
  Dev Process
  Tools
  External Links
  Example libraries
Community
Contact Whitebeam
To-Do
Download
Credits
Licence
Whitebeam Users
 
 
 

Whitebeam Template Reference Documentation

Geo Template

lookup()

Search the database for a specific post code.

See Also

rb.postcode.()   

Syntax

location = rb.postcode.lookup(domain, postcode)

Parameters

The 'lookup' method takes 2 parameters:

Name Type/Value Range/Length Description
domainstring  Required. Domain in which to search. This will depend on the data sets loaded. UK for UK postcodes, US for US ZIP codes
postcodestring  Required. The postcode to be located

Results

The 'lookup' method returns structure:

Type/Value Range/Length Description
struct location see definition

Returns the closest location for the specified post code. The postcode is normalised before the search by removing spaces and converting to a common case. Non alpha-numeric characters are removed. The search is then done in three stages:

  • An exact match is attempted
  • If this fails then a partial search is made using the first 4 characters
  • If this fails then a partial search is made using the first 3 characters

If none of these searches yield a match then 'null' is returned to the application.


Remarks

rb.postcode.lookup

Used to determine a physical location for a specific or partial post code

Whitebeam release 1.3.36
(loadtime : 728ms)