ym4r_gm 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,129 @@
1
+ module Ym4r
2
+ module GmPlugin
3
+ #The module where all the Ruby-to-JavaScript conversion takes place. It is included by all the classes in the YM4R library.
4
+ module MappingObject
5
+ #The name of the variable in JavaScript space.
6
+ attr_reader :variable
7
+
8
+ #Creates javascript code for missing methods + takes care of listeners
9
+ def method_missing(name,*args)
10
+ str_name = name.to_s
11
+ if str_name =~ /^on_(.*)/
12
+ if args.length != 1
13
+ raise ArgumentError("Only 1 argument is allowed on on_ methods");
14
+ else
15
+ Variable.new("GEvent.addListener(#{to_javascript},\"#{MappingObject.javascriptify_method($1)}\",#{args[0]})")
16
+ end
17
+ else
18
+ args.collect! do |arg|
19
+ MappingObject.javascriptify_variable(arg)
20
+ end
21
+ Variable.new("#{to_javascript}.#{MappingObject.javascriptify_method(str_name)}(#{args.join(",")})")
22
+ end
23
+ end
24
+
25
+ #Creates javascript code for array or hash indexing
26
+ def [](index) #index could be an integer or string
27
+ return Variable.new("#{to_javascript}[#{MappingObject.javascriptify_variable(index)}]")
28
+ end
29
+
30
+ #Transforms a Ruby object into a JavaScript string : MAppingObject, String, Array, Hash and general case (using to_s)
31
+ def self.javascriptify_variable(arg)
32
+ if arg.is_a?(MappingObject)
33
+ arg.to_javascript
34
+ elsif arg.is_a?(String)
35
+ "\"#{MappingObject.escape_javascript(arg)}\""
36
+ elsif arg.is_a?(Array)
37
+ "[" + arg.collect{ |a| MappingObject.javascriptify_variable(a)}.join(",") + "]"
38
+ elsif arg.is_a?(Hash)
39
+ "{" + arg.to_a.collect do |v|
40
+ "#{MappingObject.javascriptify_method(v[0].to_s)} : #{MappingObject.javascriptify_variable(v[1])}"
41
+ end.join(",") + "}"
42
+ elsif arg.nil?
43
+ "undefined"
44
+ else
45
+ arg.to_s
46
+ end
47
+ end
48
+
49
+ #Escape string to be used in JavaScript. Lifted from rails.
50
+ def self.escape_javascript(javascript)
51
+ javascript.gsub(/\r\n|\n|\r/, "\\n").gsub("\"") { |m| "\\#{m}" }
52
+ end
53
+
54
+ #Transform a ruby-type method name (like add_overlay) to a JavaScript-style one (like addOverlay).
55
+ def self.javascriptify_method(method_name)
56
+ method_name.gsub(/_(\w)/){|s| $1.upcase}
57
+ end
58
+
59
+ #Declares a Mapping Object bound to a JavaScript variable of name +variable+.
60
+ def declare(variable)
61
+ @variable = variable
62
+ "var #{@variable} = #{create};"
63
+ end
64
+
65
+ #declare with a random variable name
66
+ def declare_random(init,size = 8)
67
+ s = init.clone
68
+ 6.times { s << (i = Kernel.rand(62); i += ((i < 10) ? 48 : ((i < 36) ? 55 : 61 ))).chr }
69
+ declare(s)
70
+ end
71
+
72
+ #Checks if the MappinObject has been declared
73
+ def declared?
74
+ !@variable.nil?
75
+ end
76
+
77
+ #Binds a Mapping object to a previously declared JavaScript variable of name +variable+.
78
+ def assign_to(variable)
79
+ @variable = variable
80
+ "#{@variable} = #{create};"
81
+ end
82
+
83
+ #Assign the +value+ to the +property+ of the MappingObject
84
+ def set_property(property, value)
85
+ "#{to_javascript}.#{MappingObject.javascriptify_method(property.to_s)} = #{MappingObject.javascriptify_variable(value)}"
86
+ end
87
+
88
+ #Returns the code to get a +property+ from the MappingObject
89
+ def get_property(property)
90
+ Variable.new("#{to_javascript}.#{MappingObject.javascriptify_method(property.to_s)}")
91
+ end
92
+
93
+ #Returns a Javascript code representing the object
94
+ def to_javascript
95
+ unless @variable.nil?
96
+ @variable
97
+ else
98
+ create
99
+ end
100
+ end
101
+
102
+ #Creates a Mapping Object in JavaScript.
103
+ #To be implemented by subclasses if needed
104
+ def create
105
+ end
106
+ end
107
+
108
+ #Used to bind a ruby variable to an already existing JavaScript one. It doesn't have to be a variable in the sense "var variable" but it can be any valid JavaScript expression that has a value.
109
+ class Variable
110
+ include MappingObject
111
+
112
+ def initialize(variable)
113
+ @variable = variable
114
+ end
115
+ #Returns the javascript expression contained in the object.
116
+ def create
117
+ @variable
118
+ end
119
+ #Returns the expression inside the Variable followed by a ";"
120
+ def to_str
121
+ @variable + ";"
122
+ end
123
+ alias to_s to_str
124
+
125
+ UNDEFINED = Variable.new("undefined")
126
+ end
127
+ end
128
+ end
129
+
@@ -0,0 +1,400 @@
1
+ module Ym4r
2
+ module GmPlugin
3
+ #A graphical marker positionned through geographic coordinates (in the WGS84 datum). An HTML info window can be set to be displayed when the marker is clicked on.
4
+ class GMarker
5
+ include MappingObject
6
+ attr_accessor :point, :options, :info_window, :info_window_tabs, :address
7
+ #The +points+ argument can be either a GLatLng object or an array of 2 floats. The +options+ keys can be: <tt>:icon</tt>, <tt>:clickable</tt>, <tt>:title</tt>, <tt>:info_window</tt> and <tt>:info_window_tabs</tt>, as well as <tt>:max_width</tt>. The value of the +info_window+ key is a string of HTML code that will be displayed when the markers is clicked on. The value of the +info_window_tabs+ key is an array of GInfoWindowTab objects or a hash directly, in which case it will be transformed to an array of GInfoWindowTabs, with the keys as the tab headers and the values as the content.
8
+ def initialize(position, options = {})
9
+ if position.is_a?(Array)
10
+ @point = GLatLng.new(position)
11
+ elsif position.is_a?(String)
12
+ @point = Variable.new("INVISIBLE") #default coordinates: won't appear anyway
13
+ @address = position
14
+ else
15
+ @point = position
16
+ end
17
+ @info_window = options.delete(:info_window)
18
+ @info_window_tabs = options.delete(:info_window_tabs)
19
+ if options.has_key?(:max_url)
20
+ @info_window_options = {:max_url => options.delete(:max_url) }
21
+ else
22
+ @info_window_options = {}
23
+ end
24
+ @options = options
25
+ end
26
+ #Creates a marker: If an info_window or info_window_tabs is present, the response to the click action from the user is setup here.
27
+ def create
28
+ if @options.empty?
29
+ creation = "new GMarker(#{MappingObject.javascriptify_variable(@point)})"
30
+ else
31
+ creation = "new GMarker(#{MappingObject.javascriptify_variable(@point)},#{MappingObject.javascriptify_variable(@options)})"
32
+ end
33
+ if @info_window && @info_window.is_a?(String)
34
+ creation = "addInfoWindowToMarker(#{creation},#{MappingObject.javascriptify_variable(@info_window)},#{MappingObject.javascriptify_variable(@info_window_options)})"
35
+ elsif @info_window_tabs && @info_window_tabs.is_a?(Hash)
36
+ creation = "addInfoWindowTabsToMarker(#{creation},#{MappingObject.javascriptify_variable(@info_window_tabs.to_a.collect{|kv| GInfoWindowTab.new(kv[0],kv[1] ) })},#{MappingObject.javascriptify_variable(@info_window_options)})"
37
+ elsif @info_window_tabs
38
+ creation = "addInfoWindowTabsToMarker(#{creation},#{MappingObject.javascriptify_variable(Array(@info_window_tabs))},#{MappingObject.javascriptify_variable(@info_window_options)})"
39
+ end
40
+ if @address.nil?
41
+ creation
42
+ else
43
+ "addGeocodingToMarker(#{creation},#{MappingObject.javascriptify_variable(@address)})"
44
+ end
45
+ end
46
+ end
47
+
48
+ #Represents a tab to be displayed in a bubble when a marker is clicked on.
49
+ class GInfoWindowTab < Struct.new(:tab,:content)
50
+ include MappingObject
51
+ def create
52
+ "new GInfoWindowTab(#{MappingObject.javascriptify_variable(tab)},#{MappingObject.javascriptify_variable(content)})"
53
+ end
54
+ end
55
+
56
+ #Represents a definition of an icon. You can pass rubyfied versions of the attributes detailed in the Google Maps API documentation. You can initialize global icons to be used in the application by passing a icon object, along with a variable name, to GMap#icon_init. If you want to declare an icon outside this, you will need to declare it first, since the JavaScript constructor does not accept any argument.
57
+ class GIcon
58
+ include MappingObject
59
+ DEFAULT = Variable.new("G_DEFAULT_ICON")
60
+ attr_accessor :options, :copy_base
61
+
62
+ #Options can contain all the attributes (in rubyfied format) of a GIcon object (see Google's doc), as well as <tt>:copy_base</tt>, which indicates if the icon is copied from another one.
63
+ def initialize(options = {})
64
+ @copy_base = options.delete(:copy_base)
65
+ @options = options
66
+ end
67
+ #Creates a GIcon.
68
+ def create
69
+ if @copy_base
70
+ c = "new GIcon(#{MappingObject.javascriptify_variable(@copy_base)})"
71
+ else
72
+ c = "new GIcon()"
73
+ end
74
+ if !options.empty?
75
+ "addOptionsToIcon(#{c},#{MappingObject.javascriptify_variable(@options)})"
76
+ else
77
+ c
78
+ end
79
+ end
80
+ end
81
+
82
+ #A polyline.
83
+ class GPolyline
84
+ include MappingObject
85
+ attr_accessor :points,:color,:weight,:opacity
86
+ #Can take an array of +GLatLng+ or an array of 2D arrays. A method to directly build a polyline from a GeoRuby linestring is provided in the helper.rb file.
87
+ def initialize(points,color = nil,weight = nil,opacity = nil)
88
+ if !points.empty? and points[0].is_a?(Array)
89
+ @points = points.collect { |pt| GLatLng.new(pt) }
90
+ else
91
+ @points = points
92
+ end
93
+ @color = color
94
+ @weight = weight
95
+ @opacity = opacity
96
+ end
97
+ #Creates a new polyline.
98
+ def create
99
+ a = "new GPolyline(#{MappingObject.javascriptify_variable(points)}"
100
+ a << ",#{MappingObject.javascriptify_variable(@color)}" if @color
101
+ a << ",#{MappingObject.javascriptify_variable(@weight)}" if @weight
102
+ a << ",#{MappingObject.javascriptify_variable(@opacity)}" if @opacity
103
+ a << ")"
104
+ end
105
+ end
106
+
107
+ #
108
+ # Encoded GPolyline class. This class does NOT perform encoding.
109
+ # Instead, you must pass it encoded points, levels, and a zoom_factor
110
+ # created using Ym4r::GmPlugin::GMapPolylineEncoder.
111
+ #
112
+ # For more info on encoding polylines, see
113
+ # http://code.google.com/apis/maps/documentation/reference.html#GPolyline.fromEncoded
114
+ # http://code.google.com/apis/maps/documentation/overlays.html#Encoded_Polylines
115
+ #
116
+ class GPolylineEncoded
117
+ include MappingObject
118
+ attr_accessor :points,:color,:weight,:opacity,:levels,:zoom_factor,:num_levels
119
+
120
+ def initialize(options={})
121
+ @points = options[:points]
122
+ @color = options[:color]
123
+ @weight = options[:weight]
124
+ @opacity = options[:opacity]
125
+ @levels = options[:levels] || "BBBBBBBBBBBB"
126
+ @zoom_factor = options[:zoom_factor] || 32
127
+ @num_levels = options[:num_levels] || 4
128
+ end
129
+ def create
130
+ a = "new GPolyline.fromEncoded({points: #{MappingObject.javascriptify_variable(points)},\n"
131
+ a << "levels: #{MappingObject.javascriptify_variable(@levels)},"
132
+ a << "zoomFactor: #{MappingObject.javascriptify_variable(@zoom_factor)},"
133
+ a << "numLevels: #{MappingObject.javascriptify_variable(@num_levels)}"
134
+ a << ",color: #{MappingObject.javascriptify_variable(@color)}" if @color
135
+ a << ",weight: #{MappingObject.javascriptify_variable(@weight)}" if @weight
136
+ a << ",opacity: #{MappingObject.javascriptify_variable(@opacity)}" if @opacity
137
+ a << "})"
138
+ end
139
+ end
140
+
141
+ #A basic Latitude/longitude point.
142
+ class GLatLng
143
+ include MappingObject
144
+ attr_accessor :lat,:lng,:unbounded
145
+
146
+ def initialize(latlng,unbounded = nil)
147
+ @lat = latlng[0]
148
+ @lng = latlng[1]
149
+ @unbounded = unbounded
150
+ end
151
+ def create
152
+ unless @unbounded
153
+ "new GLatLng(#{MappingObject.javascriptify_variable(@lat)},#{MappingObject.javascriptify_variable(@lng)})"
154
+ else
155
+ "new GLatLng(#{MappingObject.javascriptify_variable(@lat)},#{MappingObject.javascriptify_variable(@lng)},#{MappingObject.javascriptify_variable(@unbounded)})"
156
+ end
157
+ end
158
+ end
159
+
160
+ #A rectangular bounding box, defined by its south-western and north-eastern corners.
161
+ class GLatLngBounds < Struct.new(:sw,:ne)
162
+ include MappingObject
163
+ def create
164
+ "new GLatLngBounds(#{MappingObject.javascriptify_variable(sw)},#{MappingObject.javascriptify_variable(ne)})"
165
+ end
166
+ end
167
+
168
+ # Wrapper for the Google Maps GPolygon class. See the Google Maps API
169
+ # docs:
170
+ # http://code.google.com/apis/maps/documentation/reference.html#GPolygon
171
+ class GPolygon
172
+ include MappingObject
173
+
174
+ attr_accessor :points,:stroke_color,:stroke_weight,:stroke_opacity,:color,:opacity
175
+
176
+ #Can take an array of +GLatLng+ or an array of 2D arrays. A method to directly build a polygon from a GeoRuby polygon is provided in the helper.rb file.
177
+ def initialize(points,stroke_color="#000000",stroke_weight=1,stroke_opacity=1.0,color="#ff0000",opacity=1.0,encoded=false)
178
+ if !points.empty? and points[0].is_a?(Array)
179
+ @points = points.collect { |pt| GLatLng.new(pt) }
180
+ else
181
+ @points = points
182
+ end
183
+ @stroke_color = stroke_color
184
+ @stroke_weight = stroke_weight
185
+ @stroke_opacity = stroke_opacity
186
+ @color = color
187
+ @opacity = opacity
188
+ end
189
+
190
+ #Creates a new polygon
191
+ def create
192
+ a = "new GPolygon(#{MappingObject.javascriptify_variable(points)}"
193
+ a << ",#{MappingObject.javascriptify_variable(@stroke_color)}"
194
+ a << ",#{MappingObject.javascriptify_variable(@stroke_weight)}"
195
+ a << ",#{MappingObject.javascriptify_variable(@stroke_opacity)}"
196
+ a << ",#{MappingObject.javascriptify_variable(@color)}"
197
+ a << ",#{MappingObject.javascriptify_variable(@opacity)}"
198
+ a << ")"
199
+ end
200
+ end
201
+
202
+ #
203
+ # Wrapper class for Google Maps GPolygons created using the
204
+ # GPolygon.fromEncoded() factory method. Unlike a regular GPolygon, it
205
+ # creates a polygon from a string of specially encoded points, allowing
206
+ # complex polygons with multiple rings to be rendered. When creating a
207
+ # GPolygonEncoded, pass it GPolylineEncoded objects.
208
+ #
209
+ class GPolygonEncoded
210
+ include MappingObject
211
+
212
+ attr_accessor :polyline, :color, :opacity, :outline, :fill
213
+
214
+ def initialize(polylines,fill=true,color="#000000",opacity=0.5,outline=false)
215
+ #force polylines to be an array
216
+ if polylines.is_a? Array
217
+ @polylines = polylines
218
+ else
219
+ @polylines = [polylines]
220
+ end
221
+ @color = color
222
+ @fill = fill
223
+ @opacity = opacity
224
+ @outline = outline
225
+ end
226
+
227
+ #Creates a new polygon.
228
+ def create
229
+ polylines_for_polygon= []
230
+ @polylines.each do |p|
231
+ x = "{points: #{MappingObject.javascriptify_variable(p.points)},"
232
+ x << "levels: #{MappingObject.javascriptify_variable(p.levels)},"
233
+ x << "zoomFactor: #{MappingObject.javascriptify_variable(p.zoom_factor)},"
234
+ x << "numLevels: #{MappingObject.javascriptify_variable(p.num_levels)}"
235
+ x << ", color: #{MappingObject.javascriptify_variable(p.color)}" if p.color
236
+ x << ", weight: #{MappingObject.javascriptify_variable(p.weight)}" if p.weight
237
+ x << ", opacity: #{MappingObject.javascriptify_variable(p.opacity)}" if p.opacity
238
+ x << "}"
239
+ polylines_for_polygon << x
240
+ end
241
+
242
+ polylines_for_polygon = "[" + polylines_for_polygon.join(",") + "]"
243
+
244
+ a = "new GPolygon.fromEncoded({polylines: #{polylines_for_polygon},"
245
+ a << "fill: #{MappingObject.javascriptify_variable(@fill)},"
246
+ a << "color: #{MappingObject.javascriptify_variable(@color)},"
247
+ a << "opacity: #{MappingObject.javascriptify_variable(@opacity)},"
248
+ a << "outline: #{MappingObject.javascriptify_variable(@outline)}"
249
+ a << "})"
250
+ end
251
+ end
252
+
253
+ class ELabel
254
+ attr_accessor :point, :text, :style
255
+ include MappingObject
256
+
257
+ def initialize(point, text=nil, style=nil)
258
+ @point = point
259
+ @text = text
260
+ @style = style
261
+ end
262
+
263
+ def create
264
+ a = "new ELabel(#{MappingObject.javascriptify_variable(@point)}"
265
+ a << ",#{MappingObject.javascriptify_variable(@text)}" if @text
266
+ a << ",#{MappingObject.javascriptify_variable(@style)}" if @style
267
+ a << ")"
268
+ end
269
+ end
270
+
271
+
272
+ #A GGeoXml object gets data from a GeoRSS or KML feed and displays it. Use <tt>overlay_init</tt> to add it to a map at initialization time.
273
+ class GGeoXml
274
+ include MappingObject
275
+
276
+ attr_accessor :url
277
+
278
+ def initialize(url)
279
+ @url = url
280
+ end
281
+
282
+ def create
283
+ "new GGeoXml(#{MappingObject.javascriptify_variable(@url)})"
284
+ end
285
+
286
+ end
287
+
288
+ #A GOverlay representing a group of GMarkers. The GMarkers can be identified with an id, which can be used to show the info window of a specific marker, in reponse, for example, to a click on a link. The whole group can be shown on and off at once. It should be declared global at initialization time to be useful.
289
+ class GMarkerGroup
290
+ include MappingObject
291
+ attr_accessor :active, :markers, :markers_by_id
292
+
293
+ def initialize(active = true , markers = nil)
294
+ @active = active
295
+ @markers = []
296
+ @markers_by_id = {}
297
+ if markers.is_a?(Array)
298
+ @markers = markers
299
+ elsif markers.is_a?(Hash)
300
+ @markers_by_id = markers
301
+ end
302
+ end
303
+
304
+ def create
305
+ "new GMarkerGroup(#{MappingObject.javascriptify_variable(@active)},#{MappingObject.javascriptify_variable(@markers)},#{MappingObject.javascriptify_variable(@markers_by_id)})"
306
+ end
307
+ end
308
+
309
+ #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.
310
+ class GMarkerManager
311
+ include MappingObject
312
+
313
+ attr_accessor :map,:options,:managed_markers
314
+
315
+ #options can be <tt>:border_padding</tt>, <tt>:max_zoom</tt>, <tt>:track_markers</tt> and <tt>:managed_markers</tt>: managed_markers must be an array of ManagedMarker objects
316
+ def initialize(map, options = {})
317
+ @map = map
318
+ @managed_markers = Array(options.delete(:managed_markers)) #[] if nil
319
+ @options = options
320
+ end
321
+
322
+ def create
323
+ puts @options.inspect
324
+ "addMarkersToManager(new GMarkerManager(#{MappingObject.javascriptify_variable(@map)},#{MappingObject.javascriptify_variable(@options)}),#{MappingObject.javascriptify_variable(@managed_markers)})"
325
+ end
326
+
327
+ end
328
+
329
+ #A set of similarly managed markers: They share the same minZoom and maxZoom.
330
+ class ManagedMarker
331
+ include MappingObject
332
+
333
+ attr_accessor :markers,:min_zoom, :max_zoom
334
+
335
+ def initialize(markers,min_zoom,max_zoom = nil)
336
+ @markers = markers
337
+ @min_zoom = min_zoom
338
+ @max_zoom = max_zoom
339
+ end
340
+
341
+ def create
342
+ "new ManagedMarker(#{MappingObject.javascriptify_variable(@markers)},#{MappingObject.javascriptify_variable(@min_zoom)},#{MappingObject.javascriptify_variable(@max_zoom)})"
343
+ end
344
+
345
+ end
346
+
347
+ #Makes the link with the Clusterer2 library by Jef Poskanzer (slightly modified though). Is a GOverlay making clusters out of its GMarkers, so that GMarkers very close to each other appear as one when the zoom is low. When the zoom gets higher, the individual markers are drawn.
348
+ class Clusterer
349
+ include MappingObject
350
+ attr_accessor :markers,:icon, :max_visible_markers, :grid_size, :min_markers_per_cluster , :max_lines_per_info_box
351
+
352
+ def initialize(markers = [], options = {})
353
+ @markers = markers
354
+ @icon = options[:icon] || GIcon::DEFAULT
355
+ @max_visible_markers = options[:max_visible_markers] || 150
356
+ @grid_size = options[:grid_size] || 5
357
+ @min_markers_per_cluster = options[:min_markers_per_cluster] || 5
358
+ @max_lines_per_info_box = options[:max_lines_per_info_box] || 10
359
+ end
360
+
361
+ def create
362
+ js_marker = '[' + @markers.collect do |marker|
363
+ add_description(marker)
364
+ end.join(",") + ']'
365
+
366
+ "new Clusterer(#{js_marker},#{MappingObject.javascriptify_variable(@icon)},#{MappingObject.javascriptify_variable(@max_visible_markers)},#{MappingObject.javascriptify_variable(@grid_size)},#{MappingObject.javascriptify_variable(@min_markers_per_cluster)},#{MappingObject.javascriptify_variable(@max_lines_per_info_box)})"
367
+ end
368
+
369
+ private
370
+ def add_description(marker)
371
+ "addDescriptionToMarker(#{MappingObject.javascriptify_variable(marker)},#{MappingObject.javascriptify_variable(marker.options[:description] || marker.options[:title] || '')})"
372
+ end
373
+ end
374
+
375
+ #Makes the link with the MGeoRSS extension by Mikel Maron (a bit modified though). It lets you overlay on top of Google Maps the items present in a RSS feed that has GeoRss data. This data can be either in W3C Geo vocabulary or in the GeoRss Simple format. See http://georss.org to know more about GeoRss.
376
+ class GeoRssOverlay
377
+ include MappingObject
378
+ attr_accessor :url, :proxy, :icon, :options
379
+
380
+ #You can pass the following options:
381
+ #- <tt>:icon</tt>: An icon for the items of the feed. Defaults to the classic red balloon icon.
382
+ #- <tt>:proxy</tt>: An URL on your server where fetching the RSS feed will be taken care of.
383
+ #- <tt>:list_div</tt>: In case you want a list of all the markers, with a link on which you can click in order to display the info on the marker, use this option to indicate the ID of the div (that you must place yourself).
384
+ #- <tt>:list_item_class</tt>: class of the DIV containing each item of the list. Ignored if option <tt>:list_div</tt> is not set.
385
+ #- <tt>:limit</tt>: Maximum number of items to display on the map.
386
+ #- <tt>:content_div</tt>: Instead of having an info window appear, indicates the ID of the DIV where this info should be displayed.
387
+ def initialize(url, options = {})
388
+ @url = url
389
+ @icon = options.delete(:icon) || GIcon::DEFAULT
390
+ @proxy = options.delete(:proxy) || Variable::UNDEFINED
391
+ @options = options
392
+ end
393
+
394
+ def create
395
+ "new GeoRssOverlay(#{MappingObject.javascriptify_variable(@url)},#{MappingObject.javascriptify_variable(@icon)},#{MappingObject.javascriptify_variable(@proxy)},#{MappingObject.javascriptify_variable(@options)})"
396
+ end
397
+ end
398
+
399
+ end
400
+ end