nigelhorne/ged2site

Error when "-w" is turned on but not any Google Maps features

cablespaghetti opened this issue · 1 comments

Just a small bug I've had to work around. I have "-w" on so I can have the todo page generated. However not got as far as getting a Google Maps API key yet.

So my command looks like this:
./ged2site -cFdwh "Deborah Ann /Collins/" source.ged

The error is this:
Can't call method "geocode" on an undefined value at ./ged2site line 4633, <GEN0> line 15983.

The line number might differ, as I've added a few census mappings to my version. But I've just commented out this bit to get things working:

               if(!$osm->geocode($town)) {
                       # Don't die because there are many
                       # false positives as locations
                       # may no longer exist
                       if(my $person = $params{'person'}) {
                               warn colored($person->as_string({ include_years => 1 }) . ": unknown location $place", 'red');
                       } else {
                               warn colored("Unknown location $place", 'red');
                       }
                       $places{$place} = 0;
                       $places{$town} = 0;
                       return 0;
               }

Thanks for all your help with everything. I've just got http://beta.constantinefamily.org.uk up and running with the most basic possible setup. :)

$osm points to OpenStreetMap, so it should work even without a Google Maps API key, since it doesn't touch Google (see http://www.openstreetmap.org).

The actual bug is that $osm is only defined if the -m option is given, whereas it should be defined if either -m or -w is given. I'll fix that.

Well done with your website - I'm glad my software can help.