mirror of
https://github.com/FoggedLens/iD.git
synced 2026-04-21 11:16:36 +02:00
Do not output invalid linestrings. Fixes #360
Though switching back to geo paths with fill this even more.
This commit is contained in:
+7
-2
@@ -12,8 +12,13 @@ iD.svg.Areas = function() {
|
||||
var lineStrings = {};
|
||||
|
||||
function lineString(entity) {
|
||||
return lineStrings[entity.id] || (lineStrings[entity.id] =
|
||||
'M' + _.pluck(entity.nodes, 'loc').map(iD.svg.RoundProjection(projection)).join('L'));
|
||||
if (lineStrings[entity.id] !== undefined) {
|
||||
return lineStrings[entity.id];
|
||||
}
|
||||
var nodes = _.pluck(entity.nodes, 'loc');
|
||||
if (nodes.length === 0) return (lineStrings[entity.id] = '');
|
||||
else return (lineStrings[entity.id] =
|
||||
'M' + nodes.map(iD.svg.RoundProjection(projection)).join('L'));
|
||||
}
|
||||
|
||||
function drawPaths(group, areas, filter, classes) {
|
||||
|
||||
+7
-2
@@ -22,8 +22,13 @@ iD.svg.Lines = function() {
|
||||
var lineStrings = {};
|
||||
|
||||
function lineString(entity) {
|
||||
return lineStrings[entity.id] || (lineStrings[entity.id] =
|
||||
'M' + _.pluck(entity.nodes, 'loc').map(iD.svg.RoundProjection(projection)).join('L'));
|
||||
if (lineStrings[entity.id] !== undefined) {
|
||||
return lineStrings[entity.id];
|
||||
}
|
||||
var nodes = _.pluck(entity.nodes, 'loc');
|
||||
if (nodes.length === 0) return (lineStrings[entity.id] = '');
|
||||
else return (lineStrings[entity.id] =
|
||||
'M' + nodes.map(iD.svg.RoundProjection(projection)).join('L'));
|
||||
}
|
||||
|
||||
function drawPaths(group, lines, filter, classes) {
|
||||
|
||||
Reference in New Issue
Block a user