Map Options
These are the options you can pass to the first argument of chart.map().options().
boolean
default: true Whether showing and hiding the Leaflet map should be animated.
object Pass options directly into the Leaflet constructor. See the L.map options documentation in the relevant version of the Leaflet API Reference.
number
default: 5 Specifies how much space, in pixels, to leave around the Leaflet map when zooming to fit.
null | string | object An option to set the url template for Leaflet map tiles. Accepts either a string in the form of 'http://example.com/path/{z}/{x}/{y}.png', or an object in the Leaflet L.tileLayer options format with an additional url property:
chart.map().options({
tiles: {
url: 'http://example.com/path/{z}/{x}/{y}.png',
attribution: 'Attribution text',
minZoom: 4,
maxZoom: 12,
noWrap: false
}
}).then(() => {
// do more after options
});
If the url template isn't set, OpenStreetMap is used as a default tile provider. If set to null, the tile layer isn't created.
See the L.tileLayer options documentation in the relevant version of the Leaflet API Reference.
See the Map Layers documentation for more details about tiles and the default map tiles used by KeyLines.
Note: If you reference a map tile URL or object that's on a different domain to the KeyLines library, your browser will display it, but won't let KeyLines examine it or render it to a data URL. For details on how to fix this, see Cross-Origin Images (CORS).
number
default: 800 If animated, the time that showing or hiding the Leaflet map should take, in milliseconds.
"layout" | "restore"
default: 'restore' Controls how items are positioned when transitioning from Leaflet map to network. Use 'restore' to move items back to their previous positions, or 'layout' to position using a 'organic' layout.