Hi, Try:
var format = new OpenLayers.Format.KML({ extractStyles: true, extractAttributes: true, maxDepth: 2 }); var features = format.read("your kml text"); See: http://openlayers.org/dev/examples/vector-formats.html Regards, Ailin wrote > Hello, > > I'm looking for a way to import a kml file via html5 input type file and > render it on my map. > I've found a lot of examples but all of them are using a predetermined > url, for example : > > The problem is i want my program to be able to render files that users > select themselves but all the examples i found require an URL which i > can't have with HTML5 input type file (security restriction). > > Thank you for your time and help -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Drawing-user-selected-kml-files-tp5044077p5044113.html Sent from the OpenLayers Dev mailing list archive at Nabble.com. _______________________________________________ Dev mailing list d...@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/openlayers-dev