2012-03-05 39 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地圖庫? – 2012-03-06 22:35:54

回答

相關問題