﻿var points = new Array();
var markers = new Array();
var html = new Array();

function loadGoogleMap(lng, lat) {
    //alert('loading');
    geocoder = new google.maps.Geocoder();
    var latlng = new google.maps.LatLng(lng, lat);
    var myOptions = {
        zoom: 10,
        center: latlng,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    map = new google.maps.Map(document.getElementById("google_map"), myOptions);
}

var image = new google.maps.MarkerImage('http://www.latorregolfresort.com/kent_go_map/latorrelogo.png',
    new google.maps.Size(41, 25),
    new google.maps.Point(0, 0),
    new google.maps.Point(21, 25));
var shadow = new google.maps.MarkerImage('http://www.latorregolfresort.com/kent_go_map/google_shadow.png',
    new google.maps.Size(47, 13),
    new google.maps.Point(0, 0),
    new google.maps.Point(19, 13));
loadGoogleMap(37.822328, -1.004047);
var mapCenter = new google.maps.LatLng(37.822328, -1.004047);

var LatLngList = new Array();

LatLngList[0] = new google.maps.LatLng(37.822328, -1.004047);
points[0] = new google.maps.LatLng(37.822328, -1.004047);
markers[0] = new google.maps.Marker({
    position: points[0],
    icon: image,
    shadow: shadow,
    map: map
});
html[0] = "<div class=\"bubble\"><div class=\"map_title\"><h3><a href=\"http://www.latorregolfresort.com\">La Torre Golf Resort, Murcia, Spain</a></h3></div><div class=\"map_address\"><p><a href=\"/2-for-1-offers/?id=161\"><img src=\"/images/gmap_logo.gif\" /></a></p></div><div class=\"map_buttons\">";
html[0] += "";
html[0] += "<div class=\"clear\"></div></div></div>";

var infowindow = new google.maps.InfoWindow({ maxWidth: 300 });
google.maps.event.addListener(markers[0], "click", function() {
    //map.setZoom(11);
    infowindow.setContent(html[0]);
    infowindow.open(map, markers[0])
});

LatLngList[1] = new google.maps.LatLng(51.13665511377061, 0.8773183822631836);
points[1] = new google.maps.LatLng(51.13665511377061, 0.8773183822631836);
markers[1] = new google.maps.Marker({
    position: points[1],
    icon: image,
    shadow: shadow,
    map: map
});

google.maps.event.addListener(map, 'zoom_changed', function() {
    zoomChangeBoundsListener =
                        google.maps.event.addListener(map, 'bounds_changed', function(event) {
                            if (this.getZoom() > 10 && this.initialZoom == true) {
                                this.setZoom(10);
                                this.initialZoom = false;
                            }
                            google.maps.event.removeListener(zoomChangeBoundsListener);
                        });
});
map.initialZoom = true;
map.fitBounds(bounds);
				
					
