mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-14 21:28:11 +02:00
Added gb address format with housename field
This commit is contained in:
+7
-4
@@ -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%;
|
||||
}
|
||||
|
||||
@@ -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"]]
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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'] || '');
|
||||
|
||||
Reference in New Issue
Block a user