World Map Mod

From TNG_Wiki
Revision as of 15:52, 13 February 2014 by Carheu (talk | contribs) (Created page with "{{Languages}} {{TNGmod | mod_name = World map mod | mod_summary = Displays a world map containing places. Places may be filtered by several criteria (tree, year and ty...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
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.zip for
TNG 10.0


world_map_menu_mod_v10.0.0.0.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 Silveira
Homepage World_map_mod (This page)
Mod Support {{{mod_support}}}
Contact Developer Contact form
Latest Mod 10.0.0.0 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
languages/English/cust_text.php
languages/English-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
languages/English/admintext.php
languages/English-UTF8/admintext.php
languages/PortugueseBR/admintext.php
languages/PortugueseBR_UTF8/admintext.php
languages/German/admintext.php
languages/German_UTF8/admintext.php
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.

When the page created by the mod (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 selecte 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

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.

If you wish to have a Search 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 mod_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 this values in the file, 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 only places where events happened are displayed and that the menu with the event filters is displayed. This 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 brought 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 that are 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 menu map will be displayed. This menu allows selecting all places or just places assigned to a specific tree.

Map menu options

The remaining options 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 bound 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, 1430,...,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 years 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 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 German and Brazilian Portuguese. If you need translation to other languages just change the cfg file accordingly.

Developer

Mod developer is Felipe Silveira, with changes/extensions by Carlos Heuser.


Files changed

  • languages/English/cust_text.php
  • languages/English-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
  • languages/English/admintext.php
  • languages/English-UTF8/admintext.php
  • languages/PortugueseBR/admintext.php
  • languages/PortugueseBR_UTF8/admintext.php
  • languages/German/admintext.php
  • languages/German_UTF8/admintext.php

Files added

  • mod_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
  • css/eventsMapStyle.css:css/eventsMapStyle.css%

Revision History

Version Date Contents
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