Difference between revisions of "World Map Mod"

From TNG_Wiki
Jump to navigation Jump to search
Line 9: Line 9:
 
| mod_validation  =
 
| mod_validation  =
 
| download_link  =
 
| download_link  =
[[Media:world_map_mod_v10.0.0.0.b4.zip|world_map_mod_v10.0.0.0.b4.zip]] for {{Tv100}}<br />  
+
[[Media:world_map_mod_v10.0.0.0.b5.zip|world_map_mod_v10.0.0.0.b5.zip]] for {{Tv100}}<br />  
[[Media:world_map_menu_mod_v10.0.0.0.b4.zip|world_map_menu_mod_v10.0.0.0.b4.zip]] for {{Tv100}}<br />  
+
[[Media:world_map_menu_mod_v10.0.0.0.b5.zip|world_map_menu_mod_v10.0.0.0.b5.zip]] for {{Tv100}}<br />  
 
[[Media:world_map_mod_v9.2.2.0.zip|world_map_mod_v9.2.2.0.zip]] for {{Tv92}}<br />  
 
[[Media:world_map_mod_v9.2.2.0.zip|world_map_mod_v9.2.2.0.zip]] for {{Tv92}}<br />  
 
[[Media:world_map_menu_mod_v9.2.2.0.zip|world_map_menu_mod_v9.2.2.0.zip]] for {{Tv92}}<br />  
 
[[Media:world_map_menu_mod_v9.2.2.0.zip|world_map_menu_mod_v9.2.2.0.zip]] for {{Tv92}}<br />  

Revision as of 15:12, 12 March 2014

Caution WARNING!!! This is still a beta version of the software as it still needs more testing. Thanl you very much for the beta testers. Caution


World map mod
Summary Displays a world map containing places. Places may be filtered by several criteria (tree, year and type of event that happened at the place). Place markers that are close together are depicted as a single symbol. By clicking on this symbol, individual markers are shown.
Validation
Mod Updated {{{mod_last_update}}}
Download link world_map_mod_v10.0.0.0.b5.zip for
TNG 10.0


world_map_menu_mod_v10.0.0.0.b5.zip for

TNG 10.0


world_map_mod_v9.2.2.0.zip for

TNG 9.2


world_map_menu_mod_v9.2.2.0.zip for

TNG 9.2

Download stats {{{download_stats}}}
Author(s) Felipe Miralha da Silveira
Carlos A Heuser
Homepage World_map_mod (This page)
Mod Support {{{mod_support}}}
Contact Developer Contact form
Latest Mod 10.0.0.0.b4 for TNG v10.0.0
9.2.2.0 for TNG V9.2.2
Min TNG V 9.2.2
Max TNG V 10.0.0
Files modified
css/genstyle.css

languages/English/cust_text.php
languages/English-UTF8/cust_text.php
languages/French/cust_text.php
languages/French_UTF8/cust_text.php
languages/Dutch/cust_text.php
languages/Dutch_UTF8/cust_text.php
languages/Norwegian/cust_text.php
languages/Norwegian_UTF8/cust_text.php
languages/PortugueseBR/cust_text.php
languages/PortugueseBR_UTF8/cust_text.php
languages/German/cust_text.php
languages/German_UTF8/cust_text.php

genlib.php (changed by the companion Mod)
Related Mods
...
Notes
...


This mod actually consists of two mods: world_map_mod_vx.x.x, the main mod and world_map_menu_mod_vx.x.x, a small companion mod that just creates a menu entry (see details below).

Purpose

This mod displays places on a Google map. The idea is to allow a site to be browsed by visiting places and seeing the events that happened at these places.

Only geocoded places are displayed.

When the page created by the mod (events_map_index.php) is opened a world map showing all places contained in the TNG database is displayed.

The usual Google map markers depict places. If you point the mouse to a place marker, an info-box with the name of the place, its coordinates and the tree it belongs to is shown. If you click on the place marker, you will be taken to the TNG page that shows all events that happened at this place.

