script src http api-maps yandex ru lang ru_RU type text javascript scr

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
<script src="http://api-maps.yandex.ru/2.1/?lang=ru_RU" type="text/javascript"></script>
<script>
ymaps.ready(function () {
var center = [{{ building.geo_point.x|formatted_float }}, {{ building.geo_point.y|formatted_float }}];
var itemMap = new ymaps.Map('map-item', {
center: center,
zoom: 16,
type: 'yandex#publicMap',
controls: ['rulerControl', 'zoomControl']
});
PlacemarkItem = new ymaps.Placemark([{{ building.geo_point.x|formatted_float }}, {{ building.geo_point.y|formatted_float }}], {
hintContent: '{{ building.title }}<br>{{ building.adress }}'
}, {
iconLayout: 'default#image',
iconImageHref: '{{ STATIC_URL }}/images/home.png',
iconImageSize: [20, 32],
iconImageOffset: [-3, -42]
});
itemMap.geoObjects.add(PlacemarkItem)
})
</script>
<div id="map-item"></div>