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?

Constructor Details

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

Returns a new instance of NetworkLink.



2372
2373
2374
2375
2376
2377
2378
2379
# File 'lib/kamelopard/classes.rb', line 2372

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.



2370
2371
2372
# File 'lib/kamelopard/classes.rb', line 2370

def flyToView
  @flyToView
end

Returns the value of attribute link.



2370
2371
2372
# File 'lib/kamelopard/classes.rb', line 2370

def link
  @link
end

#refreshVisibilityObject

Returns the value of attribute refreshVisibility.



2370
2371
2372
# File 'lib/kamelopard/classes.rb', line 2370

def refreshVisibility
  @refreshVisibility
end

Instance Method Details

#hrefObject



2389
2390
2391
# File 'lib/kamelopard/classes.rb', line 2389

def href
    link.href
end

#href=(a) ⇒ Object



2401
2402
2403
# File 'lib/kamelopard/classes.rb', line 2401

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

#refreshModeObject



2381
2382
2383
# File 'lib/kamelopard/classes.rb', line 2381

def refreshMode
    link.refreshMode
end

#refreshMode=(a) ⇒ Object



2393
2394
2395
# File 'lib/kamelopard/classes.rb', line 2393

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

#to_kml(elem = nil) ⇒ Object



2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
# File 'lib/kamelopard/classes.rb', line 2405

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



2385
2386
2387
# File 'lib/kamelopard/classes.rb', line 2385

def viewRefreshMode
    link.viewRefreshMode
end

#viewRefreshMode=(a) ⇒ Object



2397
2398
2399
# File 'lib/kamelopard/classes.rb', line 2397

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