I have 4 fields and one map on my form. I have to choose Start Location and End location. The start latitude, start longitude, end latitude and end longitude are the four fields. What I have to do is, to choose the start and end locations by clicking on the map. Can anybody suggest me how I should go about doing this?
Thanks,
Saurabh
Use this code to get lat long .
function onload() { var map= new google.maps.Map(document.getElementById('map'), { center: new google.maps.LatLng(37.4419, -122.1419), zoom: 14, mapTypeId: google.maps.MapTypeId.ROADMAP, disableDefaultUI: true }); google.maps.event.addListener(map, 'click', function(event){ map.setCenter(event.latLng,14); var marker=new GMarker(event.latLng); mapadd.push(marker); map.addOverlay(marker); map.setCenter(event.latLng,12); var lat =event.latLng.lat(); var lng= event.latLng.lng(); }then u can use these lat and lng varible to get ur locationa and can get directions