|
|
[google_geocode]Description
Parameters
Sample Usage
Source CodeClick 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.
Related TagsComments
08/15/2008, Dominique Guardiola
Accented letters fix When geocoding in countries using accented letters, the output from Google throws a libxml2 error when passed to xml_tree. As gary Clark pointed it out on Lassotalk, the fix is : protect; local('data') = xml_tree(encode_smart( include_url( 'http://maps.google.com/maps/geo', -getparams=#getparams )) ); |
|||||||||||||||||||||||||
If "placemark" is an array, you get an error
I was getting "unknown error" with a particular address. Turns out Google was returning 2 placemark elements instead of a single one, which would cause the code to barf because it was expecting a string, not an array of elements Fix: Favour the first element of the returned placemark array. Line 38: Replace with the following: local('placemark')=#data->response->placemark; if(#placemark->isa('array')); local('coords') = #placemark->get(1)->point->coordinates->contents; else; local('coords') = #placemark->point->coordinates->contents; /if;