Introduce house number/ street for osm editing

This commit is contained in:
Victor Shcherb 2013-05-31 17:27:13 +02:00
parent 174b30ad3a
commit 0bfc9d448e
2 changed files with 17 additions and 3 deletions

View file

@ -75,8 +75,6 @@
</EditText>
</TableRow>
<!--
<TableRow>
<TextView
android:layout_width="wrap_content"
@ -108,7 +106,7 @@
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" >
</EditText>
</TableRow> -->
</TableRow>
<TableRow>
<TextView

View file

@ -66,6 +66,8 @@ public class EditingPOIActivity implements DialogProvider {
private EditText commentText;
private EditText websiteText;
private EditText phoneText;
private EditText streetNameText;
private EditText hnoText;
private CheckBox closeChange;
// private final static Log log = LogUtil.getLog(EditingPOIActivity.class);
@ -182,6 +184,10 @@ public class EditingPOIActivity implements DialogProvider {
nameText.setText(a.getName());
EditText openingHours = ((EditText)dlg.findViewById(R.id.OpeningHours));
openingHours.setText(a.getOpeningHours());
EditText streetName = ((EditText)dlg.findViewById(R.id.StreetName));
streetName.setText(n.getTag(OSMTagKey.ADDR_STREET));
EditText houseNumber = ((EditText)dlg.findViewById(R.id.HouseNumber));
houseNumber.setText(n.getTag(OSMTagKey.ADDR_HOUSE_NUMBER));
EditText phoneText = ((EditText)dlg.findViewById(R.id.Phone));
phoneText.setText(a.getPhone());
EditText websiteText = ((EditText)dlg.findViewById(R.id.Website));
@ -298,6 +304,8 @@ public class EditingPOIActivity implements DialogProvider {
typeText.setThreshold(1);
commentText = ((EditText)dlg.findViewById(R.id.Comment));
phoneText = ((EditText)dlg.findViewById(R.id.Phone));
hnoText = ((EditText)dlg.findViewById(R.id.HouseNumber));
streetNameText = ((EditText)dlg.findViewById(R.id.StreetName));
websiteText = ((EditText)dlg.findViewById(R.id.Website));
closeChange = ((CheckBox) dlg.findViewById(R.id.CloseChangeset));
@ -457,6 +465,14 @@ public class EditingPOIActivity implements DialogProvider {
if (phone.length() > 0 ){
n.putTag(OSMTagKey.PHONE.getValue(),phone);
}
String str = streetNameText.getText().toString();
if (str .length() > 0 ){
n.putTag(OSMTagKey.ADDR_STREET.getValue(),str);
}
String hno = hnoText.getText().toString();
if (hno .length() > 0 ){
n.putTag(OSMTagKey.ADDR_HOUSE_NUMBER.getValue(),hno);
}
commitNode(action, n, openstreetmapUtil.getEntityInfo(), commentText.getText().toString(), closeChange.isSelected(),
new Runnable() {
@Override