Created
October 12, 2017 11:43
-
-
Save stepankuzmin/fc24243eb375b405ce6ef45045c85a54 to your computer and use it in GitHub Desktop.
Mapbox GL JS Style Immutable Flowtype
This file contains hidden or 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
| // @flow | |
| import mapboxgl from 'mapbox-gl'; | |
| import { Record } from 'immutable'; | |
| import type { RecordFactory, RecordOf } from 'immutable'; | |
| type MapStyleProps = { | |
| version: number, | |
| name: ?string, | |
| center: ?[number, number], | |
| zoom: ?number, | |
| bearing: ?number, | |
| pitch: ?number, | |
| light: ?Object, | |
| sprite: ?string, | |
| glyphs: ?string, | |
| transition: ?Object, | |
| sources: Object, | |
| layers: Array<Object> | |
| }; | |
| export type MapStyle = RecordOf<MapStyleProps>; | |
| const makeMapStyle: RecordFactory<MapStyleProps> = Record({ | |
| version: 8, | |
| name: undefined, | |
| center: null, | |
| zoom: null, | |
| bearing: null, | |
| pitch: null, | |
| light: null, | |
| sprite: null, | |
| glyphs: null, | |
| transition: null, | |
| sources: {}, | |
| layers: [] | |
| }); | |
| export default makeMapStyle; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment