Class Ym4r::MapstractionPlugin::Clusterer
In: lib/mapstraction_plugin/overlay.rb
Parent: Object

Clustering class, to efficiently manage a large number of markers on a map

Methods

add_marker_init   create   new  

Included Modules

MappingObject

Attributes

markers  [RW] 
options  [RW] 

Public Class methods

[Source]

    # File lib/mapstraction_plugin/overlay.rb, line 46
46:       def initialize(markers = [], options = {})
47:         @mapstraction = mapstraction
48:         @options = options
49:         @markers = markers
50:       end

Public Instance methods

To add a marker to the Clusterer before hte mapstraction.clusterer_init is called on the clusterer. No effect after…

[Source]

    # File lib/mapstraction_plugin/overlay.rb, line 54
54:       def add_marker_init(marker)
55:         @markers << marker
56:       end

[Source]

    # File lib/mapstraction_plugin/overlay.rb, line 58
58:       def create
59:         "new Clusterer(#{MappingObject.javascriptify_variable(@markers)},#{MappingObject.javascriptify_variable(@options)})"
60:       end

[Validate]