onModuleLoad().
*/
public class GpsEmulator implements EntryPoint, ClickMapHandler {
/**
* The default emulator hostname port
*/
static private final String DEFAULT_HOST = "localhost";
static private final int DEFAULT_PORT = 5554;
static private final String SUCCESS_STYLE = "success";
static private final String ERROR_STYLE = "error";
/**
* Create a remote service proxy to talk to the server-side Location service.
*/
private final LocationServiceAsync _service =
LocationServiceAsync.Util.getInstance();
/**
* The map and current marker shown
*/
private MapWidget _map;
private Marker _currentMarker = null;
/**
* The textboxes, button, and info label for configuring the host and port.
*/
private TextBox _hostname;
private TextBox _port;
private Button _button;
private Label _info;
/**
* This is the entry point method.
*/
public void onModuleLoad() {
GWT.setUncaughtExceptionHandler(
new GWT.UncaughtExceptionHandler() {
public void onUncaughtException(Throwable t) {
GWT.log("Client-side uncaught exception", t);
}
}
);
initializeUI();
loadMapApi();
}
/**
* Retrieve the Google Maps API key and load the API
*/
private void loadMapApi() {
// retrieve the Google Maps API Key and then initialize the UI
_service.getApiKey(new AsyncCallback