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

@@ -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);