class Gpx2png::Layer
Attributes
coords[RW]
options[RW]
parent[RW]
Public Class Methods
new()
click to toggle source
# File lib/gpx2png/layer.rb, line 3 def initialize @coords = Array.new @options = Hash.new end
Public Instance Methods
add(lat, lon)
click to toggle source
# File lib/gpx2png/layer.rb, line 31 def add(lat, lon) logger.debug("Added coord #{lat.to_s.red},#{lon.to_s.red} for layer #{self.index.to_s.green}, count #{(@coords.size + 1).to_s.blue}") @coords << { lat: lat, lon: lon } end
coords=(_coords)
click to toggle source
# File lib/gpx2png/layer.rb, line 10 def coords=(_coords) logger.debug("Set #{_coords.size.to_s.red} for layer #{self.index.to_s.green}") @coords = _coords end
index()
click to toggle source
Number of this layer
# File lib/gpx2png/layer.rb, line 20 def index if @parent return parent.layers.index(self) end return nil end
logger()
click to toggle source
# File lib/gpx2png/layer.rb, line 27 def logger @parent.class.logger end