Sha256: 0393ee8719ee1e63ca3bb61e13e37e28a6d78bc56861adb63e804cc38ae33629

Contents?: true

Size: 639 Bytes

Versions: 9

Compression:

Stored size: 639 Bytes

Contents

window.ya_init = ->
  $('.ymap').each ->
    $m = $(this)
    coord = [$m.data('lat'), $m.data('lon')]
    map = new ymaps.Map($m[0],
      center: coord
      zoom: 14,
      behaviors: ['default'] #, 'scrollZoom']
    )
    map.controls.add('zoomControl', { left: 5, top: 5 })
    obj = new ymaps.Placemark(coord,
      hintContent: $m.data('hint')
      balloonContent: $m.data('hint') + ' ' + $m.data('addr')
    )
    map.geoObjects.add obj

$(document).on 'page:change', ->
  return if $('.ymap').length == 0
  if window.ymaps
    ya_init()
  else
    head.load "//api-maps.yandex.ru/2.0/?load=package.full&lang=ru-RU&onload=ya_init"

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rocket_cms-0.5.1 app/assets/javascripts/rocket_cms/map.js.coffee
rocket_cms-0.5.0 app/assets/javascripts/rocket_cms/map.js.coffee
rocket_cms-0.5.0.rc.5 app/assets/javascripts/rocket_cms/map.js.coffee
rocket_cms-0.5.0.rc.4 app/assets/javascripts/rocket_cms/map.js.coffee
rocket_cms-0.4.2 app/assets/javascripts/rocket_cms/map.js.coffee
rocket_cms-0.3.2 app/assets/javascripts/rocket_cms/map.js.coffee
rocket_cms-0.2.12 app/assets/javascripts/rocket_cms/map.js.coffee
rocket_cms-0.2.10 app/assets/javascripts/rocket_cms/map.js.coffee
rocket_cms-0.1.13 app/assets/javascripts/rocket_cms/map.js.coffee