
Geo::Coder::GoogleMaps::Location - Geo::Coder::GoogleMaps' Location object

Version 0.2 (follow Geo::Coder::Google version number)

Here we have the object returned by Geo::Coder::GoogleMaps->geocode()

The constructor can take the following arguments :
- SubAdministrativeAreaName : a string
- PostalCodeNumber : a postal code (err...)
- LocalityName : yes! A locality name !
- ThoroughfareName: same thing => a string
- AdministrativeAreaName
- CountryNameCode
- address
- longitude
- latitude
- altitude (warning in Google Map API altitude must be 0)
Access the SubAdministrativeAreaName parameter.
print $location->SubAdministrativeAreaName(); # retrieve the value
$location->SubAdministrativeAreaName("Paris"); # set the value
Access the PostalCodeNumber parameter.
print $location->PostalCodeNumber(); # retrieve the value
$location->PostalCodeNumber("75000"); # set the value
Access the ThoroughfareName parameter.
print $location->ThoroughfareName(); # retrieve the value
$location->ThoroughfareName("1 Avenue des Champs Ãlysées"); # set the value
Access the LocalityName parameter.
print $location->LocalityName(); # retrieve the value
$location->LocalityName("Paris"); # set the value
Access the AdministrativeAreaName parameter.
print $location->AdministrativeAreaName(); # retrieve the value
$location->AdministrativeAreaName("PA"); # set the value
Access the CountryNameCode parameter.
print $location->CountryNameCode(); # retrieve the value
$location->CountryNameCode("FR"); # set the value
Access the Accuracy parameter.
print $location->Accuracy(); # retrieve the value
$location->Accuracy(8); # set the value
Access the address parameter.
print $location->address(); # retrieve the value
$location->address("1 Avenue des Champs Ãlysées, 75000, Paris, FR"); # set the value
Access the id parameter.
print $location->id(); # retrieve the value
$location->id("point1"); # set the value
Access the latitude parameter.
print $location->latitude(); # retrieve the value
$location->latitude("-122.4558"); # set the value
Access the longitude parameter.
print $location->longitude(); # retrieve the value
$location->longitude("55.23465"); # set the value
Access the altitude parameter.
print $location->altitude(); # retrieve the value
$location->altitude(0); # set the value
Please note that it must be 0 if you use the Google Map API.
This method is not really an accessor, it's only a getter which return longitude, latitude and altitude as a string.
print "Placemark's coordinates",$location->coordinates,"\n";
Return a JSON encoded object ( thanks to JSON::Syck::Dump() )
my $json = $location->toJSON ;
Return a KML object ( thanks to XML::LibXML ).
my $kml = $location->toXML ;
Please note that this function can take an optionnal argument (0 or 1) and if it's set to 1 this method return a XML string instead of the XML::LibXML::Document object.
An allias for toKML()
This method simply call the good to(JSON|XML|KML) depending of the output format you selected.
You can eventually pass extra arguments, they will be relayed.
$location->Serialyze(1); # if the output is set to XML or KML you will have a stringified XML as output

Arnaud DUPUIS, <a.dupuis at nabladev.com>

Please report any bugs or feature requests to bug-geo-coder-googlemaps at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Geo-Coder-GoogleMaps. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

You can find documentation for this module with the perldoc command.
perldoc Geo::Coder::GoogleMaps
You can also look for information at:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Geo-Coder-GoogleMaps


Copyright 2007 Arnaud DUPUIS and Nabla Development, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.