• Welcome to Theos PowerBasic Museum 2017.

News:

Attachments are only available to registered users.
Please register using your full, real name.

Main Menu

Google Maps Address Auto Complete Inside Browser control

Started by Douglas Martin, October 09, 2013, 03:16:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Douglas Martin

My PB win app launches a browser control that I have used to  successfully display google maps with directions, etc. I am now trying to implement an Address Auto Complete feature.

The following HTML works fine when I open it in IE, firefox, Chrome, etc. If I open it using my PB app and the browser control I get the input box and can type an address but the dropdown list of potential matches never shows up.

Might have something to do with the google.maps.event.addDomListener(window, 'load', initialize);

Anyone have any suggestions for how to get this to work?

<!DOCTYPE html>
<html>
<head>
<title>Google Maps JavaScript API v3 Example: Places Autocomplete</title>
<script src="https://maps.googleapis.com/maps/api/js?sensor=false&libraries=places"></script>
<script type="text/javascript">
function initialize() {
var input = document.getElementById('searchTextField');
var options = {componentRestrictions: {country: 'us'}};

new google.maps.places.Autocomplete(input, options);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head> body>
<label for="searchTextField">Please insert an address:</label>
<input id="searchTextField" type="text" size="50">
</body>
Doug