Class: Mapbox::Overlay::Path

Inherits:
Base
  • Object
show all
Defined in:
lib/mapbox/overlay/path.rb

Overview

Path class

Instance Method Summary collapse

Methods inherited from Base

add, #initialize

Constructor Details

This class inherits a constructor from Mapbox::Overlay::Base

Instance Method Details

#arguments_checkObject



5
6
7
# File 'lib/mapbox/overlay/path.rb', line 5

def arguments_check
  fail ArgumentError, ':polyline not found' if @polyline.nil?
end

#generate_overlayObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/mapbox/overlay/path.rb', line 9

def generate_overlay
  oly = []
  oly << 'path'
  oly << "-#{@size}" unless @size.nil?
  oly << "+#{@strokecolor}" unless @strokecolor.nil?
  oly << "-#{@strokeopacity}" unless @strokeopacity.nil?
  oly << "+#{@fillcolor}" unless @fillcolor.nil?
  oly << "-#{@fillopacity}" unless @fillopacity.nil?

  oly << "(#{@polyline})"
  oly.join
end