1

I have the below code in javacript using geoXML3 which successfully loads/parses and displays the KML file shown.

    var geoXml = new geoXML3.parser({map: map, singleInfoWindow: true});
    geoXml.parse('/myapp/resources/kml/fileone.kml'); 

The /myapp/resources/kml/ folder/uri however holds many KML files. How I can load/parse them all at once to display them all on the google map at once?

I can't simply name them all because they're going to be different for different installations of the application. Wildcard doesn't seem to work;

    var geoXml = new geoXML3.parser({map: map, singleInfoWindow: true});
    geoXml.parse('/myapp/resources/kml/*.kml'); 
geocodezip
  • 158,664
  • 13
  • 220
  • 245
Nick Foote
  • 2,425
  • 9
  • 36
  • 47
  • See this similar question: [List files in a directory using only javascript](http://stackoverflow.com/questions/2924935/list-files-in-a-directory-using-only-javascript) – geocodezip Feb 13 '13 at 15:22
  • Hmm yes I was aware of such similar questions, with the answer being "No/Can't". However it does seem the geoXML.parse call is able to do just this, but for one kml file. Just wanted to know if it possible to get all the kml files. – Nick Foote Feb 13 '13 at 15:45
  • Only if you can provide a list. geoxml3 is implemented in javascript, so can't do it without a provided list of files. If you provide an array of filenames (specific, no wildcards), it will open and parse them. – geocodezip Feb 13 '13 at 15:53
  • Ok, if you want to put that as an answer I'll flick you the accept. – Nick Foote Feb 13 '13 at 16:00

1 Answers1

1

geoxml3 can only open files if you can provide a list. geoxml3 is implemented in javascript, so it can't access the filesystem. If you provide an array of filenames (specific, no wildcards), it will open and parse them.

Community
  • 1
  • 1
geocodezip
  • 158,664
  • 13
  • 220
  • 245