Class: KML::Snippet

Inherits:
Object
  • Object
show all
Defined in:
lib/kml/snippet.rb

Overview

A short description of a feature. In Google Earth, this description is displayed in the Places panel under the name of the feature. If a Snippet is not supplied, the first two lines of the description are used. In Google Earth, if a Placemark contains both a description and a Snippet, the Snippet appears beneath the Placemark in the Places panel, and the description appears in the Placemark’s description balloon. This object does not support HTML markup.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text, max_lines = nil) ⇒ Snippet

Initialize the snippet with the given text and optionally with the given max_lines value.



15
16
17
18
# File 'lib/kml/snippet.rb', line 15

def initialize(text, max_lines=nil)
  @text = text
  @max_lines = max_lines
end

Instance Attribute Details

#max_linesObject

The maximum number of lines to display. Default is 2



9
10
11
# File 'lib/kml/snippet.rb', line 9

def max_lines
  @max_lines
end

#textObject

The text that is displayed (HTML not supported)



12
13
14
# File 'lib/kml/snippet.rb', line 12

def text
  @text
end