panych
5/26/2015 - 12:52 PM

Yandex Map image overlay

Yandex Map image overlay

// 1. Variant. Use existing pane element. Can overlay map objects like placemark, ballons.
// https://tech.yandex.ru/maps/doc/jsapi/2.0/ref/reference/map.pane.Manager-docpage/
map.panes.get('events').getElement().style.backgroundImage = 'my/background/image.png';

// 2. Variant. Create custom element. Pros: set z-index.
var patternEl = document.createElement('div');
patternEl.className = 'map__pattern';
myMap.panes.getInnerElement().appendChild(patternEl);
// then you add styles like:
// .map__pattern {
//   position: absolute;
//   width: 100%;
//   height: 100%;
//   top: 0;
//   left: 0;
//   background: url('../images/map-pattern.png') repeat 0 0;
//   // ground has 501
//   z-index: 550;
// }