return d3.rebind(context, dispatch, 'on');
};
-iD.version = '1.3.6';
+iD.version = '1.3.7';
(function() {
var detected = {};
})();
iD.taginfo = function() {
var taginfo = {},
- endpoint = 'http://taginfo.openstreetmap.org/api/4/',
+ endpoint = 'https://taginfo.openstreetmap.org/api/4/',
tag_sorts = {
point: 'count_nodes',
vertex: 'count_nodes',
};
iD.wikipedia = function() {
var wiki = {},
- endpoint = 'http://en.wikipedia.org/w/api.php?';
+ endpoint = 'https://en.wikipedia.org/w/api.php?';
wiki.search = function(lang, query, callback) {
lang = lang || 'en';
graph = graph.remove(m);
});
- members.forEach(function(m) {
- var entity = graph.entity(m.id);
- relation = relation.mergeTags(entity.tags);
- graph = graph.replace(entity.update({ tags: {} }));
+ entities.closedWay.forEach(function(way) {
+ function isThisOuter(m) {
+ return m.id === way.id && m.role !== 'inner';
+ }
+ if (members.some(isThisOuter)) {
+ relation = relation.mergeTags(way.tags);
+ graph = graph.replace(way.update({ tags: {} }));
+ }
});
return graph.replace(relation.update({
if (entities.other.length > 0 ||
entities.closedWay.length + entities.multipolygon.length < 2)
return 'not_eligible';
+ if (!entities.multipolygon.every(function(r) { return r.isComplete(graph); }))
+ return 'incomplete_relation';
};
return action;
if (j === 'restriction' && m && p)
return t('operations.merge.restriction', {relation: context.presets().item('type/restriction').name()});
+ if (p === 'incomplete_relation' && j && m)
+ return t('operations.merge.incomplete_relation');
+
if (j && m && p)
return t('operations.merge.' + j);
toJSON: function() {
if (stack.length <= 1) return;
- var allEntities = {};
+ var allEntities = {},
+ baseEntities = {},
+ base = stack[0];
var s = stack.map(function(i) {
var modified = [], deleted = [];
} else {
deleted.push(id);
}
+
+ // make sure that the originals of changed or deleted entities get merged
+ // into the base of the stack after restoring the data from JSON.
+ if (id in base.graph.entities) {
+ baseEntities[id] = base.graph.entities[id];
+ }
});
var x = {};
});
return JSON.stringify({
- version: 2,
+ version: 3,
entities: _.values(allEntities),
+ baseEntities: _.values(baseEntities),
stack: s,
nextIDs: iD.Entity.id.next,
index: index
iD.Entity.id.next = h.nextIDs;
index = h.index;
- if (h.version === 2) {
+ if (h.version === 2 || h.version === 3) {
var allEntities = {};
h.entities.forEach(function(entity) {
allEntities[iD.Entity.key(entity)] = iD.Entity(entity);
});
+ if (h.version === 3) {
+ // this merges originals for changed entities into the base of
+ // the stack even if the current stack doesn't have them (for
+ // example when iD has been restarted in a different region)
+ var baseEntities = h.baseEntities.map(iD.Entity);
+ stack[0].graph.rebase(baseEntities, _.pluck(stack, 'graph'));
+ tree.rebase(baseEntities);
+ }
+
stack = h.stack.map(function(d) {
var entities = {}, entity;
var json = context.storage(getKey('saved_history'));
if (json) history.fromJSON(json);
-
- context.storage(getKey('saved_history', null));
},
_getKey: getKey
var bing = iD.BackgroundSource(data),
key = 'Arzdiw4nlOJzRwOz__qailc8NiR31Tt51dN2D7cm57NrnceZnCpgOkmJhNpGoppU', // Same as P2 and JOSM
- url = 'http://dev.virtualearth.net/REST/v1/Imagery/Metadata/Aerial?include=ImageryProviders&key=' +
+ url = 'https://dev.virtualearth.net/REST/v1/Imagery/Metadata/Aerial?include=ImageryProviders&key=' +
key + '&jsonp={callback}',
providers = [];
dispatch.change();
});
- var template = 'http://ecn.t{t}.tiles.virtualearth.net/tiles/a{u}.jpeg?g=587&mkt=en-gb&n=z',
+ var template = 'https://ecn.t{t}.tiles.virtualearth.net/tiles/a{u}.jpeg?g=587&mkt=en-gb&n=z',
subdomains = [0, 1, 2, 3];
bing.url = function(coord) {
};
iD.ui.preset.address = function(field, context) {
var event = d3.dispatch('change'),
- housename,
housenumber,
street,
city,
var enter = wrap.enter().append('div')
.attr('class', 'preset-input-wrap');
- enter.append('input')
- .property('type', 'text')
- .attr('placeholder', field.t('placeholders.housename'))
- .attr('class', 'addr-housename')
- .attr('id', 'preset-input-' + field.id);
-
enter.append('input')
.property('type', 'text')
.attr('placeholder', field.t('placeholders.number'))
// Update
- housename = wrap.select('.addr-housename');
housenumber = wrap.select('.addr-number');
street = wrap.select('.addr-street');
city = wrap.select('.addr-city');
function change() {
event.change({
- 'addr:housename': housename.value() || undefined,
'addr:housenumber': housenumber.value() || undefined,
'addr:street': street.value() || undefined,
'addr:city': city.value() || undefined,
};
address.tags = function(tags) {
- housename.value(tags['addr:housename'] || '');
housenumber.value(tags['addr:housenumber'] || '');
street.value(tags['addr:street'] || '');
city.value(tags['addr:city'] || '');
};
address.focus = function() {
- housename.node().focus();
+ housenumber.node().focus();
};
return d3.rebind(address, event, 'on');
"dentist's office"
],
"tags": {
- "amenity": "doctors"
+ "amenity": "dentist"
},
"icon": "hospital",
"fields": [
},
"name": "Apartments"
},
+ "building/barn": {
+ "icon": "building",
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "barn"
+ },
+ "name": "Barn"
+ },
+ "building/bunker": {
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "bunker"
+ },
+ "name": "Bunker",
+ "searchable": false
+ },
+ "building/cabin": {
+ "icon": "building",
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "cabin"
+ },
+ "name": "Cabin"
+ },
+ "building/cathedral": {
+ "icon": "place-of-worship",
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "cathedral"
+ },
+ "name": "Cathedral"
+ },
+ "building/chapel": {
+ "icon": "place-of-worship",
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "chapel"
+ },
+ "name": "Chapel"
+ },
+ "building/church": {
+ "icon": "place-of-worship",
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "church"
+ },
+ "name": "Church"
+ },
"building/commercial": {
"icon": "commercial",
"geometry": [
},
"name": "Commercial Building"
},
+ "building/construction": {
+ "icon": "building",
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "construction"
+ },
+ "name": "Building Under Construction"
+ },
+ "building/detached": {
+ "icon": "building",
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "detached"
+ },
+ "name": "Detached Home"
+ },
+ "building/dormitory": {
+ "icon": "building",
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "dormitory"
+ },
+ "name": "Dormitory"
+ },
"building/entrance": {
"icon": "entrance",
"geometry": [
"name": "Garage",
"icon": "warehouse"
},
+ "building/garages": {
+ "icon": "warehouse",
+ "fields": [
+ "capacity"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "garages"
+ },
+ "name": "Garages"
+ },
+ "building/greenhouse": {
+ "icon": "building",
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "greenhouse"
+ },
+ "name": "Greenhouse"
+ },
+ "building/hospital": {
+ "icon": "building",
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "hospital"
+ },
+ "name": "Hospital Building"
+ },
+ "building/hotel": {
+ "icon": "building",
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "hotel"
+ },
+ "name": "Hotel Building"
+ },
"building/house": {
"icon": "building",
"fields": [
},
"name": "Industrial Building"
},
+ "building/public": {
+ "icon": "building",
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "public"
+ },
+ "name": "Public Building"
+ },
"building/residential": {
"icon": "building",
"fields": [
},
"name": "Residential Building"
},
+ "building/retail": {
+ "icon": "building",
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "retail"
+ },
+ "name": "Retail Building"
+ },
+ "building/roof": {
+ "icon": "building",
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "roof"
+ },
+ "name": "Roof"
+ },
+ "building/school": {
+ "icon": "building",
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "school"
+ },
+ "name": "School Building"
+ },
+ "building/shed": {
+ "icon": "building",
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "shed"
+ },
+ "name": "Shed"
+ },
+ "building/stable": {
+ "icon": "building",
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "stable"
+ },
+ "name": "Stable"
+ },
+ "building/static_caravan": {
+ "icon": "building",
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "static_caravan"
+ },
+ "name": "Static Mobile Home"
+ },
+ "building/terrace": {
+ "icon": "building",
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "terrace"
+ },
+ "name": "Row Houses"
+ },
+ "building/train_station": {
+ "icon": "building",
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "train_station"
+ },
+ "name": "Train Station",
+ "searchable": false
+ },
+ "building/university": {
+ "icon": "building",
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "university"
+ },
+ "name": "University Building"
+ },
+ "building/warehouse": {
+ "icon": "building",
+ "fields": [
+ "address",
+ "levels"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "building": "warehouse"
+ },
+ "name": "Warehouse"
+ },
"craft/basket_maker": {
"name": "Basket Maker",
"geometry": [
},
"railway/station": {
"icon": "rail",
+ "fields": [
+ "building_area"
+ ],
"geometry": [
"point",
"vertex",
],
"name": "Liquor Store"
},
+ "shop/art": {
+ "icon": "art-gallery",
+ "fields": [
+ "address",
+ "building_area",
+ "opening_hours"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "terms": [
+ "art store",
+ "art gallery"
+ ],
+ "tags": {
+ "shop": "art"
+ },
+ "name": "Art Shop"
+ },
"shop/bakery": {
"icon": "bakery",
"fields": [
},
"name": "Bicycle Shop"
},
+ "shop/bookmaker": {
+ "icon": "shop",
+ "fields": [
+ "address",
+ "building_area",
+ "opening_hours"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "shop": "bookmaker"
+ },
+ "name": "Bookmaker"
+ },
"shop/books": {
"icon": "shop",
"fields": [
},
"name": "Locksmith"
},
+ "shop/lottery": {
+ "icon": "shop",
+ "fields": [
+ "address",
+ "building_area",
+ "opening_hours"
+ ],
+ "geometry": [
+ "point",
+ "vertex",
+ "area"
+ ],
+ "tags": {
+ "shop": "lottery"
+ },
+ "name": "Lottery Shop"
+ },
"shop/mall": {
"icon": "shop",
"fields": [
"address": {
"type": "address",
"keys": [
- "addr:housename",
"addr:housenumber",
"addr:street",
"addr:city",
"label": "Address",
"strings": {
"placeholders": {
- "housename": "Housename",
"number": "123",
"street": "Street",
"city": "City",
"annotation": "Merged {n} lines.",
"not_eligible": "These features can't be merged.",
"not_adjacent": "These lines can't be merged because they aren't connected.",
- "restriction": "These lines can't be merged because at least one is a member of a \"{relation}\" relation."
+ "restriction": "These lines can't be merged because at least one is a member of a \"{relation}\" relation.",
+ "incomplete_relation": "These features can't be merged because at least one hasn't been fully downloaded."
},
"move": {
"title": "Move",
"address": {
"label": "Address",
"placeholders": {
- "housename": "Housename",
"number": "123",
"street": "Street",
"city": "City",
"name": "Apartments",
"terms": ""
},
+ "building/barn": {
+ "name": "Barn",
+ "terms": ""
+ },
+ "building/bunker": {
+ "name": "Bunker",
+ "terms": ""
+ },
+ "building/cabin": {
+ "name": "Cabin",
+ "terms": ""
+ },
+ "building/cathedral": {
+ "name": "Cathedral",
+ "terms": ""
+ },
+ "building/chapel": {
+ "name": "Chapel",
+ "terms": ""
+ },
+ "building/church": {
+ "name": "Church",
+ "terms": ""
+ },
"building/commercial": {
"name": "Commercial Building",
"terms": ""
},
+ "building/construction": {
+ "name": "Building Under Construction",
+ "terms": ""
+ },
+ "building/detached": {
+ "name": "Detached Home",
+ "terms": ""
+ },
+ "building/dormitory": {
+ "name": "Dormitory",
+ "terms": ""
+ },
"building/entrance": {
"name": "Entrance",
"terms": ""
"name": "Garage",
"terms": ""
},
+ "building/garages": {
+ "name": "Garages",
+ "terms": ""
+ },
+ "building/greenhouse": {
+ "name": "Greenhouse",
+ "terms": ""
+ },
+ "building/hospital": {
+ "name": "Hospital Building",
+ "terms": ""
+ },
+ "building/hotel": {
+ "name": "Hotel Building",
+ "terms": ""
+ },
"building/house": {
"name": "House",
"terms": ""
"name": "Industrial Building",
"terms": ""
},
+ "building/public": {
+ "name": "Public Building",
+ "terms": ""
+ },
"building/residential": {
"name": "Residential Building",
"terms": ""
},
+ "building/retail": {
+ "name": "Retail Building",
+ "terms": ""
+ },
+ "building/roof": {
+ "name": "Roof",
+ "terms": ""
+ },
+ "building/school": {
+ "name": "School Building",
+ "terms": ""
+ },
+ "building/shed": {
+ "name": "Shed",
+ "terms": ""
+ },
+ "building/stable": {
+ "name": "Stable",
+ "terms": ""
+ },
+ "building/static_caravan": {
+ "name": "Static Mobile Home",
+ "terms": ""
+ },
+ "building/terrace": {
+ "name": "Row Houses",
+ "terms": ""
+ },
+ "building/train_station": {
+ "name": "Train Station",
+ "terms": ""
+ },
+ "building/university": {
+ "name": "University Building",
+ "terms": ""
+ },
+ "building/warehouse": {
+ "name": "Warehouse",
+ "terms": ""
+ },
"craft/basket_maker": {
"name": "Basket Maker",
"terms": "basket,basketry,basket maker,basket weaver"
"name": "Liquor Store",
"terms": "alcohol"
},
+ "shop/art": {
+ "name": "Art Shop",
+ "terms": "art store,art gallery"
+ },
"shop/bakery": {
"name": "Bakery",
"terms": ""
"name": "Bicycle Shop",
"terms": ""
},
+ "shop/bookmaker": {
+ "name": "Bookmaker",
+ "terms": ""
+ },
"shop/books": {
"name": "Bookstore",
"terms": ""
"name": "Locksmith",
"terms": "keys"
},
+ "shop/lottery": {
+ "name": "Lottery Shop",
+ "terms": ""
+ },
"shop/mall": {
"name": "Mall",
"terms": ""