-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #420 from opentripplanner/vector-tiles
Add MapLibreGL
- Loading branch information
Showing
135 changed files
with
67,171 additions
and
161,429 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react' | ||
import BaseMap, { Styled as BaseMapStyled } from "@opentripplanner/base-map"; | ||
|
||
// BaseMap props | ||
const CENTER = [45.5215, -122.686202]; | ||
const ZOOM = 16; | ||
|
||
export const withMap = (center = CENTER, zoom = ZOOM) => ( | ||
Story | ||
) => ( | ||
<BaseMapStyled.StoryMapContainer> | ||
<BaseMap center={center} zoom={zoom}> | ||
{/* For some reason, <Story /> does not work with snapshots, | ||
so use the function syntax instead. */} | ||
{Story()} | ||
</BaseMap> | ||
</BaseMapStyled.StoryMapContainer> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Vector Tiles Migration Guide | ||
|
||
Due to otp-ui's `base-map` package, the migration to [MapLibreGL](https://maplibre.org/projects/maplibre-gl-js/) is quite smooth for those implementing an otp-ui map. | ||
|
||
Key props in `base-map` have stayed the same. After updating your tile URL to a vector tile json file (any vector tile set compatible with MapBoxGL will work), things should work with minimal changes. MapLibreGL allows for some new settings, and others are deprecated. Some props throughout all layers have changed. All packages are now typescripted, which means that it is easy to see which props have changed. |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.