com.google.maps.gwt.client.Geocoder Maven / Gradle / Ivy
/*
* Copyright 2011 The Google Web Toolkit Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.maps.gwt.client;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
/**
* A service for converting between an address and a
* LatLng
*
* .
*
* THIS SOURCE CODE IS GENERATED, DO NOT MODIFY
*/
public class Geocoder extends JavaScriptObject {
/**
* Callback type for handling asynchronous responses from geocode.
*/
public interface Callback {
/**
* Called by the callback handler
*/
void handle(JsArray a, GeocoderStatus b);
}
/**
* Creates a new instance of a
* Geocoder
*
* that sends geocode requests to Google servers.
*/
public static native Geocoder create()/*-{
return new $wnd.google.maps.Geocoder();
}-*/;
/**
* Protected constructor avoids default public constructor.
*/
protected Geocoder() {
/* Java constructor is protected, */
}
/**
* Geocode a request.
*/
public final native void geocode(GeocoderRequest request, Callback callback)/*-{
var _request;
if(@com.google.gwt.core.client.GWT::isScript()()) {
_request = request;
} else {
_request = {};
for(k in request) {
if(k != "__gwt_ObjectId") {
_request[k] = request[k];
}
}
}
var _callback = $entry(function(a, _b) {
var b = (_b == undefined) ?
null : @com.google.maps.gwt.client.GeocoderStatus::fromValue(Ljava/lang/String;)(_b);
[email protected]::handle(Lcom/google/gwt/core/client/JsArray;Lcom/google/maps/gwt/client/GeocoderStatus;)(a,b);
});
this.geocode(_request, _callback);
}-*/;
}