Closed GoogleCodeExporter closed 9 years ago
Please give some more context (source code, Gwt version, gwt-maps version ,
java version, etc).
Does the Geocoder constructor crash if you run DevMode on the HelloMaps demo?
Just download the gwt-maps-1.2.0 distribution and cd to samples/HelloMaps and
run
ant devmode
Original comment by zundel@google.com
on 15 Dec 2010 at 4:45
This is code:
public class AskPopupPanel extends PopupPanel{
private Geocoder geoCoder;
public AskPopupPanel(Position t) {
addMaps(Position t);
}
private void addMaps(final Position t) {
// Open a map centered on Cawker City, KS USA
Maps.loadMapsApi("", "2.x", true, new Runnable() {
public void run() {
UserDetails.setMapsEnabled();
initializeMaps(t);
}
});
}
protected void initializeMaps(Position t) {
LatLng sfcisco = LatLng.newInstance(37.781298, -122.419624);
if(t != null)
sfcisco = LatLng.fromUrlValue(t.getLat().toString()+","+t.getLng().toString());
final MapWidget map = new MapWidget(sfcisco, 2);
map.setPixelSize(880, 400);
// Add some controls for the zoom level
// Add a marker
map.addOverlay(new Marker(sfcisco));
// Add some controls for the zoom level
map.addControl(new SmallMapControl());
map.setCenter(sfcisco, 15);
mapcontainer.add(map);
geoCoder = new Geocoder(); // This is where it is crashing
}
}
############################################
I have tried with GWT versions 2.0.3 and 2.0.4,
Gwt-Maps: 1.1.0
Java: 1.3.1_01
The application crashes in dev mode. I haven't tried HelloMaps yet, but I
followed simple instructions to invoke Geocoder.
Please let me know if I am doing anything wrong in the above code.
Thanks
Original comment by vikrant....@gmail.com
on 15 Dec 2010 at 6:25
[deleted comment]
[deleted comment]
Same problem with me. My code is:
final Geocoder geocoder = new Geocoder();
geocoder.getLatLng(question.getCity(), new LatLngCallback() {
@Override
public void onFailure() { //...
}
@Override
public void onSuccess(LatLng point) {
MapWidget map = new MapWidget(point, 5);
contentTable.setWidget(1, 0, map);
}
});
The code crashes, when the Geocoder is instanciated.
Tested it with GWT SDK 2.0.3 and GWT 2.1.1 in Firefox and Chrome. I have also
tried App Engine 1.3.4 1.4.0. My environment is Ubuntu Linux 10.0.4 with
java-6-sun-1.6.20. The maps-api version is 1.1.0.
Original comment by manuel.b...@gmail.com
on 30 Dec 2010 at 9:33
I resolved this issue by instantiating geocoder only after Maps have been
initialized. Try this and let us know if it works for you.
Original comment by vikrant....@gmail.com
on 30 Dec 2010 at 9:58
[deleted comment]
yes it worked =)
i did forget to add the maps-script-tag (including api key) in the html's
header.
thanks a lot!
Original comment by manuel.b...@gmail.com
on 31 Dec 2010 at 11:40
Original comment by zundel@google.com
on 28 Oct 2011 at 4:41
Original issue reported on code.google.com by
vikrant....@gmail.com
on 15 Dec 2010 at 4:02