Google Maps AIP3 - Directions from current location with custom markers
===

I have been trying to rack my brain around this for ages....

I currently have a working map that gives me directions and can drop the default Google Markers and place a custom marker on the given coordinates, BUT, it won't let me changes the start and end markers no matter what I try and do.

**This is my current working code:**

        <script src="http://maps.google.se/maps/api/js?sensor=true"></script>
        <script>
        	(function () {
        		var directionsService = new google.maps.DirectionsService(),
        			directionsDisplay = new google.maps.DirectionsRenderer(),
        			createMap = function (start) {
        				var travel = {
        						origin : (start.coords)? new google.maps.LatLng(start.lat, start.lng) : start.address,
        						destination : "-31.432389,152.908482",
        						travelMode : google.maps.DirectionsTravelMode.DRIVING
        						
        					},
        					mapOptions = {
        						zoom: 10,
        						// Default view
        						center : new google.maps.LatLng(-31.432389,152.908482),
        						mapTypeId: google.maps.MapTypeId.ROADMAP
        					};
        
        				map = new google.maps.Map(document.getElementById("map"), mapOptions);
        				directionsDisplay.setMap(map);
        				directionsDisplay.setPanel(document.getElementById("map-directions"));
        				directionsService.route(travel, function(result, status) {
        					if (status === google.maps.DirectionsStatus.OK) {
        						directionsDisplay.setDirections(result);
        						directionsDisplay.suppressMarkers = true;
    
        					}
        				});
        			};
        			
        			
        			// Check for geolocation support	
        			if (navigator.geolocation) {
        				navigator.geolocation.getCurrentPosition(function (position) {
        						// Success!
        						createMap({
        							coords : true,
        							lat : position.coords.latitude,
        							lng : position.coords.longitude
        						});
        					}, 
        					function () {
        						// Gelocation fallback
        						createMap({
        							coords : false,
        							address : "-31.432389,152.908482"
        						});
        					}
        				);
        			}
        			else {
        				// No geolocation fallback
        				createMap({
        					coords : false,
        					address : "-31.432389,152.908482"
        				});
        			}
        	})();
        </script>

Any help would be greatly appreciated! Thanks.