use of org.activityinfo.client.widget.CoordinateFields in project activityinfo by bedatadriven.
the class LocationForm method addCoordFields.
private void addCoordFields() {
coordinateFields = new CoordinateFields();
coordinateFields.setToolTip(I18N.CONSTANTS.coordinateToolTip());
add(coordinateFields.getLatitudeField());
add(coordinateFields.getLongitudeField());
newLocationPresenter.addListener(NewLocationPresenter.POSITION_CHANGED, new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
if (!newLocationPresenter.isProvisional()) {
coordinateFields.setValue(newLocationPresenter.getLatLng());
}
}
});
coordinateFields.addChangeListener(new Listener<FieldEvent>() {
@Override
public void handleEvent(FieldEvent be) {
AiLatLng value = coordinateFields.getValue();
if (value != null) {
newLocationPresenter.setLatLng(value);
}
}
});
}
Aggregations