Class: Kamelopard::Feature
- Includes:
- Snippet
- Defined in:
- lib/kamelopard/classes.rb
Overview
Abstract class corresponding to KML’s Feature object.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#abstractView ⇒ Object
Abstract class.
-
#addressDetails ⇒ Object
Returns the value of attribute addressDetails.
-
#atom_author ⇒ Object
Abstract class.
-
#atom_link ⇒ Object
Abstract class.
-
#description ⇒ Object
Abstract class.
-
#extendedData ⇒ Object
Abstract class.
-
#metadata ⇒ Object
Abstract class.
-
#name ⇒ Object
Abstract class.
-
#open ⇒ Object
Abstract class.
-
#phoneNumber ⇒ Object
Abstract class.
-
#region ⇒ Object
Abstract class.
-
#snippet ⇒ Object
readonly
Returns the value of attribute snippet.
-
#styles ⇒ Object
Abstract class.
-
#styleSelector ⇒ Object
Abstract class.
-
#styleUrl ⇒ Object
Abstract class.
-
#timeprimitive ⇒ Object
Abstract class.
-
#visibility ⇒ Object
Abstract class.
Attributes included from Snippet
Attributes inherited from Object
Class Method Summary collapse
Instance Method Summary collapse
-
#hide ⇒ Object
Hides the object.
-
#initialize(name = nil, options = {}) ⇒ Feature
constructor
A new instance of Feature.
-
#show ⇒ Object
Shows the object.
- #styles_to_kml(elem) ⇒ Object
- #timespan ⇒ Object
- #timespan=(t) ⇒ Object
- #timestamp ⇒ Object
- #timestamp=(t) ⇒ Object
- #to_kml(elem = nil) {|elem| ... } ⇒ Object
Methods included from Snippet
Methods inherited from Object
Constructor Details
#initialize(name = nil, options = {}) ⇒ Feature
Returns a new instance of Feature.
578 579 580 581 582 583 584 |
# File 'lib/kamelopard/classes.rb', line 578 def initialize (name = nil, = {}) @visibility = true @open = false @styles = [] super @name = name unless name.nil? end |
Instance Attribute Details
#abstractView ⇒ Object
Abstract class
570 571 572 |
# File 'lib/kamelopard/classes.rb', line 570 def abstractView @abstractView end |
#addressDetails ⇒ Object
Returns the value of attribute addressDetails.
574 575 576 |
# File 'lib/kamelopard/classes.rb', line 574 def addressDetails @addressDetails end |
#atom_author ⇒ Object
Abstract class
570 571 572 |
# File 'lib/kamelopard/classes.rb', line 570 def @atom_author end |
#atom_link ⇒ Object
Abstract class
570 571 572 |
# File 'lib/kamelopard/classes.rb', line 570 def atom_link @atom_link end |
#description ⇒ Object
Abstract class
570 571 572 |
# File 'lib/kamelopard/classes.rb', line 570 def description @description end |
#extendedData ⇒ Object
Abstract class
570 571 572 |
# File 'lib/kamelopard/classes.rb', line 570 def extendedData @extendedData end |
#metadata ⇒ Object
Abstract class
570 571 572 |
# File 'lib/kamelopard/classes.rb', line 570 def @metadata end |
#name ⇒ Object
Abstract class
570 571 572 |
# File 'lib/kamelopard/classes.rb', line 570 def name @name end |
#open ⇒ Object
Abstract class
570 571 572 |
# File 'lib/kamelopard/classes.rb', line 570 def open @open end |
#phoneNumber ⇒ Object
Abstract class
570 571 572 |
# File 'lib/kamelopard/classes.rb', line 570 def phoneNumber @phoneNumber end |
#region ⇒ Object
Abstract class
570 571 572 |
# File 'lib/kamelopard/classes.rb', line 570 def region @region end |
#snippet ⇒ Object (readonly)
Returns the value of attribute snippet.
574 575 576 |
# File 'lib/kamelopard/classes.rb', line 574 def snippet @snippet end |
#styles ⇒ Object
Abstract class
570 571 572 |
# File 'lib/kamelopard/classes.rb', line 570 def styles @styles end |
#styleSelector ⇒ Object
Abstract class
570 571 572 |
# File 'lib/kamelopard/classes.rb', line 570 def styleSelector @styleSelector end |
#styleUrl ⇒ Object
Abstract class
570 571 572 |
# File 'lib/kamelopard/classes.rb', line 570 def styleUrl @styleUrl end |
#timeprimitive ⇒ Object
Abstract class
570 571 572 |
# File 'lib/kamelopard/classes.rb', line 570 def timeprimitive @timeprimitive end |
#visibility ⇒ Object
Abstract class
570 571 572 |
# File 'lib/kamelopard/classes.rb', line 570 def visibility @visibility end |
Class Method Details
.add_author(o, a) ⇒ Object
645 646 647 648 649 650 651 |
# File 'lib/kamelopard/classes.rb', line 645 def self.(o, a) e = XML::Node.new 'atom:name' e << a.to_s f = XML::Node.new 'atom:author' f << e o << f end |
Instance Method Details
#hide ⇒ Object
Hides the object. Note that this governs only whether the object is initially visible or invisible; to show or hide the feature dynamically during a tour, use an AnimatedUpdate object
599 600 601 |
# File 'lib/kamelopard/classes.rb', line 599 def hide @visibility = false end |
#show ⇒ Object
Shows the object. See note for hide() method
604 605 606 |
# File 'lib/kamelopard/classes.rb', line 604 def show @visibility = true end |
#styles_to_kml(elem) ⇒ Object
680 681 682 683 684 |
# File 'lib/kamelopard/classes.rb', line 680 def styles_to_kml(elem) @styles.each do |a| a.to_kml(elem) end end |
#timespan ⇒ Object
612 613 614 |
# File 'lib/kamelopard/classes.rb', line 612 def timespan @timeprimitive end |
#timespan=(t) ⇒ Object
620 621 622 |
# File 'lib/kamelopard/classes.rb', line 620 def timespan=(t) @timeprimitive = t end |
#timestamp ⇒ Object
608 609 610 |
# File 'lib/kamelopard/classes.rb', line 608 def @timeprimitive end |
#timestamp=(t) ⇒ Object
616 617 618 |
# File 'lib/kamelopard/classes.rb', line 616 def (t) @timeprimitive = t end |
#to_kml(elem = nil) {|elem| ... } ⇒ Object
653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 |
# File 'lib/kamelopard/classes.rb', line 653 def to_kml(elem = nil) elem = XML::Node.new 'Feature' if elem.nil? super elem Kamelopard.kml_array(elem, [ [@name, 'name'], [(@visibility.nil? || @visibility) ? 1 : 0, 'visibility'], [(! @open.nil? && @open) ? 1 : 0, 'open'], [@atom_author, lambda { |o| Feature.(o, @atom_author) }], [@atom_link, 'atom:link'], [@address, 'address'], [@addressDetails, 'xal:AddressDetails'], [@phoneNumber, 'phoneNumber'], [@description, 'description'], [@styleUrl, 'styleUrl'], [@styleSelector, lambda { |o| @styleSelector.to_kml(o) }], [@metadata, 'Metadata' ], [@extendedData, 'ExtendedData' ] ]) styles_to_kml(elem) snippet_to_kml(elem) unless @snippet_text.nil? @abstractView.to_kml(elem) unless @abstractView.nil? @timeprimitive.to_kml(elem) unless @timeprimitive.nil? @region.to_kml(elem) unless @region.nil? yield(elem) if block_given? elem end |