Geo::Yandex::Location - Presents location data produced by Yandex Maps API
my @locations = $geo->location(address => $addr); for my $item (@locations) { say $item->address . ' (' . $item->kind .') ' . $item->latitude . ',' . $item->longitude; }
Geo::Yandex::Location is an object which may be returned by Geo::Yandex::location method in response to search query. The object is a combination of fields that describe the location in hand.
Geo::Yandex::location
Normally you do not create Geo::Yandex::Location objects yourself. These objects are intended to be read-only, and are created during geographical query initiated by calling location method of Geo::Yandex instance. All the methods listed below return either a scalar with text or numeric data, or undef in case those pieces of information cannot be applied to the location. Particular fields are formed according to GML specification (http://www.opengis.net/gml/).
location
Geo::Yandex
say $location->kind;
Type of the object, such as street or house.
say $location->address;
Full and "correct" address of the location. This address may differ from initial request.
say $location->country;
The name of the country where the object is located. Note that this name may be already contained within address field.
address
The name of the locality, for example the name of the city if the location was a city.
say $location->thoroughfare;
Thoroughfare name. E. g., the name of the street.
say $location->premise;
Premise information (house number). May contain several parts, e. g. building part of the address.
say $location->lowerCorner; say $location->lowerCorner;
Boundaries of the location. Each value is a string containing the pair of longitude and latitude. For exact format please refer to GML specification.
say $location->pos
Exact position of the location. Contains two numbers (latitude and longitude), separated by space. Use longitude and latitude methods to work with these data separately.
longitude
latitude
say $location->longitude; say $location->latitude;
Latitude and longitude of the location. These values may be obtained together with pos method.
pos
Andrew Shitov, <andy@shitov.ru>
Geo::Yandex::Location module is a free software. You may redistribute and (or) modify it under the same terms as Perl, whichever version it is.
1 POD Error
The following errors were encountered while parsing the POD:
Unknown directive: =head
To install Geo::Yandex, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Geo::Yandex
CPAN shell
perl -MCPAN -e shell install Geo::Yandex
For more information on module installation, please visit the detailed CPAN module installation guide.