County Outlines Mod

From TNG_Wiki
Jump to navigation Jump to search
Ambox notice.png This mod requires that you use the country name as the last item in your location name.

If you don't have country name as the last location, this mod will not work.

TNG 8.0

County Outlines Mod
Summary Displays an outline of counties or other large geopolitical features on location maps.
Validation Mod is XHTML compliant.Valid-xhtml10.png
once validation issues are fixed in TNG placesearch.php
Mod Updated {{{mod_last_update}}}
Download link for TNG V8
TNG Community Forums for TNG V7
Download stats {{{download_stats}}}
Author(s) Bret Rumsey
Steve Voght
Homepage Map Files
Mod Support TNG Community Forums]
Contact Developer
Latest Mod 8.1.0 for TNG V8
2.0 for TNG V7
Min TNG V 7.1.1
Max TNG V 8.1.0
Files modified
Related Mods
Only displays outlines on Location maps. Will not outline locations on Person or Cemetery maps.


The purpose of this modification is to

  • outline county areas in the Place Search Google Maps
  • show the outline and colored background for counties in the
    • States of the United States America (U.S.A.)
    • Provinces in Canada
    • any area for which you want to code an outline and specify the cfile.

Currently, this mod does not apply to the maps displayed for Individuals or Cemeteries.

This mod requires that you use the country name as the last item in your location name. If you don't have country name as the last location, this mod will not work.


The original US County Boundaries Mod, and outline files for all US counties, was authored by Bret Rumsey.

Enhancements and Mod Manager config file were authored by Steve Voght.


This mod creates an outline showing the shape of the county (or other geopolitical boundary) on location maps, improving the location's context over the default location pin. This serves to clarify that the location is not a precise point, but instead covers a larger area.


The current version of this modification only displays outlines on location maps (called via placesearch.php). It does not outline county-level features on Individual (getperson.php) maps.

This modification expects that you are not already using a folder named maps as a custom media folder for maps. If you are already using maps, it is recommended that you rename the maps folder for that media collection to something else e.g. histmaps) before installing this mod.

Known Issue

There is a known issued with the Edit function in Mod Manager when editing a variable in a mod that contains single-quotes and having Magic Quotes enabled, a second set of single-quotes is added to the variable. After editing the boundary outline and background colors, you might receive the following error

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/youraccount/public_html/folder/extensions/mapoutlinelib.php on line 14

You will then need to edit the mapoutlinelib.php file with Notepad++ or TextWrangler to removed the extra sets of single-quotes. See the TNG Community Forum - County Outline Mod v8.1.0 for additional information.

This problem does not appear to happen if you have Magic Quotes turn off.


  • This modification has been tested on TNG versions 7.1.1 through 8.1.2. It might work on other versions but has not been tested.
  • This modification requires that you have a valid Google Maps API Key for your TNG installation (if you see location maps, you have a key.)
  • This modification requires prior installation of current version of the TNG Mod Manager.
  • This modification requires the existence of an extensions subfolder on your TNG installation (this should have been created during installation of the TNG Mod Manager.)
  • This modification requires creation of a maps subfolder on your TNG installation (see note in 'Limitations' above.)
  • This modification assumes you follow location naming standards where the first item in the location name is the most precise detail, and the last item in the location name is the most broad detail (typically the country name.)


Automated Install

  1. If you have previously installed an earlier version of this mod, uninstall it now (see the section on Removal below)
  2. Download the appropriate version of the mod from the summary in the upper right corner
  3. Extract the .cfg file from within the ZIP file.
  4. Upload the .cfg to your TNG installation and put it into admin/mod_folder for TNG V7 and mods folder for TNG V8.
  5. Open the TNG Mod Manager from your TNG administration page and verify that the mod is ready for installation. Click 'Install' and follow the prompts. If you do not have an Install button, but rather have a Cleanup button, then that scenario must be resolved.
  6. If installation was successful (no errors reported), you're done!
  7. (optional:) Obtain pre-created map files and upload them to your maps folder (see below.)

See Installing Config Files using the Mod Manager for illustrated steps.


Automated Removal

  1. Open the TNG Mod Manager from your TNG administration page and verify that the mod is installed. Click 'Remove' and follow the prompts. Verify that removal was successful.

Manual Removal

  1. Upload fresh copies of placesearch.php, googlemaps/goooglemaplib.php and googlemaps/googlemaplib2.php to your TNG installation.
  2. Delete mapoutlinelib.php from your extensions folder, if that file exists.
  3. Open the TNG Mod Manager from your TNG administration page and verify that the mod is fully removed.
  4. Verify that any other installed mods remain 'OK' and do not require cleanup and re-installation. (This could occur if you have several mods that make changes to one of the above files, and is why it is recommend to use automated removal if possible.)


