$(document).ready(function(){
    var _MapsTarget = $('#GoogleMaps').find('.Map');

    // bepaal of we hier de google maps moeten laden
    if(_MapsTarget.length)
    {
        var iLat    = $(document).data('Google-Maps-Latitude');
        var iLon    = $(document).data('Google-Maps-Longitude');
        var sTitle  = $(document).data('Google-Maps-Title');

        // bepaal ook of er coordinaten zijn om mee te werken
        if(iLat && iLon)
        {

            var myLatlng = new google.maps.LatLng( iLat, iLon);
            var myOptions = {
                // positie bepaling
                center: myLatlng,
                zoom: 8,
                mapTypeId: google.maps.MapTypeId.ROADMAP,

                // Ui control
                disableDefaultUI: true,
                navigationControl: true,
                navigationControlOptions: {
                    style: google.maps.NavigationControlStyle.ZOOM_PAN
                }
            };

            var map = new google.maps.Map( _MapsTarget.get(0), myOptions);

            var marker = new google.maps.Marker({
                position:   myLatlng,
                map:        map,
                title:      sTitle
            });
        }
    }
    
});

