Add AsyncStringFeatureParser and use plain

XMLHttpRequest in the KML example

Since the content-type on github.io is application/octet-stream we need
to implement an Async string based parser interface in the KML parser.
Also use plain XmlHttpRequest in the example instead of jQuery Ajax since
the vector-features example also uses that.
This commit is contained in:
Bart van den Eijnden
2013-04-22 16:45:33 +02:00
parent d45a63ee5c
commit feb6c4c2d7
5 changed files with 58 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
goog.provide('ol.parser.AsyncObjectFeatureParser');
goog.provide('ol.parser.AsyncStringFeatureParser');
goog.provide('ol.parser.DomFeatureParser');
goog.provide('ol.parser.ObjectFeatureParser');
goog.provide('ol.parser.ReadFeaturesOptions');
@@ -56,6 +57,23 @@ ol.parser.StringFeatureParser.prototype.readFeaturesFromString =
/**
* @interface
*/
ol.parser.AsyncStringFeatureParser = function() {};
/**
* @param {string} data String data.
* @param {function(Array.<ol.Feature>)} callback Callback which is called
* after parsing.
* @param {ol.parser.ReadFeaturesOptions=} opt_options Feature reading options.
*/
ol.parser.AsyncStringFeatureParser.prototype.readFeaturesFromStringAsync =
goog.abstractMethod;
/**
* @interface
*/