Link | yahoo_geocode |
Author | Jason Huck |
Category | Utility |
Version | 8.x |
License | http://opensource.org/licenses/artistic-license.php |
Posted | 27 Mar 2006 |
Updated | 27 Mar 2006 |
More by this author... |
Geocodes the given address via Yahoo! Geocoding API. Requires a valid Yahoo! Application ID. Returns a map containing all of the address components, including longitude and latitude.
yahoo_geocode( -appid='myAppId', -location='1815 Griffin Road, Dania Beach, FL 33004' );
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
define_tag( 'geocode', -namespace='yahoo_', -required='appid', -optional='street', -optional='city', -optional='state', -optional='zip', -type='integer', -optional='location', -priority='replace', -description='Geocodes the given address via Yahoo! Geocoding API.' ); local('getparams') = params; iterate(#getparams, local('i')); #i->first->removeleading('-'); /iterate; local('response') = xml( string( include_url( 'http://api.local.yahoo.com/MapsService/V1/geocode', -getparams=#getparams ) ) ); local('out' = map); local('fields') = array( 'Latitude', 'Longitude', 'Address', 'City', 'State', 'Zip', 'Country' ); local('p') = string(#response->extract('//@precision')->first)->split('"')->second; #out->insert('Precision' = #p); iterate(#fields, local('f')); local('d') = #response->extract('//*[local-name()=\'' + #f + '\']/text()')->first; #out->insert(#f = #d); /iterate; return(#out); /define_tag;
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
hahahha