It is necessary that a certain layer or the entire site had a Yandex map in the background.

    1 answer 1

    Here is an example.

    http://jsfiddle.net/znf4pbbd/

    // Как Ρ‚ΠΎΠ»ΡŒΠΊΠΎ Π±ΡƒΠ΄Π΅Ρ‚ Π·Π°Π³Ρ€ΡƒΠΆΠ΅Π½ API ΠΈ Π³ΠΎΡ‚ΠΎΠ² DOM, выполняСм ΠΈΠ½ΠΈΡ†ΠΈΠ°Π»ΠΈΠ·Π°Ρ†ΠΈΡŽ ymaps.ready(init); function init () { // Π‘ΠΎΠ·Π΄Π°Π½ΠΈΠ΅ экзСмпляра ΠΊΠ°Ρ€Ρ‚Ρ‹ ΠΈ Π΅Π³ΠΎ привязка ΠΊ ΠΊΠΎΠ½Ρ‚Π΅ΠΉΠ½Π΅Ρ€Ρƒ с // Π·Π°Π΄Π°Π½Π½Ρ‹ΠΌ id ("map") var myMap = new ymaps.Map('map', { // ΠŸΡ€ΠΈ ΠΈΠ½ΠΈΡ†ΠΈΠ°Π»ΠΈΠ·Π°Ρ†ΠΈΠΈ ΠΊΠ°Ρ€Ρ‚Ρ‹, ΠΎΠ±ΡΠ·Π°Ρ‚Π΅Π»ΡŒΠ½ΠΎ Π½ΡƒΠΆΠ½ΠΎ ΡƒΠΊΠ°Π·Π°Ρ‚ΡŒ // Π΅Π΅ Ρ†Π΅Π½Ρ‚Ρ€ ΠΈ коэффициСнт ΠΌΠ°ΡΡˆΡ‚Π°Π±ΠΈΡ€ΠΎΠ²Π°Π½ΠΈΡ center: [56.326944, 44.0075], // НиТний Новгород zoom: 13 }); } 
     *{ padding: 0; margin: 0; box-sizing: border-box; } html { height:100% } body { height: 100%; margin:0px; padding:0px } #map{ height:100%; width: 100%; position: absolute; top: 0; left: 0; } .content{ width: 300px; min-height: 200px; margin: 0 auto; background: #fff; position: relative; z-index: 1; } 
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="http://api-maps.yandex.ru/2.0/?load=package.full&lang=ru-RU" type="text/javascript"></script> <div class="content"> </div> <div id="map"> </div> 

    • Thanks, helped! I didn’t guess at the API documentation right away, but googling did nothing) I did it like in the example and everything works! - 888man