Skip to content

avoid initial fitBounds - #71

Closed
karussell wants to merge 2 commits into
masterfrom
avoid_inital_load
Closed

karussell wants to merge 2 commits into
masterfrom
avoid_inital_load

Conversation

@karussell

@karussell karussell commented Apr 25, 2021 •

Copy link
Copy Markdown
Member

this avoids the jump on load. the jump, when two points are specified, still exists.

TODO: zoom a bit into the world (if world boundary) to avoid seeing some continents twice.

related to #53

@easbar

easbar commented May 20, 2021

Copy link
Copy Markdown
Member

Closing here in favor of #77. The initial jump when points are specified remains even in #77. I opened #82 for this.

Comment thread src/map/Mapbox.ts
'pk.eyJ1IjoiamFuZWtkZXJlcnN0ZSIsImEiOiJjajd1ZDB6a3A0dnYwMnFtamx6eWJzYW16In0.9vY7vIQAoOuPj7rg1A_pfw',
accessToken: 'pk.eyJ1IjoiamFuZWtkZXJlcnN0ZSIsImEiOiJjajd1ZDB6a3A0dnYwMnFtamx6eWJzYW16In0.9vY7vIQAoOuPj7rg1A_pfw',
style: Mapbox.getStyle(mapStyle),
/* bounds: new LngLatBounds(bbox) */

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.

I think we need something like this for #82, but the bbox seems to be [0, 0, 0, 0] (selectedPath.bbox is not properly set yet or something). We also have to make sure that we respect the current map position in case there was user interaction and a layer change before.

Comment thread src/api/graphhopper.d.ts
@@ -1,5 +1,6 @@
import { LineString } from 'geojson'

// min lat, min lng, max lat, max lng

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.

I think it is actually min lng, min lat, max lng, max lat, for example world = [-180, -90, 180, 90], but yes, adding such a comment might help :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

oh, strange. I thought I did my research properly :/

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.

2 participants