gwt 맵을 SmartGWT 앱에 통합하려고합니다. 하지만 어떤 이유로이 오류가 발생합니다. 누군가 그것을 해결하기 위해 나를 도울 수 있습니까? 이 링크를 나의 참조 http://forums.smartclient.com/showthread.php?t=3366으로 사용하고 있습니다.GWT 맵 실행 중 오류 - 맵 키가 누락되었거나 유효하지 않습니까?
오류가 발생했습니다. 캐치되지 않는 예외가 이스케이프되었습니다. java.lang.RuntimeException Maps API가로드되지 않았습니다. 호스트 HTML 또는 모듈 파일에 태그가 누락 되었습니까? 지도 키가 누락되었거나 유효하지 않습니까? 자세한 내용은 개발 콘솔 로그를 참조하십시오. 사용자 정의 uncaught 예외 처리를 위해 GWT.setUncaughtExceptionHandler (..)를 등록하십시오.
//This is added in my module file and i am using Maps v2 API 1.1.1
<inherits name='com.google.gwt.maps.GoogleMaps' />
HomeViewImpl homePanel = new HomeViewImpl();
addTab(homePanel, "Home", "Home");
=========================================== ===
public class HomeViewImpl extends VLayout
{
private MapWidget getMap()
{
/*MapWidget map = new MapWidget();
map.setSize("500px", "300px");
map.addControl(new LargeMapControl());
map.getInfoWindow().open(map.getCenter(), new InfoWindowContent(getMapInfoWindow()));
return map;*/
LatLng cawkerCity = LatLng.newInstance(-22.82, -47.26);
final MapWidget map = new MapWidget();
map.setScrollWheelZoomEnabled(true);
map.addControl(new LargeMapControl());
map.addOverlay(new Marker(cawkerCity));
map.getInfoWindow().open(map.getCenter(),
new InfoWindowContent("World's Largest Ball of Sisal Twine"));
return map;
}
public Canvas getViewPanel()
{
HLayout hLayout = new HLayout(5);
hLayout.addMember(new Label("Dummy Label in a Horizontal Layout"));
// Add the map to the HTML host page
hLayout.addMember(getMap());
return hLayout;
}
private Canvas getMapInfoWindow()
{
final TabSet topTabSet = new TabSet();
topTabSet.setTabBarPosition(Side.TOP);
topTabSet.setWidth(200);
topTabSet.setHeight(100);
Tab tTab1 = new Tab("Blue");
HTMLPane tab1Pane = new HTMLPane();
tab1Pane.setContents("Hello. This sample shows a google map widget taking part in a SmartGWT Layout");
tTab1.setPane(tab1Pane);
Tab tTab2 = new Tab("Green");
HTMLPane tab2Pane = new HTMLPane();
tab2Pane.setContents("Google Maps InfoWindow can display SmartGWT Widgets");
tTab2.setPane(tab2Pane);
topTabSet.addTab(tTab1);
topTabSet.addTab(tTab2);
return topTabSet;
}
@Override
public Widget asWidget()
{
return getViewPanel();
}
}
환호 Zolf는
귀하의 의견에 감사드립니다. 당신은 나에게 업데이트 된 GWT 맵 API에 대한 링크를 주시겠습니까? – ZAJ