Class: Widgets::GoogleMap::Base

Inherits:
ErpApp::Widgets::Base
  • Object
show all
Defined in:
app/widgets/google_map/base.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.base_layoutObject



31
32
33
34
35
36
37
38
# File 'app/widgets/google_map/base.rb', line 31

def base_layout
  begin
    file = File.join(File.dirname(__FILE__),"/views/layouts/base.html.erb")
    IO.read(file)
  rescue
    return nil
  end
end

.titleObject



23
24
25
# File 'app/widgets/google_map/base.rb', line 23

def title
  "Google Map"
end

.widget_nameObject



27
28
29
# File 'app/widgets/google_map/base.rb', line 27

def widget_name
  File.basename(File.dirname(__FILE__))
end

Instance Method Details

#indexObject



5
6
7
8
9
10
11
12
13
14
# File 'app/widgets/google_map/base.rb', line 5

def index
  @uuid = Digest::SHA1.hexdigest(Time.now.to_s + rand(100).to_s)
  @drop_pins = params[:drop_pins]
  @map_width = params[:map_width] || 500
  @map_height = params[:map_height] || 500
  @zoom = params[:zoom] || 18
  @map_type = params[:map_type] || 'SATELLITE'

  render
end

#locateObject

should not be modified modify at your own risk



18
19
20
# File 'app/widgets/google_map/base.rb', line 18

def locate
  File.dirname(__FILE__)
end