Example usage for com.google.gwt.maps.client.placeslib PlaceDetailsRequest newInstance

List of usage examples for com.google.gwt.maps.client.placeslib PlaceDetailsRequest newInstance

Introduction

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

Prototype

public static final PlaceDetailsRequest newInstance() 

Source Link

Document

A Place details query to be sent to the PlacesService.

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  ww  w .  ja  va2 s .  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);
            }
        }
    });
}