function initMap() {
/* Define the center of the map, and the initial zoom level */
theMap = new google.maps.Map( document.getElementById('map'),
{center: {lat: 51.511, lng: -0.084}, zoom: 15 })
return theMap;
};
function MyVenues( Venue ){
// Returns array of Venue objects
var Venues = [];
/*
Add one line for each venue ( to create an array of Venue instances ) -
Title - The venue name as it will appear in the venues table
{lat,Lng} - Venue location (can be found by clicking its location on google maps )
TagName - TagName.html is the venue description, TagName_th.jpg a thumbnail image
Hours - String displayed in opening hours column of the venue table
Sample entry -
Venues[ix] = new Venue( ix, "Title " , {lat:51., lng:-0.1}, "TagName", "Hours" ); ix++;
*/ix = 0;
Venues[ix] = new Venue( ix, "The Tower of London",{lat:51.509378, lng:-0.077897}, "ToL", "10:00-18:00" ); ix++;
Venues[ix] = new Venue( ix, "The Bank of England",{lat:51.513705, lng:-0.088411}, "BoE", "11:55-12:05" ); ix++;
return Venues; }
The Venues.js file
Edit this file, to set the center of your map, and the initial zoom level (in the 'new google.maps.Map' call). To find the latitude and longitude of the centre, click on the point in Google maps; the coordinates are shown in a popup window.
Enter a description for each venue (in function MyVenues) as shown-
- Title (2nd parameter)
- is the identification to be entered in the Venues table
- Location
- lat & lng, may be found from Google Maps
- TagName
- is used to identify the description & image (thumbnail) files
- Hours
- Opening hours, displayed in the Venues table
Be sure to include the ix++; statement after each definition, to prevent subsequent redefinition of the same array element.
// JavaScript Document /* Heritage Open Day Maps - Example page Vn 2.0 10-Aug-2016 See http://www.chartridgescientific.com/CSCS/HODmap/Doc/index.html for documentation, and guide to preparing a webpage Edit this script to define your map position and your locations */ //