var GoogleMap = {
	_address : "",
	_canvasID : "",
	_notFoundMessage : "",
	Start : function(address, canvasID, notFoundMessage){
        this._address = address;
        this._canvasID = canvasID;
        this._notFoundMessage = notFoundMessage;
        var geocoder = new google.maps.Geocoder();
        geocoder.geocode({'address': address}, function(results, status) {
            if(status == google.maps.GeocoderStatus.OK) {
                GoogleMap._locationFound(results[0].geometry);
            } else {
                GoogleMap._locationNotFound();
            }
        });
	},
	_locationFound : function(geometry){
        var gmapOptions = {
          zoom: 7,
          center: geometry.location,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        var map = new google.maps.Map(document.getElementById(this._canvasID), gmapOptions); //Map genereren
        if(geometry.bounds)
        {
            map.fitBounds(geometry.bounds);
        } else {
            map.setZoom(14);
        }
        var geomarker = new google.maps.Marker({map: map, position: geometry.location}); //Pijltje
	},
	_locationNotFound : function(){
        document.getElementById(this._canvasID).innerHTML = this._notFoundMessage;
	}
}
