this.self = this;
}
@Override
protected Widget initialize(MapWidget map) {
final HandlerManager bus = this.eventBus;
final MapWidget m = map;
container = new VerticalPanel();
container.setStyleName("mapContextMenuContainer");
setMapView = new HTML("Set map view");
setMapView.setStyleName("mapContextMenuItem");
setMapView.addStyleName("contextDisabled");
setMapView.addMouseOverHandler(new MouseOverHandler() {
public void onMouseOver(MouseOverEvent event) {
setMapView.removeStyleName("contextDisabled");
}
});
setMapView.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
bus.fireEvent(new CacheRegionMapMetaDataEvent(m.getCenter(), m.getZoomLevel()));
m.removeControl(self);
}
});
setAsCurrentRegion = new HTML("Set as current region");