Create KML in Ruby with ruby_kml and use in Javascript

المشرف العام

Administrator
طاقم الإدارة
i have a big problem and i have no idea how to solve it. I want to create a KML in Ruby an use it with Openlayers. But Openlayers only want a real kml file... It's complicated to explain. Just look at my Code:

In my Controller I have the following method for the KML:

def kmlrequire 'ruby_kml'kml = KMLFile.newfolder = KML::Folder.new:)name => 'Melbourne Stations')[ ["Berlin1", 52.520645, 13.409779], ["Berlin2", 52.520645, 13.409779], ["Berlin3", 13.409779, 52.520645],].each do |name, lat, lng| folder.features name, :geometry => KML::point.new:)coordinates => {:lat => lat, :lng => lng}) )endkml.objects
 
أعلى