Hey all!

Was wondering if you would be willing to help me out a bit.

How do I allow a user to input their address and use GDirections() to
draw the directions on the map to a specific point using ASP.NET
server controls?

I currently have an ASP.NET textbox and an ASP.NET button in my .aspx
page. The button is linked to the goDirections javascript function by
means of the OnClientClick attribute of the button. I have no idea why
it won't work.

Here is what I have so far:

var map;
var directionsPanel;
var directions;

// Initialize the map function
function initialize() {
    if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(42.920477, -88.009707), 13);
        map.addControl(new GLargeMapControl());

        // Create Marker for Ski Hill
        var hill = new GMarker(new GLatLng(42.920477, -88.009707));
        var markertext = '<span class="btitle">Crystal Ridge</span>' +
'<br />' +
                '<span>7900 W Crystal Ridge Dr</span>' + '<br />' + '<span
class="baddress">Frankin, WI 53132</span>';
        map.addOverlay(hill);
        hill.openInfoWindowHtml(markertext); // Crystal Ridge Text
Bubble

        //Add Directions Module
        directionsPanel = document.getElementById("directions");
        directions = new GDirections(map, directionsPanel);
    }
}

function goDirections() {
    var addresses;
    var fromAddress;

    fromAddress = document.getElementById("<%=addressinput.clientid
%>").value;
    addresses = 'from: ' + fromAddress + ' to: 7900 W Crystal Ridge
Dr, Franklin, WI';

    directions.load(addresses);
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Apps APIs" 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-apps-apis?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to