Sha256: f2cd7ffd2214343b7dfd7494abd9260c964ac480025d138f759c12b8cadce74d

Contents?: true

Size: 754 Bytes

Versions: 5

Compression:

Stored size: 754 Bytes

Contents

/ TODO: Refactoring
= javascript_include_tag '//maps.google.com/maps/api/js?v=3&sensor=false'

coffee:
  window.initialize_google_map = (element_id, address) ->
    google_map = new google.maps.Map(document.getElementById(element_id), { zoom: 15 })
    google_geo = new google.maps.Geocoder()
    google_geo.geocode({ address: address }, (result, status) =>
      return if status != google.maps.GeocoderStatus.OK
      location = result[0].geometry.location
      google_map.setCenter(location)
      new google.maps.Marker({ map: google_map, position: location })
    )

javascript:
  $(document).ready(function() {
    initialize_google_map('#{id}', '#{address.full_address}');
  })

.comable-map
  .comable-google-map id="#{id}"
    | Loading map...

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
comable_backend-0.4.2 app/views/comable/admin/orders/_google_map.slim
comable_backend-0.4.1 app/views/comable/admin/orders/_google_map.slim
comable_backend-0.4.0 app/views/comable/admin/orders/_google_map.slim
comable_backend-0.3.4 app/views/comable/admin/orders/_google_map.slim
comable_backend-0.3.3 app/views/comable/admin/orders/_google_map.slim