Giter VIP home page Giter VIP logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
One way to handle this is to declare field marked 'final' to make a copy of the
address string, then you can reference it from inside your LocationCallback
implementation.  In the example below, I did this twice, to reference an 
InfoWindow
object as well:

  private void displayWithGeocoder(InfoWindow w, String address) {

    final String addressCopy = address;
    final InfoWindow wCopy = w;

    Geocoder g = new Geocoder();
    g.getLocations(address, new LocationCallback() {
      public void onFailure(int statusCode) {
        GWT.log("Error: "+statusCode+" Failed to retrieve address: "+addressCopy, 
            null);
      }
      public void onSuccess(Placemark[] locations) {
        GWT.log("Got "+locations.length+" locations returned. Address is " +
addressCopy, 
            null);
        if (locations.length > 0) {
          wCopy.open(locations[0].getPoint(), 
              new InfoWindowContent("Found :" + locations[0].getAddress()));
        }
      }
    });

  }

Original comment by [email protected] on 14 Jan 2008 at 3:58

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

from gwt-google-apis.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
Now I am thinking we should change this callback model to use the handler/event
pattern that we're putting in to support GEvent.

Original comment by [email protected] on 5 Apr 2008 at 3:53

  • Added labels: API-Maps

from gwt-google-apis.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
If we do this, we will need to look at the following types which use a callback 
pattern:

DirectionsCallback, LatLngCallback, LocationCallback, GeoXMLLoadCallback

Original comment by [email protected] on 23 Jul 2008 at 2:40

from gwt-google-apis.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
The Maps v2 API is now deprecated.

Original comment by [email protected] on 28 May 2010 at 6:15

  • Changed state: NotPlanned

from gwt-google-apis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.