hitrust / google-ajax-examples

Automatically exported from code.google.com/p/google-ajax-examples
0 stars 1 forks source link

Geocoding via the Maps API geocoding example is broken #161

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Visit 
https://code.google.com/apis/ajax/playground/?exp=earth#geocoding_via_the_maps_a
pi
2. Click "Fly Here!" button

What is the expected output? What do you see instead?

The Geocoding example worked a some time ago and has since stopped working 
probably due to changes in the maps APIs.

What version of the product are you using? On what operating system?

Chrome Version 32.0.1700.107, FireFox 27.0

Please provide any additional information below.

FireFox reports "Error: Error calling method on NPObject!" in Browser console.

Original issue reported on code.google.com by gjmath...@gmail.com on 12 Feb 2014 at 9:21

GoogleCodeExporter commented 8 years ago
Needs to be rewritten using the new Google Maps V3 geocoding API.

function init() {
 ...
 geocoder = new google.maps.Geocoder();
}

function flyTo(geocodeLocation) {
 if (geocodeLocation.trim().length == 0) {
    alert("You must enter an address");
    return;
 }
 geocoder.geocode( { 'address': geocodeLocation}, function(results, status) {
    if (status == google.maps.GeocoderStatus.OK) {
        var location = results[0].geometry.location;
        var lookAt = ge.createLookAt('');
                ...
        }
 });
}

<form action="#" onsubmit="flyTo(this.address.value); return false">
     <p>
         <input type="text" size="60" name="address" value="1600 Amphitheatre Pky, Mountain View, CA" />
         <input type="submit" value="Fly Here!" />
     ...
</form>

Original comment by gjmath...@gmail.com on 14 Feb 2014 at 10:09