Class: Configuration

Configuration()

The Configuration of a map.
This is only used before calling "showMap". Any changes made to the configuration after the initial "showMap" will be ignored.

Constructor

new Configuration()

Source:

Members

boundsPadding :number

The "padding" we should use for the bounds when showing the markers. This value is a percentage, where 1 = 100%, 0 = 0%, and -1 = -100%.
This value shouldn't be too large, and should be positive. A value between 0.2 and 0.5 is probably ideal for performance. Larger values will reduce performance in the common case, and values too small (<0.2) will reduce performance for users that move the map around a lot.
Default value is 0.25
Type:
  • number
Source:

canUseDivAttributes :boolean

Set to true if the HTML attributes of the map's div can be used to override the configuration.
Type:
  • boolean
Source:

center :Array.<number>

The Center of the Map. This should be an array containing 2 numbers.
Default value is roughly in the center of Belgium.
Type:
  • Array.<number>
Source:

maxElements :number|undefined

The maximum number of elements that can be shown on-screen Set to undefined, or a number less or equal to zero to remove the limit.
Default value is 500
Type:
  • number | undefined
Source:

popupTextProvider :PopupTextProviderType

The function that is called whenever we want to fetch the marker popup text for a given element.
This function is always called with the element object, which has an array of tags (element.tags) that you can use.
Return undefined if you don't want a popup
Popups support HTML.
Type:
  • PopupTextProviderType
Source:

tileLayer :string

The TileLayer to use.
See https://leafletjs.com/reference-1.5.0.html#tilelayer for more information.
Default value is the OSM default map: https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png
Type:
  • string
Source:

tileLayerAttribution :string

The tileLayer's attribution text.
Default value is the attribution for the OSM default map (see above).
Type:
  • string
Source:

zoom :number

The Zoom level of the map.
Default value is 14.
Type:
  • number
Source:

Methods

useDivAttributes(div)

Overrides this configuration based on a div's attributes.
The attributes must have the same name as the members.
Attributes will be checked against a RegEx to see if they're well formed. If they aren't, they'll be ignored an a warning will be printed to the console.
Parameters:
Name Type Description
div object the div object
Source: