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

A graphical marker positionned through geographic ccoordinates (in the WGS84 datum). An HTML info window can be set to be displayed when the marker is clicked on. Options are :info_bubble (ex: "Hello"), :info_div (ex: ["Hello","itemContent"], the itemContent part indicating the div element where to display the info), :label (ex: "Label") and icon (ex: "/images/icon.png").

Methods

create   new  

Included Modules

MappingObject

Attributes

options  [RW] 
point  [RW] 

Public Class methods

[Source]

    # File lib/mapstraction_plugin/overlay.rb, line 8
 8:       def initialize(point, options = {})
 9:         if point.is_a?(Array)
10:           @point = LatLonPoint.new(point)
11:         else
12:           @point = point
13:         end
14:         @options = options
15:       end

Public Instance methods

[Source]

    # File lib/mapstraction_plugin/overlay.rb, line 17
17:       def create
18:         creation = "new Marker(#{MappingObject.javascriptify_variable(@point)})"
19:         if !@options.empty?
20:           creation = "addDataToMarker(#{creation},#{MappingObject.javascriptify_variable(@options)})"
21:         end
22:         creation
23:       end

[Validate]