Ensure not undefined for polylines and polygons also (#183)
Which is the case when parsing polylines/polygons URL parameter without weight.
This commit is contained in:
parent
64cc21a81f
commit
13407465f3
1 changed files with 3 additions and 1 deletions
|
|
@ -271,8 +271,8 @@ L.BRouter = L.Class.extend({
|
||||||
s += Math.round(circle.getRadius());
|
s += Math.round(circle.getRadius());
|
||||||
// -1 is default nogo exclusion, it should not be passed as a URL parameter.
|
// -1 is default nogo exclusion, it should not be passed as a URL parameter.
|
||||||
if (
|
if (
|
||||||
circle.options.nogoWeight !== null &&
|
|
||||||
circle.options.nogoWeight !== undefined &&
|
circle.options.nogoWeight !== undefined &&
|
||||||
|
circle.options.nogoWeight !== null &&
|
||||||
circle.options.nogoWeight !== -1
|
circle.options.nogoWeight !== -1
|
||||||
) {
|
) {
|
||||||
s += L.BRouter.NUMBER_SEPARATOR;
|
s += L.BRouter.NUMBER_SEPARATOR;
|
||||||
|
|
@ -324,6 +324,7 @@ L.BRouter = L.Class.extend({
|
||||||
}
|
}
|
||||||
// -1 is default nogo exclusion, it should not be passed as a URL parameter.
|
// -1 is default nogo exclusion, it should not be passed as a URL parameter.
|
||||||
if (
|
if (
|
||||||
|
polyline.options.nogoWeight !== undefined &&
|
||||||
polyline.options.nogoWeight !== null &&
|
polyline.options.nogoWeight !== null &&
|
||||||
polyline.options.nogoWeight !== -1
|
polyline.options.nogoWeight !== -1
|
||||||
) {
|
) {
|
||||||
|
|
@ -376,6 +377,7 @@ L.BRouter = L.Class.extend({
|
||||||
}
|
}
|
||||||
// -1 is default nogo exclusion, it should not be passed as a URL parameter.
|
// -1 is default nogo exclusion, it should not be passed as a URL parameter.
|
||||||
if (
|
if (
|
||||||
|
polygon.options.nogoWeight !== undefined &&
|
||||||
polygon.options.nogoWeight !== null &&
|
polygon.options.nogoWeight !== null &&
|
||||||
polygon.options.nogoWeight !== -1
|
polygon.options.nogoWeight !== -1
|
||||||
) {
|
) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue