Allow VectorSource to load and parse data

This adds url, data and parser options to the source, and makes
EPSG:4326 the default projection. It also adds a prepareFeatures
method, which is used to load/parse data once the target
projection is known.
This commit is contained in:
ahocevar
2013-07-17 11:24:34 +02:00
parent 63c4feb6db
commit f325046a95
4 changed files with 168 additions and 3 deletions

View File

@@ -499,6 +499,19 @@
* of `url` when the WMS supports multiple urls for GetMap requests.
*/
/**
* @typedef {Object} ol.source.VectorOptions
* @property {Array.<ol.Attribution>|undefined} attributions Attributions.
* @property {Object|string|undefined} data Data to parse.
* @property {ol.Extent|undefined} extent Extent.
* @property {string|undefined} logo Logo.
* @property {ol.parser.Parser} parser Parser instance to parse data
* provided as `data` or fetched from `url`.
* @property {ol.ProjectionLike|undefined} projection Projection. EPSG:4326
* is assumed if not defined.
* @property {string|undefined} url Server url providing the vector data.
*/
/**
* @typedef {Object} ol.source.VectorSource2Options
* @property {Array.<ol.Attribution>|undefined} attributions Attributions.