Ignore:
Timestamp:
Nov 23, 2004, 11:19:36 PM (17 years ago)
Author:
kake
Message:

Huge-ass pile of changes to make geo stuff work worldwide.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/OpenGuides.pm

    r558 r559  
    55use CGI;
    66use CGI::Wiki::Plugin::Diff;
    7 use CGI::Wiki::Plugin::Locator::UK;
     7use CGI::Wiki::Plugin::Locator::Grid;
    88use OpenGuides::CGI;
    99use OpenGuides::Template;
     
    4646    $self->{wiki} = $wiki;
    4747    $self->{config} = $args{config};
    48     my $locator = CGI::Wiki::Plugin::Locator::UK->new;
     48    # Default to British National Grid for historical reasons.
     49    my $geo_handler = $self->config->{_}{geo_handler} || 1;
     50    my $locator;
     51    if ( $geo_handler == 1 ) {
     52        $locator = CGI::Wiki::Plugin::Locator::Grid->new(
     53                                             x => "os_x",    y => "os_y" );
     54    } elsif ( $geo_handler == 2 ) {
     55        $locator = CGI::Wiki::Plugin::Locator::Grid->new(
     56                                             x => "osie_x",  y => "osie_y" );
     57    } else {
     58        $locator = CGI::Wiki::Plugin::Locator::Grid->new(
     59                                             x => "easting", y => "northing" );
     60    }
    4961    $wiki->register_plugin( plugin => $locator );
    5062    $self->{locator} = $locator;
     
    183195                 language      => $config->{_}->{default_language},
    184196               );
    185 
    186197
    187198    # We've undef'ed $version above if this is the current version.
     
    574585printing the output to STDOUT.
    575586
     587The geographical data that you should provide in the L<CGI> object
     588depends on the handler you chose in C<wiki.conf>.
     589
     590=over
     591
     592=item *
     593
     594B<British National Grid> - provide either C<os_x> and C<os_y> or
     595C<latitude> and C<longitude>; whichever set of data you give, it will
     596be converted to the other and both sets will be stored.
     597
     598=item *
     599
     600B<Irish National Grid> - provide either C<osie_x> and C<osie_y> or
     601C<latitude> and C<longitude>; whichever set of data you give, it will
     602be converted to the other and both sets will be stored.
     603
     604=item *
     605
     606B<UTM ellipsoid> - provide C<latitude> and C<longitude>; these will be
     607converted to easting and northing and both sets of data will be stored.
     608
     609=back
     610
    576611=cut
    577612
Note: See TracChangeset for help on using the changeset viewer.