Search

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.

Terms of use

These terms do not alter or supersede any existing agreements between you (or your employer) and us.

By accessing or using any Content you agree to be bound by these Terms of Use. Please review these terms carefully before using the website.

The contents of this website, including but not limited to any text, code samples, API references, schemas, interactive tools, and other materials (collectively, the 'Content'), are made available for informational and internal evaluation purposes only. All intellectual property rights in the Content are reserved. No licence is granted to use the Content for any commercial purpose, or to copy, distribute, modify, reverse-engineer, or incorporate any part of the Content into any product or service, without our prior written consent.

This Content is provided “as is” and “as available,” without any representations, warranties, or guarantees of any kind, whether express or implied, including but not limited to implied warranties of merchantability, fitness for a particular purpose, non-infringement, or accuracy. To the fullest extent permitted by applicable law, we expressly exclude and disclaim all implied warranties, conditions, and other terms that might otherwise be implied.

We disclaim all liability for any loss or damage, whether direct, indirect, incidental, consequential, or otherwise, arising from any reliance placed on the Content or from your use of it, to the fullest extent permitted by applicable law. By continuing to access or use the Content, you acknowledge and agree to these terms.