Added gb address format with housename field

This commit is contained in:
Christian Schwarz
2014-06-05 00:42:15 +02:00
parent 60f51d7c79
commit 5a51a6c8c2
4 changed files with 18 additions and 5 deletions
+7 -4
View File
@@ -1497,20 +1497,20 @@ input[type=number] {
/* Preset form address */
.addr-row .addr-column[type="text"] {
.addr-row .addr-column[type="text"] {
border-right: 0;
border-bottom: 0;
}
.addr-row:first-of-type .addr-column[type="text"] {
.addr-row:first-of-type .addr-column[type="text"] {
border-top: 0;
}
.addr-row .addr-column[type="text"]:first-of-type {
.addr-row .addr-column[type="text"]:first-of-type {
border-left: 0;
}
.addr-column[type="text"] {
.addr-column[type="text"] {
border-radius: 0;
}
@@ -1522,6 +1522,9 @@ input[type=number] {
border-radius: 0 0 4px 0;
}
.form-field .addr-housename {
}
.form-field .addr-number {
width: 33.3333%;
}
+4
View File
@@ -2,6 +2,10 @@
{
"format": [["number", "street"], ["city", "postcode"]]
},
{
"countryCodes": ["gb"],
"format": [["housename"], ["number", "street"], ["city", "postcode"]]
},
{
"countryCodes": ["at", "ch", "de"],
"format": [["street", "number"], ["postcode", "city"]]
+2
View File
@@ -1,6 +1,7 @@
{
"type": "address",
"keys": [
"addr:housename",
"addr:housenumber",
"addr:street",
"addr:city",
@@ -12,6 +13,7 @@
"label": "Address",
"strings": {
"placeholders": {
"housename": "Housename",
"number": "123",
"street": "Street",
"city": "City",
+5 -1
View File
@@ -1,5 +1,6 @@
iD.ui.preset.address = function(field, context) {
var event = d3.dispatch('init', 'change'),
housename,
housenumber,
street,
city,
@@ -92,7 +93,7 @@ iD.ui.preset.address = function(field, context) {
var wrap = selection.selectAll('.preset-input-wrap').data([0]),
center = entity.extent(context.graph()).center(),
countryCode,
country,
//country,
addressFormat;
/*
@@ -132,6 +133,7 @@ iD.ui.preset.address = function(field, context) {
// Update
housename = wrap.select('.addr-housename');
housenumber = wrap.select('.addr-number');
street = wrap.select('.addr-street');
city = wrap.select('.addr-city');
@@ -165,6 +167,7 @@ iD.ui.preset.address = function(field, context) {
function change() {
event.change({
'addr:housename': housename.value() || undefined,
'addr:housenumber': housenumber.value() || undefined,
'addr:street': street.value() || undefined,
'addr:city': city.value() || undefined,
@@ -180,6 +183,7 @@ iD.ui.preset.address = function(field, context) {
address.tags = function(tags) {
event.on('init', function () {
housename.value(tags['addr:housename'] || '');
housenumber.value(tags['addr:housenumber'] || '');
street.value(tags['addr:street'] || '');
city.value(tags['addr:city'] || '');