﻿
function LoadMapWithSingleMarker(mapId, lat, long, name) {
    try {
        //Marker 1 postion
        var marker1LatLng = new google.maps.LatLng(lat, long);

        //Set map option 
        var mapOptions = {
            zoom: 14,
            center: marker1LatLng,
            mapTypeId: google.maps.MapTypeId.ROADMAP, //Options: ROADMAP, SATELLITE, HYBRID, TERRAIN
            navigationControl: true,
            navigationControlOptions: {
                style: google.maps.NavigationControlStyle.DEFAULT //Options: DEFAULT, SMALL, ZOOM_PAN
            }
        };

        //Create map
        var map = new google.maps.Map(document.getElementById(mapId), mapOptions);

        //    var marker1InfoString =
        //	'<div id="content">' +
        //		'<h1 id="firstHeading" class="firstHeading">Title sample</h1>' +
        //		'<div id="bodyContent">' +
        //			'<p><b>Sample</b><br/>Here insert any description, it is just another html!</p>' +
        //			'<p>This is a link, <a href="http://www.diamondresorts.com">Go to DRI</a></p>' +
        //		'</div>' +
        //    '</div>';

        //    var marker1InfoWindow = new google.maps.InfoWindow({
        //        content: marker1InfoString,
        //        maxWidth: 100
        //    });

        //Add marker 1 to map
        var marker1 = new google.maps.Marker({
            position: marker1LatLng,
            map: map,
            title: name
        });

        //    //Add click event to show info
        //    google.maps.event.addListener(marker1, 'click', function () {
        //        marker1InfoWindow.open(map, marker1);
        //    });
    } catch (e) {
        //TODO: log exception
    }
}
