Add ol.source.KML

This commit is contained in:
Tom Payne
2013-12-18 20:06:28 +01:00
parent 1d8f81d637
commit 904578f694
3 changed files with 45 additions and 0 deletions

View File

@@ -536,6 +536,19 @@
* @property {Object|undefined} params Additional parameters.
*/
/**
* @typedef {Object} olx.source.KMLOptions
* @property {Array.<ol.Attribution>|undefined} attributions Attributions.
* @property {Document|undefined} doc Document.
* @property {ol.Extent|undefined} extent Extent.
* @property {string|undefined} logo Logo.
* @property {Node|undefined| node Node.
* @property {ol.proj.ProjectionLike} projection Projection.
* @property {ol.proj.ProjectionLike} reprojectTo Re-project to.
* @property {string|undefined} text Text.
* @property {string|undefined} url URL.
*/
/**
* @typedef {Object} olx.source.MapQuestOptions
* @property {ol.TileLoadFunctionType|undefined} tileLoadFunction Optional

View File

@@ -0,0 +1 @@
@exportSymbol ol.source.KML

View File

@@ -0,0 +1,31 @@
goog.provide('ol.source.KML');
goog.require('ol.format.KML');
goog.require('ol.source.VectorFile');
/**
* @constructor
* @extends {ol.source.VectorFile}
* @param {olx.source.KMLOptions=} opt_options Options.
*/
ol.source.KML = function(opt_options) {
var options = goog.isDef(opt_options) ? opt_options : {};
goog.base(this, {
attributions: options.attributions,
doc: options.doc,
extent: options.extent,
format: new ol.format.KML(),
logo: options.logo,
node: options.node,
projection: options.projection,
reprojectTo: options.reprojectTo,
text: options.text,
url: options.url
});
};
goog.inherits(ol.source.KML, ol.source.VectorFile);