File: D:/HostingSpaces/SBogers10/komma.pro/resources/assets/js/site/mapsHandler.js
/**
* Google Maps API
* https://developers.google.com/maps/documentation/javascript/adding-a-google-map
*/
var MapsHandler = {
/**
*
*/
init : function()
{
// See if maps variable exists
if (typeof(google) == 'undefined' || typeof(google.maps) == 'undefined') {
// Load external script
$.getScript('https://maps.googleapis.com/maps/api/js?key=AIzaSyCVGPUmRmQRxXvzzWu3Xyu77XebQxQ-f4Y')
.done(function( script, textStatus ) {
MapsHandler.drawMap();
});
} else {
MapsHandler.drawMap()
}
},
drawMap : function()
{
// Define location
var location = {lat: 51.261828, lng: 5.598753};
// Create a map
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 11,
center: location,
disableDefaultUI: true
});
// Add a marker
var marker = new google.maps.Marker({
position: location,
map: map
});
}
};