Last active
August 29, 2015 14:21
-
-
Save panych/a8aa20b0c0cb1cca972a to your computer and use it in GitHub Desktop.
Yandex Map image overlay
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment