Example usage for com.google.gwt.maps.client.placeslib PlaceResult getName

List of usage examples for com.google.gwt.maps.client.placeslib PlaceResult getName

Introduction

In this page you can find the example usage for com.google.gwt.maps.client.placeslib PlaceResult getName.

Prototype

public final native String getName() ;

Source Link

Document

The Place's name.

Usage

From source file:com.google.gwt.maps.testing.client.maps.PlaceSearchMapWidget.java

License:Apache License

private void getPlaceDetails(String reference) {
    if (reference == null || reference.isEmpty()) {
        return;/*from   www . j  ava  2s  .  c  om*/
    }

    PlacesService placeService = PlacesService.newInstance(mapWidget);
    PlaceDetailsRequest request = PlaceDetailsRequest.newInstance();
    request.setReference(reference);

    placeService.getDetails(request, new PlaceDetailsHandler() {
        @Override
        public void onCallback(PlaceResult result, PlacesServiceStatus status) {
            if (status == PlacesServiceStatus.OK) {
                Window.alert("Found place details: name=" + result.getName());
            } else {
                String json = new JSONObject(result).toString();
                System.out.println("details=" + json);
                Window.alert("Status is: status=" + status + " ::: " + json);
            }
        }
    });
}