Class: Ym4r::GmPlugin::GMarkerManager
- Inherits:
-
Object
- Object
- Ym4r::GmPlugin::GMarkerManager
- Includes:
- MappingObject
- Defined in:
- lib/gm_plugin/overlay.rb
Overview
Can be used to implement a clusterer, similar to the clusterer below, except that there is more stuff to manage explicitly byt the programmer (but this is also more flexible). See the README for usage esamples.
Instance Attribute Summary (collapse)
-
- (Object) managed_markers
Returns the value of attribute managed_markers.
-
- (Object) map
Returns the value of attribute map.
-
- (Object) options
Returns the value of attribute options.
Attributes included from MappingObject
Instance Method Summary (collapse)
- - (Object) create
-
- (GMarkerManager) initialize(map, options = {})
constructor
options can be :border_padding, :max_zoom, :track_markers and :managed_markers: managed_markers must be an array of ManagedMarker objects.
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
- (GMarkerManager) initialize(map, options = {})
options can be :border_padding, :max_zoom, :track_markers and :managed_markers: managed_markers must be an array of ManagedMarker objects
302 303 304 305 306 |
# File 'lib/gm_plugin/overlay.rb', line 302 def initialize(map, = {}) @map = map @managed_markers = Array(.delete(:managed_markers)) #[] if nil @options = end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Ym4r::GmPlugin::MappingObject
Instance Attribute Details
- (Object) managed_markers
Returns the value of attribute managed_markers
299 300 301 |
# File 'lib/gm_plugin/overlay.rb', line 299 def managed_markers @managed_markers end |
- (Object) map
Returns the value of attribute map
299 300 301 |
# File 'lib/gm_plugin/overlay.rb', line 299 def map @map end |
- (Object) options
Returns the value of attribute options
299 300 301 |
# File 'lib/gm_plugin/overlay.rb', line 299 def @options end |
Instance Method Details
- (Object) create
308 309 310 311 |
# File 'lib/gm_plugin/overlay.rb', line 308 def create puts @options.inspect "addMarkersToManager(new GMarkerManager(#{MappingObject.javascriptify_variable(@map)},#{MappingObject.javascriptify_variable(@options)}),#{MappingObject.javascriptify_variable(@managed_markers)})" end |