Split ring in two to avoid routing issue
This commit is contained in:
parent
8ca602575c
commit
a2366a26bd
2 changed files with 14 additions and 1 deletions
|
|
@ -50,6 +50,8 @@ BR.Message = L.Class.extend({
|
|||
err = i18next.t('warning.invalid-route-to');
|
||||
} else if (err == 'from-position not mapped in existing datafile\n') {
|
||||
err = i18next.t('warning.invalid-route-from');
|
||||
} else if (err && err.startsWith('null description for: ')) {
|
||||
err = i18next.t('warning.no-route-found');
|
||||
}
|
||||
this._show(err, 'error');
|
||||
},
|
||||
|
|
|
|||
|
|
@ -173,6 +173,9 @@ BR.CircleGoArea = L.Control.extend({
|
|||
}
|
||||
inner.push(inner[0]);
|
||||
|
||||
/* hack: it seems there is a bug when using a single closed ring line,
|
||||
cf. https://github.com/nrenner/brouter-web/issues/349#issue-755514458
|
||||
so instead we use 2 half rings to ensure we properly close the area */
|
||||
return {
|
||||
type: 'FeatureCollection',
|
||||
features: [
|
||||
|
|
@ -181,7 +184,15 @@ BR.CircleGoArea = L.Control.extend({
|
|||
properties: {},
|
||||
geometry: {
|
||||
type: 'LineString',
|
||||
coordinates: inner
|
||||
coordinates: inner.slice(n / 2 - 1)
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'Feature',
|
||||
properties: {},
|
||||
geometry: {
|
||||
type: 'LineString',
|
||||
coordinates: inner.slice(0, n / 2 + 1)
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue