Add ol.source.GeoJSON

This commit is contained in:
Tom Payne
2013-12-04 18:37:19 +01:00
parent 28c7ecc014
commit df975aa558
3 changed files with 39 additions and 3 deletions

View File

@@ -479,11 +479,14 @@
/**
* @typedef {Object} ol.source.GeoJSONOptions
* @property {Array.<ol.Attribution>|undefined} attributions Attributions.
* @property {ol.proj.ProjectionLike} defaultProjection Default projection.
* @property {ol.Extent|undefined} extent Extent.
* @property {string|undefined} logo Logo.
* @property {GeoJSONObject|undefined} geoJSON Object.
* @property {GeoJSONObject|undefined} object Object.
* @property {ol.proj.ProjectionLike} projection Projection.
* @property {string|undefined} string String.
* @proprtty {string|undefined} url URL.
* @property {ol.proj.ProjectionLike} reprojectTo Re-project to.
* @property {string|undefined} text Text.
* @property {string|undefined} url URL.
*/
/**

View File

@@ -0,0 +1 @@
@exportClass ol.source.GeoJSON ol.source.GeoJSONOptions

View File

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