The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

GeoCoder

Mojolicious::Plugin::GeoCoder - Plugin for geocoding and reverse geocoding features!

VERSION

Version 0.05

SYNOPSIS

#Mojolicious lite

plugin 'GeoCoder' => { language_code=> 'es' }; #by default language code 'en'

#or you could do

my $rh_conf = {
        language_code   => 'en',
        encoding        => 'latin1' #by default its utf-8
    };

plugin 'GeoCoder' => $rh_conf;

#in controller
my $rh_location = $self->geocode({location=> 'London'});

my $rh_location = $self->reverse_geocode({latlng=> '18.234686,73.446444'});

#to get raw response from geocoder
my $rh_location = $self->geocode({location=> 'London',raw_response => 1 });

#To change language to fr and country to canada only for one request
#Now following will return London from Canada instead of real London from UK
my $rh_location = $self->geocode({location=> 'London',language_code=>'fr',country_code => 'ca' });

#default response 
    {
        'lat'       => '51.5073509',
        'address'   => 'London, UK',
        'lng'       => '-0.1277583'
    };

AUTHOR

Rohit Deshmukh, <raigad1630 at gmail.com>

BUGS

Please report any bugs or feature requests to https://github.com/raigad/mojolicious-plugin-geocoder/issues

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Mojolicious::Plugin::GeoCoder

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2014 Rohit Deshmukh.