The rounded markers depict clusters of adjacent places. The number inside the cluster symbol informs how many places the cluster contains. If you click on the cluster symbol the mod will zoom into the area covered by the cluster. Depending on how the places are geographically distributed, place markers and cluster symbols will be displayed.

Overlaying the map there is a menu with several options. You may choose a specific tree. In this case the mod will display just places where events from this tree have happened. By selecting the menu entry with six hyphens (------) places for all trees are displayed.

The user may also define specific events (e.g. birth or dead) to be considered, by clicking on the event name.

Further, a specific date range in years may be specified. In this case, just events that fall in the selected date range are considered.

By clicking on the "Totals" button event and place counters are displayed.

Finally, the "Reset" button takes all options back to the default values.

Take a look at my site and play around with the mod.

Opening page.jpg

Max database size

All geocoded places that appear in your database and all events that happen at these places are brought to the browser when the map is opened. For large databases this make take a long time or in the worst case, the page may not open at all.

One option for large databases is to disable event handling (see Mod configuration below). However, if your database contains a large number of places (e.g. more than 5,000 places) the Mod will probably not usable for your installation.

Mod installation

Please notice that there are two versions of the mod, one intended for TNGv9 installs and the other for TNGv10 installs. The mod is installed as usual with the Mod Manager:

  • If you are using an older version of the Mod, uninstall it first, and remove the Mod files from the TNG mods folder.
  • Download the zip file containing the Mod files for your version of TNG and unzip it in the TNG mods folder.
  • Install the Mod with the Manager.
  • Before accessing the Mod page, clear caches.

If you wish to have a Find menu entry pointing to the map, install also the companion mod (world_map_menu_mod). See details in the next session.

Integrating the Mod into your site

In order to access the map you must link pages in your site to the file events_map_index.php. A good place to include a link to this page is your opening page. This must be done manually, as the opening page layout depends on the TNG template you are using.

Another good place for a link to the map is the 'Search' menu that appears at the top of TNG pages. If you wish to create such a menu entry, you may use the companion mod (world_map_menu_mod). The companion mod is installed as usual with the Mod Manager.

Mod configuration

The file 'eventsMap_config.php' contains several values that define how events are handled, how the menus are constructed, and how the map is displayed at the beginning. By changing these values, you may control the options below (be sure to save a backup of the original version). This file may be changed even after the mod was installed.

Event handling

The most relevant setting regards event handling. Event handling is controlled by the following option:

const cEventHandling = 1;

The default value for this option is 1. This means that the map displays only places where at at least an event has happened. It means further that the menu with the event filters is displayed. This is the most complete version of the mod and is probably the best option for smaller trees.

However, in TNG installs with very large trees this option could lead to unacceptable performance. The way the mod is implemented, each time it is called, a vector with all events in the database is sent to the browser. For example, if the TNG database contains 100,000 people and each person has in average two events registered, a vector with 200,000 entries would be sent to the browser.

For such large databases event handling may be turned off by setting cEventHandling = 0. This means that the mod will not consider events and will display just the places contained in the TNG place table. In this case the map menu contents will depend of how your TNG site is configured, more specifically if places are associated or not to trees. This is controlled by the TNG option Setup >> Configuration >> General Settings >> Miscellaneous >> 'Assign Place records to Trees'.

If places are not assigned to trees, no map menu will be displayed (there are no options to choose from) and all places in the database will be displayed.

On the other side, if places are assigned to trees, a simplified version of the map menu will be displayed. This simplified menu contains a single entry that allows to filter places by the tree they are assigned to.

Map menu options

The remaining values in the eventsMap_config.php file control the options described below.

Year ranges

The year ranges that appear in the menu are controlled by the following values:

const cFromDataMenu = 1300;
const cToDataMenu = 2020;
const cIncrementDataMenu = 60;

