Working with TNG (12) google maps additions

Klick: back to the page from which you came  back Klick: back to home home          Klick: next page
print : ctrl-p

The screenshots shown are based on the TNG template 1. The other templates are showing similar representations.
The screen output is optimized for the Internet Explorer browser, version 7, text size "medium" and a 19-inch TFT screen .


You are here: TNG - The Next Generation Of Genealogy Sitebuilding

This section deals with the Google maps add-on.
For ease of use, it is recommended that this section is printed and followed step by step.



1. Local Server    (on homecomputer)
1.1 General
This article describes how to modify Google Maps in the TNG application by adding more "Place Level" pins.
This means that more pins with different colors are added.
The following screen print demonstrates the use of additional marker pins.



How these changes / additions can be realized is described below.

Note: Changes and additions to files may be overwritten when TNG software upgrades are performed.

1.2 Default use of Google Maps in TNG
On the TNG-people view, a map will be provided, generated by Google Maps (providing an API key has been entered in the relevant TNG Admin area - a Google Maps API key can be obtained from Google).
The map is only displayed if the appropriate longitude and latitude have been set for each event in the Admin section of TNG.
In addition, each "Place Level" must also be set, otherwise a pink pin will be shown.
At the bottom of the map the following Legend is displayed, indicating the meanings of each pin colour:
1. Red = Address
2. Brown = Location
3. Yellow = City/Town
4. Green = County/Shire
5. Blue = State/Province
6. Lilac = Country
7. Pink = Not Set



The following example demonstrates another use of the pins using life events:
1. Red = Birth
2. Brown = Baptism
3. Yellow = Marriage
4. Green = Divorce
5. Blue = Died
6. Lilac = Burial
7. Pink = Not Set (e.g. for all other event locations such as holiday, profession, study, residence, etc.)



The following changes need to be made to the file "alltext.php", which is located in any language folder (German, English, French, Spanish, etc.).
Open this file with a text editor (such as notepad.exe). Find the following section:
//For Google maps use - admin and public pages
$admtext[placelevel] = "Place Level";
$admtext[level1] = "Address";
$admtext[level2] = "Location";
$admtext[level3] = "City/Town";
$admtext[level4] = "County/Shire";
$admtext[level5] = "State/Province";
$admtext[level6] = "Country";
$admtext[level0] = "Not Set";


and make the required changes against each respective terms and save the file.
Then klick the F5-key on the PC keyboard.
Done.

Note:
The above changes must be made in each of the language sets available to your site visitors. Each installed language set will have an associated "alltext.php" file within the language folder on your site.
This will ensure that any site visitor changing to his/her own language will see the appropriate pin legend.

1.3 Changing the pin colors
To change the colours of the pins, open the file mapconfig.php (located in your TNG root folder).
Look for the following section.

$pinplacelevel0 = "006";
$pinplacelevel1 = "009";
$pinplacelevel2 = "023";
$pinplacelevel3 = "038";
$pinplacelevel4 = "074";
$pinplacelevel5 = "122";
$pinplacelevel6 = "155";


You can change these coloured pins to any of the 216 pin graphics available from the TNG website. Download the file containing the complete set of available pins from the download directory of TNG from the area "TNG Extras" / "Google Maps Colored Pin Images".
Note:
To reach this directory you will need your username and password.

To see the complete set, open the file ContactSheet.png.
Once the appropriate colours have been selected, count from the beginning of the list to the place of the selected graphic (e.g. 113).
The number corresponds to that of the graphic (e.g. 113.png).
Now copy the graphic files into the folder "googlemaps" of your own TNG site.
This procedure has to be repeated for all required additional colours.
Of course you can copy all 216 graphics to the folder "googlemaps" - but that would be pointless.

To utilise the new pin colours on your Google Maps, change the appropriate entries in "mapconfig.php" to match the required colours.

The new pin colours will now be displayed on your maps (see picture above).

1.4 Adding additional Pins
Affected files:
1. mapconfig.php;
2. personlib.php;
3. getperson.php;
4. alltext.php (one alltext.php file for each installed language);
5. admin/editplace.php;
6. admin/updatemapconfig.php;
7. admin/newplace.

You can add additional pins to Google Maps (over and above the existing 7), to show more events with different colours.

The following example demonstrates how to add 4 additional coloured pins.

First, find the file "English/alltext.php" and open it with a text editor (e.g. notepad.exe) or an HTML editor.
Find the following section:
//For Google maps use - admin and public pages (in an HTML editor it is the line 67).
There you add after the line $admtext[level6] = "Burial"; additional lines (copy and paste for ease) incrementing each number by one, i.e. change each number into 7, 8, 9, 10, and the respective description (e.g. housing; Labour/professional; school; holidays).
This procedure must be repeated in each of the language folders installed on your site. The text must be translated into all the other languages.
Save and close the file.

