L.Yandex

July 10, 2019 ยท View on GitHub

A Leaflet basemap provider based on Yandex.Maps JS API 2.1.

L.Yandex extends L.Layer.

API

Usage example

L.yandex('yandex#satellite').addTo(map);

Creation

Factory: L.yandex(<String> type?, <Object> options?)

Instantiates a Yandex layer object given type and options arguments (both optional).

Can be used with single options argument, if it contains type property.

Map types

  • Valid basemap types: yandex#map, yandex#satellite, yandex#hybrid, yandex#map~vector or their short names: map, satellite, hybrid, map~vector.

  • Valid overlay types:

    • overlay - empty transparent map, which can be used for displaying data provided e.g. by controls.
    • skeleton - roads and labels, like in hybrid (but w/o basemap).

Options

OptionTypeDefaultDescription
typeString'yandex#map'The same as type argument.
mapOptionsObject(see in the sources)Options to set on map creation.
overlayOpacityNumber0.8Opacity used for overlay map types.
opacityNumberundefinedForce map opacity to given value. Not really useful, but kept for compatibility.

Note, that traffic option removed, as traffic layer can be added using ymaps JSAPI directly. See Examples and Addons sections of this documentation.

Events

load: Fired after Yandex map object is initialized.

Data: Event

Examples

Addons

'Addons' are optional scripts adding some custom functionality to main class.

Should be loaded after Yandex.js.

Addons can add own api (options, methods, etc), that is described in their source files' comments.