Skip to content

Fix bbox not being set on routing result - #52

Merged
Janekdererste merged 1 commit into
masterfrom
#36-problem-identical-points
Apr 6, 2021
Merged

Janekdererste merged 1 commit into
masterfrom
#36-problem-identical-points

Conversation

@Janekdererste

Copy link
Copy Markdown
Collaborator

fixes #36

@Janekdererste Janekdererste added this to the 0.2 milestone Apr 6, 2021
@Janekdererste Janekdererste self-assigned this Apr 6, 2021

@karussell karussell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Janekdererste
Janekdererste merged commit 9af134d into master Apr 6, 2021
@Janekdererste
Janekdererste deleted the #36-problem-identical-points branch April 6, 2021 13:19
Comment thread src/App.tsx
return pathBbox
} else if (shouldUseInfoBbox) return infoBbox
return pathBbox
return pathBbox || [0, 0, 0, 0]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw: we use this BBox as the "invalid case" here and elsewhere, but strictly speaking this is a perfect valid bbox :)

Still should not make a problem as this bbox is unrealistically small and points to nowhere

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem here was that the path coming from the api doesn't have a bbox property for routes with the same start and end point. Mapbox can actually handle the bbox with no area.

The rest of the code relies on the bbox being at least present.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem here was that the path coming from the api doesn't have a bbox property for routes with the same start and end point.

Do you mean we include the bbox in the response of /route and do not include it when two coordinates are identical? Or do you mean with "api" our JS code?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, indeed. This is a bug I think.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karussell

Copy link
Copy Markdown
Member

The problem is now that it zooms very close to the route even if it is very small and once it is the same points it zooms out to world wide. Instead we should probably define a minimum bbox and additionally ensure that the markers are inside this bbox.

@karussell

Copy link
Copy Markdown
Member

#53

ZeroGxMax pushed a commit to minhhpkp/graphhopper-maps that referenced this pull request Nov 12, 2024
…blem-identical-points

Fix bbox not being set on routing result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

problem in fit bounds for identical points

2 participants