TNG GoogleMap

From Genwiki

Revision as of 23:16, 15 May 2007 by Brian (Talk | contribs)

Jump to: navigation, search

If you are not comfortable with html and php editing, this page may not be for you


Overview

This TNG modification provides a simple connection to the Google Map facility from within the TNG software for each of the "Place" notations on the "getperson" page.

Resulting TNG features

  1. Within the person pages, an icon ( My tng map small.gif ) to the right of places (and left of the existing magnifier Tng search small.gif) will be displayed to link to the Google Map site. For example: John McFadyen on my TNG page.


Revision History

  • Revision 1.9 - May 15, 2007 - updates for TNG V6.1 release (only the personlib.php file changed from 1.8)
  • Revision 1.8 - Jan 15, 2007 - updates for TNG V6.0.4 release (only the personlib.php file changed from 1.7)
  • Revision 1.7 - Jan 7, 2007 - added handling of Lat/Long data where entered for places
  • Revision 1.6 - Nov 19, 2006 - updated for V6.0.3 support (only the personlib.php file changed)
  • Revision 1.5a - Oct 24, 2006 - correction for a typo on line 25 of v6.0.2 personlib.php
  • Revision 1.5 - Oct 23, 2006 - correction to remove the place search icon when no place is defined
  • Revision 1.4 - Oct 22, 2006 - updated for V6.0.2 support
  • Revision 1.3 - Oct 15, 2006 - updated get_google function with option to start the map in the hybrid mode, and the option to open in a new window
  • Revision 1.2 - Oct 11, 2006 - updated get_google function to not display the magnifing glass if the resulting place string is too short

Requirements

  1. A working TNG installation - see The Next Generation of Genealogy Sitebuilding
  2. A backup of your TNG files


TNG Modifications V6.0.0/1/2/3/4

The following zip file contains the necessary information to allow the addition of this feature.

  • The zip file TNG_google.place_mod_1.9.zip contains 3 files:
    • my_tng_map_small.gif - a green magnifier glass for the goole map icon
    • get_google.php - the google map link function
    • v6.0.0/personlib.php - a modified TNG V6.0.0 / V6.0.1 file
    • v6.0.2/personlib.php - a modified TNG V6.0.2 file
    • v6.0.3/personlib.php - a modified TNG V6.0.3 file
    • v6.0.4/personlib.php - a modified TNG V6.0.4 file
    • v6.1/personlib.php - a modified TNG V6.1 file


  1. backup your existing TNG personlib.php file
  2. download this zip (TNG_google.place_mod_1.9.zip)
  3. unzip it, examine the contents
  4. if you have NOT made any other modifications to your personlib.php file, then use this version of the file
  5. if you have made modifications to your personlib.php file, then you will need to manually add the feature by editing your own version of personlib.php
    • there are 4 short modifications to make: line 2-4, 21-29, 20-23, 425-434 of the supplied V6.1 personlib.php file may be used as the example code, you can cut and paste from this file
  6. examine the get_google.php function
    • if you would like the map to start in the hybrid mode (satelite overlaid with map) then uncomment the appropriate option line
      • you may customize the initial zoom level as well
    • if you would like the the map to open in a new window, then uncomment the appropriate option line
    • you may use it as is, but you may wish to modify some of the substitution strategy
    • read the section below regarding the get_google function modification
  7. copy the gif, get_google.php, and your modified or supplied personlib.php to your base TNG directory
  8. check it out



TNG Modifications V5.1.4 or earlier

The following zip file contains the necessary information to allow the addition of this feature.

  • The zip file TNG_google.place_mod.zip contains 3 files:
    • my_tng_map_small.gif - a green magnifier glass for the goole map icon
    • get_google.php - the google map link function
    • personlib.mods.txt - a description of the 4 mods to be performed in personlib.php


  • IF you are running v 5.1.4 then


  1. backup your existing TNG v5.1.4 personlib.php file
  2. download this zip (TNG_google.place_mod.zip)
  3. unzip it, examine the contents
  4. modify your personlib.php file with the 4 mods listed in the personlib.mods.txt
    • you can cut and paste from this text file
  5. examine the get_google.php function
    • you may use it as is, but you may wish to modify some of the substitution strategy
    • read the section below regarding the get_google function modification
  6. copy the gif, get_google.php, and your modified personlib.php to your base TNG directory
  7. check it out


  • IF you are NOT running v5.1.4 or you HAVE made changes to personlib.php then, you are on your own, however, the modifications are reasonably straight forward. If you are not completely comfortable doing this sort of update, then try upgrading to TNG v5.1.4 first. If you are still intent on trying it, the procedure above will likely be very close.


In the event of a problem with your TNG site

  1. copy your backup personlib.php to your base TNG directory
    • all should be well now
  2. you may also delete the get_google.php and my_tng_small_map.gif files


get_google function String Replacement

The simple function included in the get_google.php file first checks for Lat/Long data for the place. If found, the Lat/Long data is used for the google map. If no Lat/Long data is available, then it scans the "place" string and performs a number of substitutions. These will be somewhat dependent on the structure you have used for place descriptions in your database.

In my case, many of my places refer to counties, townships, and other identifiers that do not exist today. For example, the place "Kincardine Township, Bruce County, Ontario, Canada" is not a location that Google is going to understand. However, "Kincardine, Ontario, Canada" would work for Google.

I often include other information that doesn't fit on a map. For example, the tag "DIED" may include info such as "at home" or "near Main Street" or "5 miles from the boundary". In these cases, I decided that I would include all such information in brackets. So I have locations like:

DIED: "(at home) Kincardine Township, Bruce County, Ontario, Canada" which turn into "Kincardine, Ontario, Canada"


With the previous examples in mind, I use the following rules to create google locations:

  • remove all text in brackets such that something like "(at home)" becomes ""
  • remove comma sections that contain "Township of...,"
  • remove comma sections that contain ",...Township"
  • remove any remaining strings "Township"
  • remove comma sections that contain "County of...,"
  • remove comma sections that contain ",...County"
  • remove any remaining strings "County"
  • remove comma sections that contain "Parish of...,"
  • remove comma sections that contain ",...Parish"
  • remove any remaining strings "Parish"

I am sure others will find rules that are more appropriate, or work better for their data set.

Support

  1. You're sort of on your own... If you have a specific question, or feel some additional info in the above would help others, feel free to contact me directly. Mail me here
    • Please post suggestions, or your own flavour of this mod to the forum or list
Personal tools