Add TopoJSON source & use it in example

This commit is contained in:
Antoine Abt
2014-01-08 11:20:16 +01:00
parent 000e9ad82d
commit a69f62e238
3 changed files with 49 additions and 18 deletions
+1
View File
@@ -0,0 +1 @@
@exportSymbol ol.source.TopoJSON
+32
View File
@@ -0,0 +1,32 @@
goog.provide('ol.source.TopoJSON');
goog.require('ol.format.TopoJSON');
goog.require('ol.source.VectorFile');
/**
* @constructor
* @extends {ol.source.VectorFile}
* @param {olx.source.TopoJSONOptions=} opt_options Options.
*/
ol.source.TopoJSON = function(opt_options) {
var options = goog.isDef(opt_options) ? opt_options : {};
goog.base(this, {
attributions: options.attributions,
extent: options.extent,
format: new ol.format.TopoJSON({
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.TopoJSON, ol.source.VectorFile);