Zn2O / gwt-google-apis

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

Implement the fromLatLngToContainerPixel method #174

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Found in Release:
r803?

Detailed description:
The GMap2.fromLatLngToContainerPixel method is new in the Google Maps API
2.100.  Please add this function to the GWT wrapper.

Workaround if you have one:
Just wrap it yourself, or use this code in a utility method:

public static Point convertLatLngToContainerPixel(LatLng ll, MapWidget map) {
    Point mapCenter = map.convertLatLngToDivPixel(map.getCenter());
    Point panePixel = map.convertLatLngToDivPixel(ll);

    Point containerPixel = Point.newInstance(panePixel.getX()
                - mapCenter.getX() + (map.getOffsetWidth() / 2), panePixel
                .getY()
                - mapCenter.getY() + (map.getOffsetHeight() / 2));

    return containerPixel;
}

Original issue reported on code.google.com by ebesse...@gmail.com on 20 Sep 2008 at 7:53

GoogleCodeExporter commented 9 years ago
I believe this has already been fixed in release r1142.
But the name of the method is 'convertLatLngToContainerPixel'.

Original comment by vitor.tc...@gmail.com on 20 Jan 2009 at 8:26

GoogleCodeExporter commented 9 years ago

Original comment by galgwt.reviews@gmail.com on 20 Jan 2009 at 11:09