map-style
Last updated
Was this helpful?
Last updated
Was this helpful?
Updaters for mapStyle
. Can be used in your root reducer to directly modify kepler.gl's state. Read more about
Examples
Default initial mapStyle
Properties
Propagate mapStyle
reducer with mapboxApiAccessToken
and mapStylesReplaceDefault
. if mapStylesReplaceDefault is true mapStyles is emptied; loadMapStylesUpdater() will populate mapStyles.
Parameters
Input a custom map style object
Parameters
action.payload.inputStyle
action.payload.mapState
Callback when a custom map style object is received
Parameters
action.payload.error
any
action.payload.icon
action.payload.style
action.payload.error
Callback when load map style error
Parameters
action.payload
any error
Callback when load map style success
Parameters
Update visibleLayerGroups
to change layer group visibility
Parameters
Change to another map style. The selected style should already been loaded into mapStyle.mapStyles
Parameters
Reset map style config to initial state
Parameters
styleType
Default: 'dark'
visibleLayerGroups
Default: {}
topLayerGroups
Default: {}
mapStyles
mapping from style key to style object
mapboxApiAccessToken
Default: null
inputStyle
Default: {}
threeDBuildingColor
Default: [r, g, b]
Action:
state
action
action.payload
action.payload.mapboxApiAccessToken
Returns nextState
Action:
state
mapStyle
action
action object
action.payload
inputStyle
action.payload.url
style url e.g. 'mapbox://styles/heshan/xxxxxyyyyzzz'
action.payload.id
style url e.g. 'custom_style_1'
action.payload.style
actual mapbox style json
action.payload.name
style name
action.payload.layerGroups
layer groups that can be used to set map layer visibility
action.payload.icon
icon image data url
Returns nextState
Action:
state
mapStyle
action
action.payload
action.payload.icon
action.payload.style
Returns nextState
Action:
state
mapStyle
action
Returns nextState
Action:
state
mapStyle
action
action.payload
a {[id]: style}
mapping
Returns nextState
Action:
state
mapStyle
action
action.payload
new config {visibleLayerGroups: {label: false, road: true, background: true}}
Returns nextState
Action:
state
mapStyle
action
action.payload
Returns nextState
Action:
state
mapStyle
Returns nextState