map-style
Table of Contents
mapStyleUpdaters
Updaters for mapStyle
. Can be used in your root reducer to directly modify kepler.gl's state. Read more about Using updaters
Examples
INITIAL_MAP_STYLE
Default initial mapStyle
Properties
styleType
string Default:'dark'
visibleLayerGroups
Object Default:{}
topLayerGroups
Object Default:{}
mapStyles
Object mapping from style key to style objectmapboxApiAccessToken
string Default:null
inputStyle
Object Default:{}
threeDBuildingColor
Array Default:[r, g, b]
initMapStyleUpdater
Propagate mapStyle
reducer with mapboxApiAccessToken
and mapStylesReplaceDefault
. if mapStylesReplaceDefault is true mapStyles is emptied; loadMapStylesUpdater() will populate mapStyles.
Action:
keplerGlInit
Parameters
state
Object
Returns Object nextState
inputMapStyleUpdater
Input a custom map style object
Action:
inputMapStyle
Parameters
state
ObjectmapStyle
action
Object action objectaction.payload
Object inputStyleaction.payload.url
string style url e.g.'mapbox://styles/heshan/xxxxxyyyyzzz'
action.payload.id
string style url e.g.'custom_style_1'
action.payload.style
Object actual mapbox style jsonaction.payload.name
string style nameaction.payload.layerGroups
Object layer groups that can be used to set map layer visibilityaction.payload.icon
Object icon image data url
action.payload.inputStyle
action.payload.mapState
Returns Object nextState
loadCustomMapStyleUpdater
Callback when a custom map style object is received
Action:
loadCustomMapStyle
Parameters
state
ObjectmapStyle
Returns Object nextState
loadMapStyleErrUpdater
Callback when load map style error
Action:
loadMapStyleErr
Parameters
Returns Object nextState
loadMapStylesUpdater
Callback when load map style success
Action:
loadMapStyles
Parameters
state
ObjectmapStyle
Returns Object nextState
mapConfigChangeUpdater
Update visibleLayerGroups
to change layer group visibility
Action:
mapConfigChange
Parameters
state
ObjectmapStyle
Returns Object nextState
mapStyleChangeUpdater
Change to another map style. The selected style should already been loaded into mapStyle.mapStyles
Action:
mapStyleChange
Parameters
state
ObjectmapStyle
Returns Object nextState
resetMapConfigMapStyleUpdater
Reset map style config to initial state
Action:
resetMapConfig
Parameters
state
ObjectmapStyle
Returns Object nextState
Last updated