Google Places Autocomplete in ASP.NET
Any one have wrapper in ASP.NET for Google Places Autocomplete API? http://code.google.com/apis/maps/documentation/places/autocomplete.html
Samp开发者_运维百科les or approach is highly appreciated.
Thanks
Here is the link of demo... for google places autocomplete...
http://code.google.com/apis/maps/documentation/javascript/examples/places-autocomplete.html
right click in browser and view page source... you can find approach....how to do it....
related Document.. find from here...
http://code.google.com/p/geo-autocomplete/
In Google's API v3, they show an example that includes this snipped:
function fillInAddress() {
// Get the place details from the autocomplete object.
var place = autocomplete.getPlace();
for (var component in componentForm) {
document.getElementById(component).value = '';
document.getElementById(component).disabled = false;
}
// Get each component of the address from the place details
// and fill the corresponding field on the form.
for (var i = 0; i < place.address_components.length; i++) {
var addressType = place.address_components[i].types[0];
if (componentForm[addressType]) {
var val = place.address_components[i][componentForm[addressType]];
document.getElementById(addressType).value = val;
}
}
}
However, in ASP.NET one needs to use the format document.getElementById("<%= controlname.ClientID %>")
How to create the syntax in the fillInAddress() above to pass the 'component' object and create the correct syntax to make this work? Thanks
精彩评论