This has now been achieved: the three main display pages (ShowMapHeadingley.php, ShowMapTracks.php, and ShowMapPlaces.php) are using the same functions now, which are consolidated in GoogleMaps.js. This file has the specific functions relating to Google Maps. It also has a basic framework for initialising and showing map content, with the option of having external functions which are executed in the Main files. The automatic callback functions which are executed as <body> event handlers, are common to all three of the main files; this means now that new additional functionality can easily be implemented. It also enables a common interface (through GET with parameters in the URL) so that these files react in the same way.
Here is the current implementation of this common interface (version 0.1):
|w||map width in pixels; if not given, then the full browser width or the widht of the encapsulating element (table cell, iframe, ...) is taken as the width of the map.|
|h||map height in pixels; if not given, then the height of the screen is taken as the map height; this will result in a map that can be scrolled down to see the full extend.|
|p||point of interest; parameter consists of several parts, separatated by comma: latitude, longitude, text heading, URL for link under the text heading.|
|tr||GPS track; parameter consists of several parts, separatated by comma: filename, color of track, longitude, text heading for track.|