I'm new to the Google Maps API and am having trouble implementing directions.
I would like to be able to have the fields "directions to here" and "directions from here" much like can be seen on this page http://econym.org.uk/gmap/example_map1d.htm. As far as I can tell however, this page uses the v2 API and I'm currently using the v3 API. I don't want the directions appearing on the map itself but as in the example above, to load in a new page on the Google Maps site. Simultaneously, I would like users to be able to type in their start/ end address on my site. The link to my site is as follows http://thechinadispatch.squarespace.com/map/ and the code for my map is below. Any help would be much appreciated. Thanks. <div id="map" class="google-map"></div> <script type="text/javascript" src="http://maps.google.com/maps/api/js? sensor=false"></script> <script type="text/javascript"> function initialize() { var latlng = new google.maps.LatLng(47.266183925231, 9.19281005859375); var settings = { zoom: 9, center: latlng, mapTypeControl: false, mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}, navigationControl: true, navigationControlOptions: {style: google.maps.NavigationControlStyle.DEFAULT}, mapTypeId: google.maps.MapTypeId.HYBRID }; var map = new google.maps.Map(document.getElementById("map"), settings); var contentString = '<div id="content">'+ '<div id="siteNotice">'+ '</div>'+ '<h1 id="firstHeading" class="firstHeading">Seeger & Seeger</ h1>'+ '<div id="bodyContent">'+ '<p>Kirchstrasse 6<br/> FL-9494<br/> Liechtenstein<br/></p>'+ '</div>'+ '</div>'; var infowindow = new google.maps.InfoWindow({ content: contentString }); var companyLogo = new google.maps.MarkerImage('/storage/Google-Maps- Marker.png', new google.maps.Size(64,64), new google.maps.Point(0,0), new google.maps.Point(17,60) ); var companyShadow = new google.maps.MarkerImage('/storage/ marker-shadow.png', new google.maps.Size(46,57), new google.maps.Point(0,0), new google.maps.Point(18, 50) ); var companyPos = new google.maps.LatLng(47.166711, 9.51073); var companyMarker = new google.maps.Marker({ position: companyPos, map: map, icon: companyLogo, title:"Seeger und Seeger Treuunternehmen", }); infowindow.open(map,companyMarker); google.maps.event.addListener(companyMarker, 'click', function() { infowindow.open(map,companyMarker); }); } YAHOO.util.Event.onDOMReady(function() { initialize(); }); </script>
-- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
