So I'm using the Google Maps API and currently I have a custom marker that highlights the location. What I would like to do, if possible, is be able to click it and have it bring up the google maps directions dialog (e.g THIS) that you get when clicking on a place name normally on google maps. At the minute I've just set it to zoom in on the marker, but obviously I'll just get rid of that function if I can get this to work.
Thanks in advance for any help.
Here is my code:
<script type=text/javascript src=http://maps.google.com/maps/api/js?sensor=false></script>
<script type=text/javascript>
function initialize() {
var location = new google.maps.LatLng(50.871622, -4.131561);
var mapOptions = {
center: location,
zoom: 11,
scrollwheel: false
};
var map = new google.maps.Map(document.getElementById(map),
mapOptions);
var image = {
url: 'img/mapmarker.png',
};
var marker = new google.maps.Marker({
position: location,
map: map,
animation: google.maps.Animation.DROP,
icon: image,
title: 'Deer Park Dairy'
});
google.maps.event.addListener(marker, 'click', function() {
map.setZoom(15);
map.setCenter(marker.getPosition());
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>