2012-03-05 7 views
-1

GWTマップv2 InfoWindowInfoWindowContentでした。 GWTマップv3 InfoWindowにはInfoWindowContentがありません。私はこのコードを発見したが、クリックハンドラが動作していません。GWTマップv3クリックハンドラがInfoWindowで動作しません

InfoWindow info = new InfoWindow(); 
VerticalPanel verticalPanel = new VerticalPanel(); 
Label addressLabel = new Label("Address: " + address); 
Label coordinatesLabel = new Label("Position: " + gLatLng.toUrlValue()); 
verticalPanel.add(addressLabel); 
verticalPanel.add(coordinatesLabel); 
HorizontalPanel horizontalPanel = new HorizontalPanel(); 
Button newAsociation = new Button("Add house"); 
Button deleteMarker = new Button("Delete"); 
newAsociation.addClickHandler(new ClickHandler() { 
@Override 
public void onClick(ClickEvent event) { 
    System.out.println("Add house");       
} 
}); 
horizontalPanel.add(newAsociation); 
horizontalPanel.add(deleteMarker); 
verticalPanel.add(horizontalPanel); 
info.setContent(verticalPanel.getElement().toString()); 
info.open(mapWidget.getMap(), marker); 

私はそれをどのように修正すればよいですか?

+0

どのgwtマップライブラリを使用していますか? –

答えて

0

gwt-google-apisのマップv3を使用している場合は、解答hereが見つかります。

関連する問題