Class: Cloudkicker::Marker

Inherits:
Object
  • Object
show all
Defined in:
lib/critical_juncture/markers/marker.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Marker

Returns a new instance of Marker.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/critical_juncture/markers/marker.rb', line 4

def initialize(options={})
  raise 'Map is required'  unless options[:map]
  raise 'Lat is required'  unless options[:lat]
  raise 'Long is required' unless options[:long]
  @map   = options.delete(:map)
  @lat   = options.delete(:lat)
  @long  = options.delete(:long)
  @id    = self.object_id
  @title = options.delete(:title) || ''
  @info  = options.delete(:info)  || ''
  
  
  @info.gsub!(/\s+/, ' ')
  @max_width = options.delete(:info_max_width) || 400
  add_marker
end