Sha256: cafb9a7e1a9fd073d8838c4e3e53c1fe2a5772c9a617a15a99d2dd39be23a4a9
Contents?: true
Size: 1.3 KB
Versions: 6
Compression:
Stored size: 1.3 KB
Contents
javascript: comable_google_map_element_id = "#{id}"; comable_google_map_address = "#{address.full_address}"; coffee: window.can_google_map = -> return false unless comable_google_map_element_id? return false unless comable_google_map_address? return false unless $('#' + comable_google_map_element_id).length true window.initialize_google_map_api = -> script = document.createElement('script') script.type = 'text/javascript' script.src = '//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback=initialize_google_map' script.async = true document.body.appendChild(script) window.initialize_google_map = -> return unless can_google_map() google_map = new google.maps.Map(document.getElementById(comable_google_map_element_id), { zoom: 15 }) google_geo = new google.maps.Geocoder() google_geo.geocode({ address: comable_google_map_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 }) ) $(document).ready(-> if google? initialize_google_map() else initialize_google_map_api() ) .comable-map .comable-google-map id="#{id}" | Loading map...
Version data entries
6 entries across 6 versions & 2 rubygems