MapGL
Props
mapLib
module
style
string
CSS style for map container
class
string
CSS class for map container
classList
string[]
SolidJS classList attached to map container
viewport
object
Current viewport of the map, contains: latitude, longitude, zoom, ...
onViewportChange
Viewport
Set the map viewport
options
object
config
object
Sets configuration in Mapbox Standard Style
transitionType
string
flyTo^, easeTo, jumpTo
on[Event]
Event
onUserInteraction
boolean
Event Listeners for user interactions with the map
cursorStyle
string
Map cursor
darkStyle
object | string
Map style when application or browser is in dark mode
disableResize
boolean
disable listener for resizing map container
debug
boolean
Enable debug messages
apikey
string
apikey for vectortile services
*required ^default
Examples
Static Map
By default, MapGL
component renders in a static mode. That means that the user cannot interact with the map.
Interactive Map
In most cases, you will want the user to interact with the map. To do this, you need to provide onViewportChange
handler, that will update the map's viewport state.
Changing Map Style
Last updated