I'm using GWT (version 2.7.0) and gwt-maps (version 3.10.0-alpha-7) in an effort to display a Google Map via GWT.
I tried following code for map implementation but not able to show map widget :-
Geolocation location = Geolocation.getIfSupported();
location.getCurrentPosition(new Callback<Position, PositionError>() {
@Override
public void onSuccess(Position result) {
try {
latitude = result.getCoordinates().getLatitude();
longitude = result.getCoordinates().getLongitude();
MapOptions options = MapOptions.newInstance();
options.setDraggable(true);
options.setMapTypeControl(true);
options.setScaleControl(true);
map = MapWidget.newInstance(MapImpl.newInstance(mapHPanel.getElement(), options));
map.setCenter(LatLng.newInstance(latitude, longitude));
map.setZoom(6);
map.setMapTypeId(MapTypeId.SATELLITE);
map.setSize("500PX", "500px");
} catch (Exception e) {
}
}
Which one would you guys suggest? Does somebody maybe had a similar problem and a solution for this? How can I get the Google Maps V3 API working in my GWT project?
Thank you very much guys for any help on this!