
For example, with a bearingSnap of 7, if the user rotates
options.bearingSnap number The threshold, measured in degrees, that determines when the map’sīearing will snap to north. options.interactive boolean If false, no mouse, touch, or keyboard listeners will be attached to the map, so it will not respond to interaction. Is a custom parameter and bar is an arbitrary hash distinct from the map hash. options.hash ( boolean | string) If true, the map’s position (zoom, center latitude, center longitude, bearing, and pitch) will be synced with the hash fragment of the page’s URL.įor example, An additional string may optionally be provided to indicate a parameter-styled hash,. Learn more about style-optimized vector tiles in our API documentation. To load a style from the MapTiler API, you can use a URL of the form, where :style is the style ID. The schema described in the MapLibre Style Specification, or a URL to This must be an a JSON object conforming to options.style ( Object | string)? The map’s MapLibre style. If you encounter any, please raise an issue with details in the MapLibre project. Values greater than 60 degrees are experimental and may result in rendering issues. options.maxPitch number The maximum pitch of the map (0-85). options.minPitch number The minimum pitch of the map (0-85).
options.maxZoom number The maximum zoom level of the map (0-24).options.minZoom number The minimum zoom level of the map (0-24).
The specified element must have no children. ntainer ( HTMLElement | string) The HTML element in which MapLibre GL JS will render the map, or the element’s string id.Then MapLibre GL JS initializes the map on the page and returns your Map You create a Map by specifying a container and other options. It exposes methodsĪnd properties that enable you to programmatically change the map,Īnd fires events as users interact with it. The Map object represents the map on your page.