Add ol.source.GeoJSON
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
1
src/ol/source/geojsonsource.exports
Normal file
1
src/ol/source/geojsonsource.exports
Normal file
@@ -0,0 +1 @@
|
||||
@exportClass ol.source.GeoJSON ol.source.GeoJSONOptions
|
||||
32
src/ol/source/geojsonsource.js
Normal file
32
src/ol/source/geojsonsource.js
Normal 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);
|
||||
Reference in New Issue
Block a user