-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some work on the geocoder, but doesn't work yet.
- Loading branch information
lhoriman
committed
Jan 25, 2010
1 parent
4d23f47
commit d3ae361
Showing
7 changed files
with
129 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,25 +30,22 @@ public class Geocoder extends JavaScriptObject { | |
* @return An instance of Geocoder. | ||
*/ | ||
public static native Geocoder newInstance() /*-{ | ||
return new $wnd.Geocoder(); | ||
return new $wnd.google.maps.Geocoder(); | ||
}-*/; | ||
|
||
protected Geocoder() { } | ||
|
||
/** | ||
* Geocode a request. | ||
* | ||
* @param request | ||
* @param callback | ||
* | ||
* TODO: Replace type Runnable with implementation of function(Array<GeocoderResponse>. | ||
* TODO: Missing comments for parameter callback. | ||
* TODO: Missing comments for parameter request. | ||
* @param request defines the request that will be made | ||
* @param callback will be called with whatever the geocoder returns | ||
*/ | ||
public final native void geocode(GeocoderRequest request, Runnable callback) /*-{ | ||
public final native void geocode(GeocoderRequest request, GeocoderCallback callback) /*-{ | ||
this.geocode( | ||
request, | ||
callback | ||
request, function(results, status) { | ||
[email protected]::callback([Lcom/googlecode/maps3/client/auto/GeocoderResponse;Lcom/googlecode/maps3/client/auto/GeocoderStatus;)(results, status); | ||
} | ||
); | ||
}-*/; | ||
|
||
|
29 changes: 29 additions & 0 deletions
29
src/com/googlecode/maps3/client/auto/GeocoderCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright 2009 Google Inc. | ||
* | ||
* 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.googlecode.maps3.client.auto; | ||
|
||
/** | ||
* Interface called by the geocoder when results arrive. | ||
* @author Jeff Schnitzer <[email protected]> | ||
*/ | ||
public interface GeocoderCallback { | ||
|
||
/** | ||
* Result of the query is now available | ||
*/ | ||
public void callback(GeocoderResponse[] responses, GeocoderStatus status); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters