Class: MapPolygon

Inherits:
MapPath show all
Defined in:
lib/googlestaticmap.rb

Overview

A polygon to draw and fill on the map. Has the same properties as a path with the addition of a fill color. The points do not need to form a closed loop, the last point will automatically be joined the first point

Instance Attribute Summary collapse

Attributes inherited from MapPath

#color, #points, #weight

Instance Method Summary collapse

Methods inherited from MapPath

#to_s

Constructor Details

#initialize(attrs = {}) ⇒ MapPolygon

Returns a new instance of MapPolygon.



324
325
326
327
# File 'lib/googlestaticmap.rb', line 324

def initialize(attrs={})
  @points = []
  attrs.each {|k,v| self.send("#{k}=".to_sym,v)}
end

Instance Attribute Details

#fillcolorObject

Color to fill in, either as a 24-bit (example: color=0xFFFFCC), a 32-bit hexadecimal value (example: color=0xFFFFCCFF), or from the set brown, green, purple, yellow, blue, gray, orange, red, white When a 32-bit hex value is specified, the last two characters specify the 8-bit alpha transparency value. This value varies between 00 (completely transparent) and FF (completely opaque).



322
323
324
# File 'lib/googlestaticmap.rb', line 322

def fillcolor
  @fillcolor
end