Class: AtlasOnRails::AtlasMap
- Inherits:
-
Object
- Object
- AtlasOnRails::AtlasMap
- Defined in:
- lib/atlas_on_rails/map.rb
Instance Attribute Summary collapse
-
#events ⇒ Object
Returns the value of attribute events.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#icons ⇒ Object
Returns the value of attribute icons.
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
-
#markers ⇒ Object
Returns the value of attribute markers.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pan_control ⇒ Object
readonly
Returns the value of attribute pan_control.
-
#polylines ⇒ Object
Returns the value of attribute polylines.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
-
#windows ⇒ Object
Returns the value of attribute windows.
-
#zoom ⇒ Object
readonly
Returns the value of attribute zoom.
-
#zoom_control ⇒ Object
readonly
Returns the value of attribute zoom_control.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ AtlasMap
constructor
A new instance of AtlasMap.
- #key(options = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ AtlasMap
Returns a new instance of AtlasMap.
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
# File 'lib/atlas_on_rails/map.rb', line 155 def initialize(={}) case ([:api].downcase unless [:api].nil?) when 'google' then self.extend(GoogleMap) @mapping_object, @mapping_api = [AtlasOnRails::GoogleMap, 'google'] when 'yahoo' then self.extend(YahooMap) @mapping_object, @mapping_api = [AtlasOnRails::YahooMap, 'yahoo'] else self.extend(GoogleMap) @mapping_object, @mapping_api = [AtlasOnRails::GoogleMap, 'google'] end @latitude = [:latitude].nil? ? 0 : [:latitude] @longitude = [:longitude].nil? ? 0 : [:longitude] @zoom = [:zoom].nil? ? 1 : [:zoom] @name = [:name].nil? ? 'map' : [:name] @width = [:width].nil? ? '500px' : [:width] @height = [:height].nil? ? '300px' : [:height] @pan_control = [:pan_control] @zoom_control = [:zoom_control] @events = Array.new @icons = AtlasIconList.new @markers = AtlasMarkerList.new(@icons) @windows = AtlasWindowList.new(@icons) @polylines = Array.new end |
Instance Attribute Details
#events ⇒ Object
Returns the value of attribute events.
151 152 153 |
# File 'lib/atlas_on_rails/map.rb', line 151 def events @events end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
146 147 148 |
# File 'lib/atlas_on_rails/map.rb', line 146 def height @height end |
#icons ⇒ Object
Returns the value of attribute icons.
150 151 152 |
# File 'lib/atlas_on_rails/map.rb', line 150 def icons @icons end |
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
142 143 144 |
# File 'lib/atlas_on_rails/map.rb', line 142 def latitude @latitude end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude.
143 144 145 |
# File 'lib/atlas_on_rails/map.rb', line 143 def longitude @longitude end |
#markers ⇒ Object
Returns the value of attribute markers.
149 150 151 |
# File 'lib/atlas_on_rails/map.rb', line 149 def markers @markers end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
141 142 143 |
# File 'lib/atlas_on_rails/map.rb', line 141 def name @name end |
#pan_control ⇒ Object (readonly)
Returns the value of attribute pan_control.
147 148 149 |
# File 'lib/atlas_on_rails/map.rb', line 147 def pan_control @pan_control end |
#polylines ⇒ Object
Returns the value of attribute polylines.
153 154 155 |
# File 'lib/atlas_on_rails/map.rb', line 153 def polylines @polylines end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
145 146 147 |
# File 'lib/atlas_on_rails/map.rb', line 145 def width @width end |
#windows ⇒ Object
Returns the value of attribute windows.
152 153 154 |
# File 'lib/atlas_on_rails/map.rb', line 152 def windows @windows end |
#zoom ⇒ Object (readonly)
Returns the value of attribute zoom.
144 145 146 |
# File 'lib/atlas_on_rails/map.rb', line 144 def zoom @zoom end |
#zoom_control ⇒ Object (readonly)
Returns the value of attribute zoom_control.
148 149 150 |
# File 'lib/atlas_on_rails/map.rb', line 148 def zoom_control @zoom_control end |
Instance Method Details
#key(options = {}) ⇒ Object
182 183 184 185 |
# File 'lib/atlas_on_rails/map.rb', line 182 def key(={}) [:api] = @mapping_api AtlasOnRails::AtlasKey.get() end |