Map Outline files

The auto detect capability works for US and Canadian Counties for which you have provided boundary outline files in the maps subfolder.

You do not need to use all files provided in the US County ZIP file or any other provided zip file.

US County Boundaries

Bret Rumsey has created XML outlines for every county in the United States. These files are available at his site as a US county zip file. You no longer need to download the file or make the manual modifications described there.

You should then unzip this file into the maps subfolder of your TNG install directory.

Canadian County Boundaries

You can download XML outlines of the New Brunswick and Prince Edward Island county boundaries from this TNG Community Forum Entry.

You should then unzip the downloaded file into the maps subfolder of your TNG install directory.

Outlines of boundaries in other provinces are not yet available.

Historic UK Boundaries

Historic UK boundaries can be downloaded from Janice's site. See her post in the TNG Community Forum.

Other Outlines

You can create your own outline files that can be used with this mod by specifying the cfile: in the Place location Notes field. Outlines can be for any geographical feature of any size, in any country. Details about how to create these files and the acceptable file formats are available in the Creating Outline Files article.

Automatic Location Parsing

This modification attempts to automatically parse your location names in order to display an outline of the appropriate county.

Automatic parsing requires the following:

  • You must use commas to separate the parts of your location (this is standard practice.)
  • The location must be geocoded.
  • The location must be within a US state or Canadian province.
  • You must use the country name as the last item in your location name.
    • Specific country naming syntax does not matter. (e.g. 'USA', 'U.S.A.', 'United States', 'United States of America', etc are all acceptable.)
  • The second-to-last item in your location name must be the state or province.
    • The state or province can be typed out in full or abbreviated.
    • If abbreviated, you must use the official two-letter postal code abbreviation. (See here for US abbreviations, and here for Canadian abbreviations)
  • The third-to-last item in your location name must be the county/parish name.
    • You can suffix the name with the word 'County', 'Parish' or 'Division', the abbreviation 'Co.', or use no suffix at all. (e.g. 'Erie County, New York, USA', 'Erie Co., New York, USA' or 'Erie, New York, USA' are all acceptable.)
    • You can use or omit leading commas as you prefer. (e.g. ', Erie Co., New York, USA' and 'Erie Co., New York, USA' are both acceptable.)
    • Counties that start with the word 'Saint', 'St.' or 'St' can use either format.

By default, automatic outlining is limited to county-level locations (that is, locations where the county is the finest level of detail known.) To change this, click the 'Edit' button on the Mod Manager status screen after installing the mod (directly below the 'Remove' button for the mod.)

You can set the options as follows:

  • 0 = no automatic outlines (use cfile: for the location in the Place location notes instead)
  • 2 = county level (e.g. Erie Co., New York, USA) -- this option is the default
  • 3 = city level (e.g. Buffalo, Erie Co., New York, USA)
  • 4 = address level (e.g. 624 Main St., Buffalo, Erie Co., New York, USA)
  • 9 = all location levels outlined
  • If you upgrade or reinstall this mod, you will need to re-specify any customization to this option.

Note that in all cases only the county is outlined, regardless of the finest level of detail in the location.

See Editing Parameters in Mod Manager for illustrated steps.

Manual Location Parsing (the cfile method)

In addition to (or in place of) automatic location parsing, you can also manually specify the location of map files for any location in your database, including those that do not automatically parse.

To manually specify a map file location, you must enter the following code into your location notes:


Where <folder> is the first folder name within 'maps' (typically the state or country code), <subfolder> is the sub-folder (typically the type of division, such as 'counties'), and <filename> is the specific file name (in .XML, .KML or .KMZ format.)

For instance, to point to an XML outline file for Erie County, New York you would enter:


The folder and sub-folder names you use for custom maps can be anything you desire (and can include additional nested sub-folders.) For instance you might have a folder for the counties of Ireland with the format cfile:maps/ie/tyrone.xml.

After adding a cfile to location notes and saving, the outline will be automatically displayed if that location is edited again. If the cfile points to an invalid location or non-existent file, you will be alerted upon re-editing the location. At this time, there is no notification of error upon initially saving the file with a new cfile path.

Caution: When merging Places the cfile: in Notes of the From Place will not get merged into the Keep Place. This is the same behavior as the merging of latitudes and longitudes in Places, so you need to Keep the place that contains the cfile, just like the place the contains the longitude and latitude. You can always edit the place name later to reflect the name of the location you want to keep.

TNG User sites using this mod

Related Links