Hello Miguel, This patch adds an overload to LocalSearch.setCenterPoint() to accept a JavaScriptObject parameter. It can be either a raw GLatLng or GMap2 object, or it can be a LatLng object from the gwt-maps API (which is just a Java overlay type for GLatLng). I tested this manually by creating a small demo project.
M search/src/com/google/gwt/search/client/LocalSearch.java M search/src/com/google/gwt/search/client/impl/GlocalSearch.java -- Eric Z. Ayers - GWT Team - Atlanta, GA USA http://code.google.com/webtoolkit/ --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
Index: search/src/com/google/gwt/search/client/LocalSearch.java =================================================================== --- search/src/com/google/gwt/search/client/LocalSearch.java (revision 797) +++ search/src/com/google/gwt/search/client/LocalSearch.java (working copy) @@ -15,6 +15,7 @@ */ package com.google.gwt.search.client; +import com.google.gwt.core.client.JavaScriptObject; import com.google.gwt.search.client.impl.GlocalSearch; /** @@ -34,11 +35,11 @@ * suppose the searcher is centered in Santa Barbara, CA and the user is * searching for "Cava". With co-mingled results, the first search result is * actually an address match against "Cava Close, Aberdeen City, AB15 UK". The - * second result is "Cava Restaurant & Bar". Using this method, applications - * are able to disable and enable address lookup producing either strictly - * search results, or address lookup results co-mingled with search results. - * In this case, if address lookup is disabled, the first result would be - * "Cava Restaurant & Bar". + * second result is "Cava Restaurant & Bar". Using this method, + * applications are able to disable and enable address lookup producing either + * strictly search results, or address lookup results co-mingled with search + * results. In this case, if address lookup is disabled, the first result + * would be "Cava Restaurant & Bar". * * @param mode Supplies the desired address lookup mode. */ @@ -48,6 +49,18 @@ /** * This method establishes a center point that is used to scope search + * results. You can pass a GLatLng or GMap2 object created by the Google Maps API. + * If you are using the gwt-maps project, pass an instance of the LatLng class. + * + * @param point Supply either a GLatLng object or a GMap2 object from the + * Google Maps API. + */ + public void setCenterPoint(JavaScriptObject point) { + IMPL.setCenterPoint(this, point); + } + + /** + * This method establishes a center point that is used to scope search * results. * * @param point a string which specifies an address by name. When this Index: search/src/com/google/gwt/search/client/impl/GlocalSearch.java =================================================================== --- search/src/com/google/gwt/search/client/impl/GlocalSearch.java (revision 797) +++ search/src/com/google/gwt/search/client/impl/GlocalSearch.java (working copy) @@ -24,17 +24,15 @@ /** */ public interface GlocalSearch extends GSearch { - JSOpaque RESULT_CLASS = new JSOpaque("$wnd.GlocalSearch.RESULT_CLASS"); GlocalSearch IMPL = GWT.create(GlocalSearch.class); + JSOpaque RESULT_CLASS = new JSOpaque("$wnd.GlocalSearch.RESULT_CLASS"); @Constructor("$wnd.GlocalSearch") JavaScriptObject construct(); - // XXX Possible integration with Maps API. Consider code bloat before adding - // public void setCenterPoint(GMap point); - // public void setCenterPoint(GPoint point); + void setAddressLookupMode(Search jso, JSOpaque mode); - void setAddressLookupMode(Search jso, JSOpaque mode); - + void setCenterPoint(Search jso, JavaScriptObject point); + void setCenterPoint(Search jso, String point); }