Next, open the file "mapconfig.php" (in the TNG root directory) with a text editor/HTML editor.
Find the entry $pinplacelevel6 = "211";
Add 4 entries incrementing the $pinplacelevel# variable by 1. In this example, $pinplacelevel7 to $pinplacelevel10
Change the pin colour (here "211") to match the new pins intended to be used on your maps on all 4 new entries (see list of the pins under item 1.3).
Save and close the file.
The next change will show the 4 new entries in the admin area at "Places >> Modify Existing Place / Place Level:"

Open the file "admin/editplace.php" with a text editor/HTML editor.
Find the entry
for($i = 1; $i < 7; $i++)
(around line 105 in an HTML editor) and change the number '7' to '11'.
Save and close the file.

This change in the admin area at "Places >> Modify Existing Place / Place Level:" will show the 4 new entries.

Next, open the file "getperson.php".
Find the entry
for($i = 1; $i < 7; $i++)
(around line 497 in an HTML editor) and change the number '7'to '11'.
Save and close the file.

Next, open the file "admin/newplace.php".
Find the entry
for($i = 1; $i < 7; $i++)
(around line 107 in an HTML editor) and change the number '7' to '11'.
Save and close the file.

Next, open the file "admin/udatemapconfig.php".
Find the entry
fwrite( $fp, "\$pinplacelevel6 = \"$pinplacelevel6\";\n" );
(around line 44 in an HTML editor).

Copy and paste this line 4 times to create 4 new lines after the above line. Increment each line by one by changing number "6" to "7"; "8"; "9" or "10".
Save and close the file.

Finally, this change ensures that the correct events are associated with the correct pins and with the corresponding colours.

Open the file "personlib.php".
Find the entry
if( $map[key] && $data[place] )
(around line 338 in an HTML editor).
Copy and paste this row
$pinplacelevel6;
4 times. Increment each place level by one; i.e. "7"; "8"; "9" and "10".
Save and close the file.

Note:
In the admin area "Places >> Modify Existing Place / Place Level:"
it may be necessary to change levels on a case by case basis to ensure that the correct pin colours are displayed.

1.5 Translations into other languages
Affected files :
- - English/alltext.php;
- - French/alltext.php;
- - Spanish/alltext.php;
etc.

If changes are made to the settings of Google maps and/or the number of pins, you must remember to change the notations of the individual pins in all the other languages available to visitors to your site.
If you fail to do this, previous event terms (default levels) will be seen and the newly added pins will have no notations.

The changes/additions in the following files are made as follows:
Open the file alltext.php in each installed language folder (English, French, and Spanish, etc) with a text editor or an HTML editor.
Find the entry
//For Google maps use - admin and public pages;
(around line 67 in an HTML editor).
Then add there instead of the existing codes the following code:

English
English/alltext.php

$admtext[placelevel] = "Place Level";
$admtext[level1] = "Birth";
$admtext[level2] = "Baptism";
$admtext[level3] = "Marriage";
$admtext[level4] = "Divorce";
$admtext[level5] = "Died";
$admtext[level6] = "Burial";
$admtext[level7] = "Residence";
$admtext[level8] = "Profession";
$admtext[level9] = "School";
$admtext[level10] = "Holiday";
$admtext[level11] = "Not Set";


French
French/alltext.php

$admtext[placelevel] = "La spécificité du lieu";
$admtext[level1] = "Naissance";
$admtext[level2] = "Baptême";
$admtext[level3] = "Mariage";
$admtext[level4] = "Divorce";
$admtext[level5] = "Décédé";
$admtext[level6] = "Enterrement";
$admtext[level7] = "Résidence";
$admtext[level8] = "Profession";
$admtext[level9] = "Ecole";
$admtext[level10] = "Vacances";
$admtext[level11] = "Est non réglé";


Spanish
Spanish/alltext.php

$admtext[placelevel] = "Lugar Nivel";
$admtext[level1] = "Nacimiento";
$admtext[level2] = "Bautismo";
$admtext[level3] = "Matrimonios";
$admtext[level4] = "Divorcios";
$admtext[level5] = "Murió";
$admtext[level6] = "Entierro";
$admtext[level7] = "Residencia";
$admtext[level8] = "Profesión";
$admtext[level9] = "Escuela";
$admtext[level10] = "Permiso";
$admtext[level11] = "No configurado";


For the other 14 languages which are available for TNG, you also have to make the necessary translations - if you wish to integrate them in your TNG application.
For translation into other languages you will need to resource the appropriate international dictionaries.



Note:
© Copyright by the author
Thanks to Roger Mitchell who assisted me with English grammar
when I translated this page from German to English


Klick: back to the page from which you came  back Klick: back to home home  further Klick: next page