com.google.maps.gwt.client.ElevationService 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;
/**
* Defines a service class that talks directly to Google servers for
* requesting elevation data.
*
* THIS SOURCE CODE IS GENERATED, DO NOT MODIFY
*/
public class ElevationService extends JavaScriptObject {
/**
* Callback type for handling asynchronous responses from getElevationForLocations.
*/
public interface Callback {
/**
* Called by the callback handler
*/
void handle(JsArray a, ElevationStatus b);
}
/**
* Callback type for handling asynchronous responses from getElevationAlongPath.
*/
public interface GetElevationAlongPathCallback {
/**
* Called by the callback handler
*/
void handle(JsArray a, ElevationStatus b);
}
/**
* Creates a new instance of a
* ElevationService
*
* that sends elevation queries to Google servers.
*/
public static native ElevationService create()/*-{
return new $wnd.google.maps.ElevationService();
}-*/;
/**
* Protected constructor avoids default public constructor.
*/
protected ElevationService() {
/* Java constructor is protected, */
}
/**
* Makes an elevation request along a path, where the elevation data are
* returned as distance-based samples along that path.
*/
public final native void getElevationAlongPath(PathElevationRequest request, GetElevationAlongPathCallback 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.ElevationStatus::fromValue(Ljava/lang/String;)(_b);
callback.@com.google.maps.gwt.client.ElevationService.GetElevationAlongPathCallback::handle(Lcom/google/gwt/core/client/JsArray;Lcom/google/maps/gwt/client/ElevationStatus;)(a,b);
});
this.getElevationAlongPath(_request, _callback);
}-*/;
/**
* Makes an elevation request for a list of discrete locations.
*/
public final native void getElevationForLocations(LocationElevationRequest 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.ElevationStatus::fromValue(Ljava/lang/String;)(_b);
[email protected]::handle(Lcom/google/gwt/core/client/JsArray;Lcom/google/maps/gwt/client/ElevationStatus;)(a,b);
});
this.getElevationForLocations(_request, _callback);
}-*/;
}