The first two values define the lower and the upper bounds for the date range. In the example above, you may select years between 1300 and 2020.

The third value defines the increment that is added to the lower value when creating the menu entries. The values shown above mean that the menu will contain the years 1300, 1360, 1420,..., 2020 as year range boundaries.

To define these value for your database, you may use the earliest birth year that is shown by TNG in the statistics page. For the increment, choose a value that results in 10-15 values between the lower and upper bounds of the year range.

Default tree

The value

const cDefaultTree = "------";

defines which tree will be displayed at the beginning. The value shown above (a string with six hyphens) means that all trees are displayed. If you prefer to begin with a specific tree, enter the ID of the tree (not the name of the tree) in the string.

Default map options

The options below control how the map will be displayed first. The values

const mapLatInit = 10;
const mapLngInit = 30;

define the coordinates (latitude, longitude) of the center of the map at the beginning. The values above where used in the map that illustrates this page and are good for a site that covers Europe and America.

The zoom level at the beginning is controlled by the following value:

const mapZoomInit = 2;

Translations

The Mod already contains translations to Dutch, French, German, Norwegian and Brazilian Portuguese. If you need translation to other languages just change the cfg file accordingly. The French and Dutch translations where made by Henny Savenije. Norwegian translation due to Jan-Thore Solem.

Developers

Mod developer is Felipe Miralha da Silveira, with changes/extensions by Carlos Heuser. Several errors in the first version where found and corrected by Ken Roy and Roger Moffat.


Files changed

  • languages/English/cust_text.php
  • languages/English-UTF8/cust_text.php
  • languages/French/cust_text.php
  • languages/French_UTF8/cust_text.php
  • languages/Dutch/cust_text.php
  • languages/Dutch_UTF8/cust_text.php
  • languages/Norwegian/cust_text.php
  • languages/Norwegian_UTF8/cust_text.php
  • languages/PortugueseBR/cust_text.php
  • languages/PortugueseBR_UTF8/cust_text.php
  • languages/German/cust_text.php
  • languages/German_UTF8/cust_text.php
  • css/genstyle.css
  • genlib.php (changed by the companion Mod)

Files added

  • events_map_index.php
  • eventsmap.php
  • eventsMap_config.php
  • eventsMap_queryBuilder.php
  • eventsMap_queryTrees.php
  • js/eventsMap_CustomControllers.js
  • js/eventsMap_markerclusterer_compiled.js
  • img/eventsMap_checkmarkFalse.png
  • img/eventsMap_checkmarkTrue.png
  • img/eventsMap_down.gif
  • img/eventsMap_tng_cal_bapt.png
  • img/eventsMap_tng_cal_birth.png
  • img/eventsMap_tng_cal_burial.png
  • img/eventsMap_tng_cal_death.png
  • img/eventsMap_tng_cal_marr.png
  • img/eventsMap_up.gif:img/eventsMap_up.gif


Revision History

Version Date Contents
v10.0.0.0.b4 24 February 2014 Release of version beta4:
  • ampersand and apostrophe symbols in place names are correctly handled,
  • added Norwegian translation
  • the page created by the mod is now being validated correctly
  • works with TNG installs that are not at Web server root
v10.0.0.0.beta2 14 February 2014 Fixed the following problems:
  • for some sites, there was a PHP error and an empty page was being shown,
  • for some sites, the mod page was being displayed but the map was not (just a gray box was being displayed)
v10.0.0.0 13 January 2014 Mod realease vor TNGv10
v9.2.2.0 13 January 2014 Mod realease vor TNGv9

Sites using this mod

If you download and install this mod, please add your TNG site to the table below.

URL User Note Mod-Version/TNG-Version User-language
http://heuser.pro.br/ Carlos Heuser Developers site v9.2.2.0 English, German, Brazilian Portuguese
http://lisaandroger.com/genealogy/ Roger Moffat v10.0.0 English