Sha256: ece2462625a0aa204e721a261b5943af19c550cb5f0e2a339bdb1e367132f689
Contents?: true
Size: 1.2 KB
Versions: 11
Compression:
Stored size: 1.2 KB
Contents
.widget.widget-map.thumbnail(id="map#{widget.id}") = content_for :javascript do - unless options.key?(:static) :coffee $ -> maps = [] maps["map#{widget.id}"] = new GMaps( div: "#map#{widget.id}" lat: "#{options[:latitude]}" lng: "#{options[:longitude]}" ) maps["map#{widget.id}"].addMarker( lat: "#{options[:latitude]}" lng: "#{options[:longitude]}" title: "#{options[:title]}" infoWindow: content: "#{content.html_safe}" ) - else :coffee $ -> imageUrl = GMaps.staticMapURL( size: [640, 640] scale: 2 format: 'jpg-baseline' lat: "#{options[:latitude]}" lng: "#{options[:longitude]}" markers: [ lat: "#{options[:latitude]}" lng: "#{options[:longitude]}" ] ) $("#map#{widget.id}").css('background-image', 'url(' + imageUrl + ')') if imageUrl - if options.key?(:width) :coffee $("#map#{widget.id}").css('width', "#{options[:width]}") - if options.key?(:height) :coffee $("#map#{widget.id}").css('width', "#{options[:height]}")
Version data entries
11 entries across 11 versions & 1 rubygems