Class: Kamelopard::NetworkLink

Inherits:
Feature show all
Defined in:
lib/kamelopard/classes.rb

Overview

Analogue of KML’s NetworkLink class

Instance Attribute Summary collapse

Attributes inherited from Feature

#abstractView, #addressDetails, #atom_author, #atom_link, #description, #extendedData, #metadata, #name, #open, #phoneNumber, #region, #snippet, #styleSelector, #styleUrl, #styles, #timeprimitive, #visibility

Attributes included from Snippet

#maxLines, #snippet_text

Attributes inherited from Object

#comment, #kml_id, #master_only

Instance Method Summary collapse

Methods inherited from Feature

add_author, #extended_data_to_kml, #hide, #show, #styles_to_kml, #timespan, #timespan=, #timestamp, #timestamp=

Methods included from Snippet

#snippet_to_kml

Methods inherited from Object

#_alternate_to_kml, #change, #master_only?, parse

Constructor Details

#initialize(href = '', options = {}) ⇒ NetworkLink

Returns a new instance of NetworkLink.



2555
2556
2557
2558
2559
2560
2561
2562
# File 'lib/kamelopard/classes.rb', line 2555

def initialize(href = '', options = {})
    super(( options[:name] || ''), options)
    @refreshMode ||= :onChange
    @viewRefreshMode ||= :never
    @link = Link.new(href, :refreshMode => @refreshMode, :viewRefreshMode => @viewRefreshMode)
    @refreshVisibility ||= 0
    @flyToView ||= 0
end

Instance Attribute Details

#flyToViewObject

Returns the value of attribute flyToView.



2553
2554
2555
# File 'lib/kamelopard/classes.rb', line 2553

def flyToView
  @flyToView
end

Returns the value of attribute link.



2553
2554
2555
# File 'lib/kamelopard/classes.rb', line 2553

def link
  @link
end

#refreshVisibilityObject

Returns the value of attribute refreshVisibility.



2553
2554
2555
# File 'lib/kamelopard/classes.rb', line 2553

def refreshVisibility
  @refreshVisibility
end

Instance Method Details

#hrefObject



2572
2573
2574
# File 'lib/kamelopard/classes.rb', line 2572

def href
    link.href
end

#href=(a) ⇒ Object



2584
2585
2586
# File 'lib/kamelopard/classes.rb', line 2584

def href=(a)
    link.href = a
end

#refreshModeObject



2564
2565
2566
# File 'lib/kamelopard/classes.rb', line 2564

def refreshMode
    link.refreshMode
end

#refreshMode=(a) ⇒ Object



2576
2577
2578
# File 'lib/kamelopard/classes.rb', line 2576

def refreshMode=(a)
    link.refreshMode = a
end

#to_kml(elem = nil) ⇒ Object



2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
# File 'lib/kamelopard/classes.rb', line 2588

def to_kml(elem = nil)
    e = XML::Node.new 'NetworkLink'
    super e
    @link.to_kml e
    Kamelopard.kml_array(e, [
        [@flyToView, 'flyToView'],
        [@refreshVisibility, 'refreshVisibility']
    ])
    elem << e unless elem.nil?
    e
end

#viewRefreshModeObject



2568
2569
2570
# File 'lib/kamelopard/classes.rb', line 2568

def viewRefreshMode
    link.viewRefreshMode
end

#viewRefreshMode=(a) ⇒ Object



2580
2581
2582
# File 'lib/kamelopard/classes.rb', line 2580

def viewRefreshMode=(a)
    link.viewRefreshMode = a
end