Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gem dependencies, make xmlns match latest KML format #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/kml/container.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module KML
# A Container is an abstract base class that holds one or more Features and allows the creation of nested hierarchies.
class Container < Feature

# Access the features in the container
attr_accessor :features
attr_accessor :plain_children

# Get the features in the container
def features
@features ||= []
Expand Down
7 changes: 6 additions & 1 deletion lib/kml_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ def objects
# Render the KML file
def render(xm=Builder::XmlMarkup.new(:indent => 2))
xm.instruct!
xm.kml(:xmlns => 'http://earth.google.com/kml/2.1'){
xmlnses = {}
xmlnses["xmlns".to_sym] = "http://www.opengis.net/kml/2.2"
xmlnses["xmlns:gx".to_sym] = "http://www.google.com/kml/ext/2.2"
xmlnses["xmlns:kml".to_sym] = "http://www.opengis.net/kml/2.2"
xmlnses["xmlns:atom".to_sym] = "http://www.w3.org/2005/Atom"
xm.kml(**xmlnses) {
objects.each { |o| o.render(xm) }
}
end
Expand Down
1 change: 0 additions & 1 deletion lib/ruby_kml.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'rubygems'
require 'builder'

require 'kml_file'
Expand Down
2 changes: 2 additions & 0 deletions ruby_kml.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ Gem::Specification.new do |s|
s.has_rdoc = false
s.authors = ["aeden, schleyfox, xaviershay, andykram, IanVaughan"]
s.files = Dir['**/**']

s.add_runtime_dependency "builder"
end