Class: Ym4r::GmPlugin::GPolylineEncoded
- Inherits:
-
Object
- Object
- Ym4r::GmPlugin::GPolylineEncoded
- Includes:
- MappingObject
- Defined in:
- lib/gm_plugin/overlay.rb
Overview
Encoded GPolyline class
Instance Attribute Summary (collapse)
-
- (Object) color
Returns the value of attribute color.
-
- (Object) levels
Returns the value of attribute levels.
-
- (Object) num_levels
Returns the value of attribute num_levels.
-
- (Object) opacity
Returns the value of attribute opacity.
-
- (Object) points
Returns the value of attribute points.
-
- (Object) weight
Returns the value of attribute weight.
-
- (Object) zoom_factor
Returns the value of attribute zoom_factor.
Attributes included from MappingObject
Instance Method Summary (collapse)
- - (Object) create
-
- (GPolylineEncoded) initialize(options = {})
constructor
A new instance of GPolylineEncoded.
Methods included from MappingObject
#[], #assign_to, #declare, #declare_random, #declared?, escape_javascript, #get_property, javascriptify_method, javascriptify_variable, #method_missing, #set_property, #to_javascript
Constructor Details
- (GPolylineEncoded) initialize(options = {})
A new instance of GPolylineEncoded
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/gm_plugin/overlay.rb', line 112 def initialize(={}) #points = options[:points] #if !points.empty? and points[0].is_a?(Array) # @points = points.collect { |pt| GLatLng.new(pt) } #else #@points = points #end @points = [:points] @color = [:color] @weight = [:weight] @opacity = [:opacity] @levels = [:levels] || "BBBBBBBBBBBB" @zoom_factor = [:zoom_factor] || 32 @num_levels = [:num_levels] || 4 end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Ym4r::GmPlugin::MappingObject
Instance Attribute Details
- (Object) color
Returns the value of attribute color
110 111 112 |
# File 'lib/gm_plugin/overlay.rb', line 110 def color @color end |
- (Object) levels
Returns the value of attribute levels
110 111 112 |
# File 'lib/gm_plugin/overlay.rb', line 110 def levels @levels end |
- (Object) num_levels
Returns the value of attribute num_levels
110 111 112 |
# File 'lib/gm_plugin/overlay.rb', line 110 def num_levels @num_levels end |
- (Object) opacity
Returns the value of attribute opacity
110 111 112 |
# File 'lib/gm_plugin/overlay.rb', line 110 def opacity @opacity end |
- (Object) points
Returns the value of attribute points
110 111 112 |
# File 'lib/gm_plugin/overlay.rb', line 110 def points @points end |
- (Object) weight
Returns the value of attribute weight
110 111 112 |
# File 'lib/gm_plugin/overlay.rb', line 110 def weight @weight end |
- (Object) zoom_factor
Returns the value of attribute zoom_factor
110 111 112 |
# File 'lib/gm_plugin/overlay.rb', line 110 def zoom_factor @zoom_factor end |
Instance Method Details
- (Object) create
127 128 129 130 131 132 133 134 135 136 |
# File 'lib/gm_plugin/overlay.rb', line 127 def create a = "new GPolyline.fromEncoded({points: #{MappingObject.javascriptify_variable(points)},\n" a << "levels: #{MappingObject.javascriptify_variable(@levels)}," a << "zoomFactor: #{MappingObject.javascriptify_variable(@zoom_factor)}," a << "numLevels: #{MappingObject.javascriptify_variable(@num_levels)}" a << ",color: #{MappingObject.javascriptify_variable(@color)}" if @color a << ",weight: #{MappingObject.javascriptify_variable(@weight)}" if @weight a << ",opacity: #{MappingObject.javascriptify_variable(@opacity)}" if @opacity a << "})" end |