// Initialisation function
function load() {
if ( !GBrowserIsCompatible() )
return;
// Create the map
var map = new GMap2(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.setCenter( new GLatLng( 53.989974, -1.100169 ), 15 );
// Create our "tiny" marker icon
var tinyIcon = new GIcon();
tinyIcon.image = "parking.gif";
tinyIcon.iconSize = new GSize(15, 15);
tinyIcon.iconAnchor = new GPoint(-3, 6);
tinyIcon.infoWindowAnchor = new GPoint(5, 1);
// Set up our GMarkerOptions object
markerOptions = { icon:tinyIcon };
var point = new GLatLng( 53.989974, -1.100169 );
var markerInfo = 'The Cooking Rooms
Workshops 7 & 8
York Eco Business Centre
Amy Johnson Way
Clifton Moor
York, YO30 4AG';
var marker = createMarker( point, markerInfo );
map.addOverlay( marker );
var point2 = new GLatLng( 53.989924, -1.099843 );
var markerInfo2 = 'The Cooking Rooms parking
Please park on the gravel area
opposite the entrace to the York
Eco Business Centre staff car park.';
var marker2 = createMarker( point2, markerInfo2, markerOptions );
map.addOverlay( marker2 );
}
// Creates a marker at the given point with the given info label
function createMarker( point, info, options, id ) {
var marker = new GMarker( point, options );
GEvent.addListener( marker, "click", function() {
marker.openInfoWindowHtml( info );
} );
return marker;
}