mirror of
https://github.com/FoggedLens/iD.git
synced 2026-04-21 11:16:36 +02:00
Add ability to create a new relation (fixes #1576)
This commit is contained in:
@@ -25,6 +25,7 @@ en:
|
||||
annotation:
|
||||
point: Added a point.
|
||||
vertex: Added a node to a way.
|
||||
relation: Added a relation.
|
||||
start:
|
||||
annotation:
|
||||
line: Started a line.
|
||||
@@ -176,6 +177,7 @@ en:
|
||||
all_tags: All tags
|
||||
all_members: All members
|
||||
all_relations: All relations
|
||||
new_relation: New relation...
|
||||
role: Role
|
||||
choose: Select feature type
|
||||
results: "{n} results for {search}"
|
||||
|
||||
Vendored
+3
-1
@@ -30,7 +30,8 @@
|
||||
"add": {
|
||||
"annotation": {
|
||||
"point": "Added a point.",
|
||||
"vertex": "Added a node to a way."
|
||||
"vertex": "Added a node to a way.",
|
||||
"relation": "Added a relation."
|
||||
}
|
||||
},
|
||||
"start": {
|
||||
@@ -219,6 +220,7 @@
|
||||
"all_tags": "All tags",
|
||||
"all_members": "All members",
|
||||
"all_relations": "All relations",
|
||||
"new_relation": "New relation...",
|
||||
"role": "Role",
|
||||
"choose": "Select feature type",
|
||||
"results": "{n} results for {search}",
|
||||
|
||||
@@ -14,9 +14,22 @@ iD.ui.RawMembershipEditor = function(context) {
|
||||
|
||||
function addMembership(d, role) {
|
||||
showBlank = false;
|
||||
context.perform(
|
||||
iD.actions.AddMember(d.relation.id, {id: id, type: context.entity(id).type, role: role}),
|
||||
t('operations.add_member.annotation'))
|
||||
|
||||
if (d.relation) {
|
||||
context.perform(
|
||||
iD.actions.AddMember(d.relation.id, {id: id, type: context.entity(id).type, role: role}),
|
||||
t('operations.add_member.annotation'));
|
||||
|
||||
} else {
|
||||
var relation = iD.Relation();
|
||||
|
||||
context.perform(
|
||||
iD.actions.AddEntity(relation),
|
||||
iD.actions.AddMember(relation.id, {id: id, type: context.entity(id).type, role: role}),
|
||||
t('operations.add.annotation.relation'));
|
||||
|
||||
context.enter(iD.modes.Select(context, [relation.id]));
|
||||
}
|
||||
}
|
||||
|
||||
function deleteMembership(d) {
|
||||
@@ -26,7 +39,10 @@ iD.ui.RawMembershipEditor = function(context) {
|
||||
}
|
||||
|
||||
function relations(q) {
|
||||
var result = [],
|
||||
var result = [{
|
||||
relation: null,
|
||||
value: t('inspector.new_relation')
|
||||
}],
|
||||
graph = context.graph();
|
||||
|
||||
context.intersects(context.extent()).forEach(function(entity) {
|
||||
|
||||
Reference in New Issue
Block a user