Zn2O / gwt-google-apis

Automatically exported from code.google.com/p/gwt-google-apis
0 stars 0 forks source link

AJAX Search: LocalSearch.setCenterPoint() can't use LatLng as argument #162

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Found in Release:
r705

Detailed description:
From burdon:
(Needs more functionality around LocalSearch.setCenterPoint())

> setCenterPoint(String address)
This is just a documentation issue.  The current setCenterPoint(String)
method will geocode an address (the string is just passed through to the
JavaScript API.  The documentation needs to be updated - it reads as if it
decodes a string version of a point, but I'm not sure that is the case.

> setCenterPoint(LatLng)
another possible variant is setCenterPoint(MapWidget);

Since we don't want to add a dependency on Maps, here's what I think we
should do.  Add a method
public native void setCenterPoint(double lat, double lng) /*-{
  setCenterPoint(new $wnd.GLatLng(lat,lng));
}
and then document that the Maps API must be loaded to use this variant.  
We could also dummy up a phony GLatLng object.  The docs give a hint on how
to do this (it detects an 'x' property)

Workaround if you have one:

Links to the relevant GWT Developer Forum posts:

Original issue reported on code.google.com by galgwt.reviews@gmail.com on 23 Aug 2008 at 10:46

GoogleCodeExporter commented 9 years ago
Here is another possibility, although I'm not sure how well this could be 
extended as a general solution.  If 
LatLng was an overlay type (extends JavaScriptObject) and we allowed our 
MapWidget to expose its GMap2 
instance, then we could expose a <T extends JavaScriptObject> void 
setCenterPoint(T center) overload and not 
have Map types in the mix explicitly.  

Original comment by mmendez+personal@google.com on 25 Aug 2008 at 1:51

GoogleCodeExporter commented 9 years ago
Added a method that takes a JavaScriptObject.  Now the Maps LatLng type is a JSO
subclass, so you can pass a LatLng created in the Maps API directly to this 
method.

/**
   * 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);

Original comment by galgwt.reviews@gmail.com on 7 Oct 2008 at 7:35

GoogleCodeExporter commented 9 years ago

Original comment by galgwt.reviews@gmail.com on 6 Nov 2008 at 6:36

GoogleCodeExporter commented 9 years ago

Original comment by zundel@google.com on 21 Dec 2009 at 1:57