Rename _ol_format_TopoJSON_ to TopoJSON
This commit is contained in:
@@ -4,7 +4,7 @@ import GPX from '../src/ol/format/GPX.js';
|
|||||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||||
import IGC from '../src/ol/format/IGC.js';
|
import IGC from '../src/ol/format/IGC.js';
|
||||||
import KML from '../src/ol/format/KML.js';
|
import KML from '../src/ol/format/KML.js';
|
||||||
import _ol_format_TopoJSON_ from '../src/ol/format/TopoJSON.js';
|
import TopoJSON from '../src/ol/format/TopoJSON.js';
|
||||||
import _ol_interaction_ from '../src/ol/interaction.js';
|
import _ol_interaction_ from '../src/ol/interaction.js';
|
||||||
import DragAndDrop from '../src/ol/interaction/DragAndDrop.js';
|
import DragAndDrop from '../src/ol/interaction/DragAndDrop.js';
|
||||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||||
@@ -89,7 +89,7 @@ var dragAndDropInteraction = new DragAndDrop({
|
|||||||
GeoJSON,
|
GeoJSON,
|
||||||
IGC,
|
IGC,
|
||||||
KML,
|
KML,
|
||||||
_ol_format_TopoJSON_
|
TopoJSON
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import GPX from '../src/ol/format/GPX.js';
|
|||||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||||
import IGC from '../src/ol/format/IGC.js';
|
import IGC from '../src/ol/format/IGC.js';
|
||||||
import KML from '../src/ol/format/KML.js';
|
import KML from '../src/ol/format/KML.js';
|
||||||
import _ol_format_TopoJSON_ from '../src/ol/format/TopoJSON.js';
|
import TopoJSON from '../src/ol/format/TopoJSON.js';
|
||||||
import _ol_interaction_ from '../src/ol/interaction.js';
|
import _ol_interaction_ from '../src/ol/interaction.js';
|
||||||
import DragAndDrop from '../src/ol/interaction/DragAndDrop.js';
|
import DragAndDrop from '../src/ol/interaction/DragAndDrop.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
@@ -89,7 +89,7 @@ var dragAndDropInteraction = new DragAndDrop({
|
|||||||
GeoJSON,
|
GeoJSON,
|
||||||
IGC,
|
IGC,
|
||||||
KML,
|
KML,
|
||||||
_ol_format_TopoJSON_
|
TopoJSON
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_format_TopoJSON_ from '../src/ol/format/TopoJSON.js';
|
import TopoJSON from '../src/ol/format/TopoJSON.js';
|
||||||
import _ol_layer_VectorTile_ from '../src/ol/layer/VectorTile.js';
|
import _ol_layer_VectorTile_ from '../src/ol/layer/VectorTile.js';
|
||||||
import {fromLonLat} from '../src/ol/proj.js';
|
import {fromLonLat} from '../src/ol/proj.js';
|
||||||
import _ol_source_VectorTile_ from '../src/ol/source/VectorTile.js';
|
import _ol_source_VectorTile_ from '../src/ol/source/VectorTile.js';
|
||||||
@@ -64,7 +64,7 @@ var map = new _ol_Map_({
|
|||||||
source: new _ol_source_VectorTile_({
|
source: new _ol_source_VectorTile_({
|
||||||
attributions: '© OpenStreetMap contributors, Who’s On First, ' +
|
attributions: '© OpenStreetMap contributors, Who’s On First, ' +
|
||||||
'Natural Earth, and openstreetmapdata.com',
|
'Natural Earth, and openstreetmapdata.com',
|
||||||
format: new _ol_format_TopoJSON_({
|
format: new TopoJSON({
|
||||||
layerName: 'layer',
|
layerName: 'layer',
|
||||||
layers: ['water', 'roads', 'buildings']
|
layers: ['water', 'roads', 'buildings']
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import _ol_Map_ from '../src/ol/Map.js';
|
import _ol_Map_ from '../src/ol/Map.js';
|
||||||
import _ol_View_ from '../src/ol/View.js';
|
import _ol_View_ from '../src/ol/View.js';
|
||||||
import _ol_format_TopoJSON_ from '../src/ol/format/TopoJSON.js';
|
import TopoJSON from '../src/ol/format/TopoJSON.js';
|
||||||
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
|
||||||
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
import _ol_layer_Vector_ from '../src/ol/layer/Vector.js';
|
||||||
import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
|
import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
|
||||||
@@ -29,7 +29,7 @@ var style = new _ol_style_Style_({
|
|||||||
var vector = new _ol_layer_Vector_({
|
var vector = new _ol_layer_Vector_({
|
||||||
source: new _ol_source_Vector_({
|
source: new _ol_source_Vector_({
|
||||||
url: 'data/topojson/world-110m.json',
|
url: 'data/topojson/world-110m.json',
|
||||||
format: new _ol_format_TopoJSON_({
|
format: new TopoJSON({
|
||||||
// don't want to render the full world polygon (stored as 'land' layer),
|
// don't want to render the full world polygon (stored as 'land' layer),
|
||||||
// which repeats all countries
|
// which repeats all countries
|
||||||
layers: ['countries']
|
layers: ['countries']
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {get as getProjection} from '../proj.js';
|
|||||||
* @param {olx.format.TopoJSONOptions=} opt_options Options.
|
* @param {olx.format.TopoJSONOptions=} opt_options Options.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
var _ol_format_TopoJSON_ = function(opt_options) {
|
var TopoJSON = function(opt_options) {
|
||||||
|
|
||||||
var options = opt_options ? opt_options : {};
|
var options = opt_options ? opt_options : {};
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ var _ol_format_TopoJSON_ = function(opt_options) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_format_TopoJSON_, JSONFeature);
|
inherits(TopoJSON, JSONFeature);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -61,7 +61,7 @@ inherits(_ol_format_TopoJSON_, JSONFeature);
|
|||||||
* @return {Array.<ol.Coordinate>} Coordinates array.
|
* @return {Array.<ol.Coordinate>} Coordinates array.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_ol_format_TopoJSON_.concatenateArcs_ = function(indices, arcs) {
|
TopoJSON.concatenateArcs_ = function(indices, arcs) {
|
||||||
/** @type {Array.<ol.Coordinate>} */
|
/** @type {Array.<ol.Coordinate>} */
|
||||||
var coordinates = [];
|
var coordinates = [];
|
||||||
var index, arc;
|
var index, arc;
|
||||||
@@ -99,10 +99,10 @@ _ol_format_TopoJSON_.concatenateArcs_ = function(indices, arcs) {
|
|||||||
* @return {ol.geom.Point} Geometry.
|
* @return {ol.geom.Point} Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_ol_format_TopoJSON_.readPointGeometry_ = function(object, scale, translate) {
|
TopoJSON.readPointGeometry_ = function(object, scale, translate) {
|
||||||
var coordinates = object.coordinates;
|
var coordinates = object.coordinates;
|
||||||
if (scale && translate) {
|
if (scale && translate) {
|
||||||
_ol_format_TopoJSON_.transformVertex_(coordinates, scale, translate);
|
TopoJSON.transformVertex_(coordinates, scale, translate);
|
||||||
}
|
}
|
||||||
return new Point(coordinates);
|
return new Point(coordinates);
|
||||||
};
|
};
|
||||||
@@ -117,13 +117,13 @@ _ol_format_TopoJSON_.readPointGeometry_ = function(object, scale, translate) {
|
|||||||
* @return {ol.geom.MultiPoint} Geometry.
|
* @return {ol.geom.MultiPoint} Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_ol_format_TopoJSON_.readMultiPointGeometry_ = function(object, scale,
|
TopoJSON.readMultiPointGeometry_ = function(object, scale,
|
||||||
translate) {
|
translate) {
|
||||||
var coordinates = object.coordinates;
|
var coordinates = object.coordinates;
|
||||||
var i, ii;
|
var i, ii;
|
||||||
if (scale && translate) {
|
if (scale && translate) {
|
||||||
for (i = 0, ii = coordinates.length; i < ii; ++i) {
|
for (i = 0, ii = coordinates.length; i < ii; ++i) {
|
||||||
_ol_format_TopoJSON_.transformVertex_(coordinates[i], scale, translate);
|
TopoJSON.transformVertex_(coordinates[i], scale, translate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new MultiPoint(coordinates);
|
return new MultiPoint(coordinates);
|
||||||
@@ -138,8 +138,8 @@ _ol_format_TopoJSON_.readMultiPointGeometry_ = function(object, scale,
|
|||||||
* @return {ol.geom.LineString} Geometry.
|
* @return {ol.geom.LineString} Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_ol_format_TopoJSON_.readLineStringGeometry_ = function(object, arcs) {
|
TopoJSON.readLineStringGeometry_ = function(object, arcs) {
|
||||||
var coordinates = _ol_format_TopoJSON_.concatenateArcs_(object.arcs, arcs);
|
var coordinates = TopoJSON.concatenateArcs_(object.arcs, arcs);
|
||||||
return new LineString(coordinates);
|
return new LineString(coordinates);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -152,11 +152,11 @@ _ol_format_TopoJSON_.readLineStringGeometry_ = function(object, arcs) {
|
|||||||
* @return {ol.geom.MultiLineString} Geometry.
|
* @return {ol.geom.MultiLineString} Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_ol_format_TopoJSON_.readMultiLineStringGeometry_ = function(object, arcs) {
|
TopoJSON.readMultiLineStringGeometry_ = function(object, arcs) {
|
||||||
var coordinates = [];
|
var coordinates = [];
|
||||||
var i, ii;
|
var i, ii;
|
||||||
for (i = 0, ii = object.arcs.length; i < ii; ++i) {
|
for (i = 0, ii = object.arcs.length; i < ii; ++i) {
|
||||||
coordinates[i] = _ol_format_TopoJSON_.concatenateArcs_(object.arcs[i], arcs);
|
coordinates[i] = TopoJSON.concatenateArcs_(object.arcs[i], arcs);
|
||||||
}
|
}
|
||||||
return new MultiLineString(coordinates);
|
return new MultiLineString(coordinates);
|
||||||
};
|
};
|
||||||
@@ -170,11 +170,11 @@ _ol_format_TopoJSON_.readMultiLineStringGeometry_ = function(object, arcs) {
|
|||||||
* @return {ol.geom.Polygon} Geometry.
|
* @return {ol.geom.Polygon} Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_ol_format_TopoJSON_.readPolygonGeometry_ = function(object, arcs) {
|
TopoJSON.readPolygonGeometry_ = function(object, arcs) {
|
||||||
var coordinates = [];
|
var coordinates = [];
|
||||||
var i, ii;
|
var i, ii;
|
||||||
for (i = 0, ii = object.arcs.length; i < ii; ++i) {
|
for (i = 0, ii = object.arcs.length; i < ii; ++i) {
|
||||||
coordinates[i] = _ol_format_TopoJSON_.concatenateArcs_(object.arcs[i], arcs);
|
coordinates[i] = TopoJSON.concatenateArcs_(object.arcs[i], arcs);
|
||||||
}
|
}
|
||||||
return new Polygon(coordinates);
|
return new Polygon(coordinates);
|
||||||
};
|
};
|
||||||
@@ -188,7 +188,7 @@ _ol_format_TopoJSON_.readPolygonGeometry_ = function(object, arcs) {
|
|||||||
* @return {ol.geom.MultiPolygon} Geometry.
|
* @return {ol.geom.MultiPolygon} Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_ol_format_TopoJSON_.readMultiPolygonGeometry_ = function(object, arcs) {
|
TopoJSON.readMultiPolygonGeometry_ = function(object, arcs) {
|
||||||
var coordinates = [];
|
var coordinates = [];
|
||||||
var polyArray, ringCoords, j, jj;
|
var polyArray, ringCoords, j, jj;
|
||||||
var i, ii;
|
var i, ii;
|
||||||
@@ -198,7 +198,7 @@ _ol_format_TopoJSON_.readMultiPolygonGeometry_ = function(object, arcs) {
|
|||||||
ringCoords = [];
|
ringCoords = [];
|
||||||
for (j = 0, jj = polyArray.length; j < jj; ++j) {
|
for (j = 0, jj = polyArray.length; j < jj; ++j) {
|
||||||
// for each ring
|
// for each ring
|
||||||
ringCoords[j] = _ol_format_TopoJSON_.concatenateArcs_(polyArray[j], arcs);
|
ringCoords[j] = TopoJSON.concatenateArcs_(polyArray[j], arcs);
|
||||||
}
|
}
|
||||||
coordinates[i] = ringCoords;
|
coordinates[i] = ringCoords;
|
||||||
}
|
}
|
||||||
@@ -221,13 +221,13 @@ _ol_format_TopoJSON_.readMultiPolygonGeometry_ = function(object, arcs) {
|
|||||||
* @return {Array.<ol.Feature>} Array of features.
|
* @return {Array.<ol.Feature>} Array of features.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_ol_format_TopoJSON_.readFeaturesFromGeometryCollection_ = function(
|
TopoJSON.readFeaturesFromGeometryCollection_ = function(
|
||||||
collection, arcs, scale, translate, property, name, opt_options) {
|
collection, arcs, scale, translate, property, name, opt_options) {
|
||||||
var geometries = collection.geometries;
|
var geometries = collection.geometries;
|
||||||
var features = [];
|
var features = [];
|
||||||
var i, ii;
|
var i, ii;
|
||||||
for (i = 0, ii = geometries.length; i < ii; ++i) {
|
for (i = 0, ii = geometries.length; i < ii; ++i) {
|
||||||
features[i] = _ol_format_TopoJSON_.readFeatureFromGeometry_(
|
features[i] = TopoJSON.readFeatureFromGeometry_(
|
||||||
geometries[i], arcs, scale, translate, property, name, opt_options);
|
geometries[i], arcs, scale, translate, property, name, opt_options);
|
||||||
}
|
}
|
||||||
return features;
|
return features;
|
||||||
@@ -248,11 +248,11 @@ _ol_format_TopoJSON_.readFeaturesFromGeometryCollection_ = function(
|
|||||||
* @return {ol.Feature} Feature.
|
* @return {ol.Feature} Feature.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_ol_format_TopoJSON_.readFeatureFromGeometry_ = function(object, arcs,
|
TopoJSON.readFeatureFromGeometry_ = function(object, arcs,
|
||||||
scale, translate, property, name, opt_options) {
|
scale, translate, property, name, opt_options) {
|
||||||
var geometry;
|
var geometry;
|
||||||
var type = object.type;
|
var type = object.type;
|
||||||
var geometryReader = _ol_format_TopoJSON_.GEOMETRY_READERS_[type];
|
var geometryReader = TopoJSON.GEOMETRY_READERS_[type];
|
||||||
if ((type === 'Point') || (type === 'MultiPoint')) {
|
if ((type === 'Point') || (type === 'MultiPoint')) {
|
||||||
geometry = geometryReader(object, scale, translate);
|
geometry = geometryReader(object, scale, translate);
|
||||||
} else {
|
} else {
|
||||||
@@ -286,13 +286,13 @@ _ol_format_TopoJSON_.readFeatureFromGeometry_ = function(object, arcs,
|
|||||||
* @return {Array.<ol.Feature>} Features.
|
* @return {Array.<ol.Feature>} Features.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_format_TopoJSON_.prototype.readFeatures;
|
TopoJSON.prototype.readFeatures;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
_ol_format_TopoJSON_.prototype.readFeaturesFromObject = function(
|
TopoJSON.prototype.readFeaturesFromObject = function(
|
||||||
object, opt_options) {
|
object, opt_options) {
|
||||||
if (object.type == 'Topology') {
|
if (object.type == 'Topology') {
|
||||||
var topoJSONTopology = /** @type {TopoJSONTopology} */ (object);
|
var topoJSONTopology = /** @type {TopoJSONTopology} */ (object);
|
||||||
@@ -304,7 +304,7 @@ _ol_format_TopoJSON_.prototype.readFeaturesFromObject = function(
|
|||||||
}
|
}
|
||||||
var arcs = topoJSONTopology.arcs;
|
var arcs = topoJSONTopology.arcs;
|
||||||
if (transform) {
|
if (transform) {
|
||||||
_ol_format_TopoJSON_.transformArcs_(arcs, scale, translate);
|
TopoJSON.transformArcs_(arcs, scale, translate);
|
||||||
}
|
}
|
||||||
/** @type {Array.<ol.Feature>} */
|
/** @type {Array.<ol.Feature>} */
|
||||||
var features = [];
|
var features = [];
|
||||||
@@ -319,12 +319,12 @@ _ol_format_TopoJSON_.prototype.readFeaturesFromObject = function(
|
|||||||
feature = /** @type {TopoJSONGeometryCollection} */
|
feature = /** @type {TopoJSONGeometryCollection} */
|
||||||
(topoJSONFeatures[objectName]);
|
(topoJSONFeatures[objectName]);
|
||||||
features.push.apply(features,
|
features.push.apply(features,
|
||||||
_ol_format_TopoJSON_.readFeaturesFromGeometryCollection_(
|
TopoJSON.readFeaturesFromGeometryCollection_(
|
||||||
feature, arcs, scale, translate, property, objectName, opt_options));
|
feature, arcs, scale, translate, property, objectName, opt_options));
|
||||||
} else {
|
} else {
|
||||||
feature = /** @type {TopoJSONGeometry} */
|
feature = /** @type {TopoJSONGeometry} */
|
||||||
(topoJSONFeatures[objectName]);
|
(topoJSONFeatures[objectName]);
|
||||||
features.push(_ol_format_TopoJSON_.readFeatureFromGeometry_(
|
features.push(TopoJSON.readFeatureFromGeometry_(
|
||||||
feature, arcs, scale, translate, property, objectName, opt_options));
|
feature, arcs, scale, translate, property, objectName, opt_options));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -344,10 +344,10 @@ _ol_format_TopoJSON_.prototype.readFeaturesFromObject = function(
|
|||||||
* @param {Array.<number>} translate Translation for each dimension.
|
* @param {Array.<number>} translate Translation for each dimension.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_ol_format_TopoJSON_.transformArcs_ = function(arcs, scale, translate) {
|
TopoJSON.transformArcs_ = function(arcs, scale, translate) {
|
||||||
var i, ii;
|
var i, ii;
|
||||||
for (i = 0, ii = arcs.length; i < ii; ++i) {
|
for (i = 0, ii = arcs.length; i < ii; ++i) {
|
||||||
_ol_format_TopoJSON_.transformArc_(arcs[i], scale, translate);
|
TopoJSON.transformArc_(arcs[i], scale, translate);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -360,7 +360,7 @@ _ol_format_TopoJSON_.transformArcs_ = function(arcs, scale, translate) {
|
|||||||
* @param {Array.<number>} translate Translation for each dimension.
|
* @param {Array.<number>} translate Translation for each dimension.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_ol_format_TopoJSON_.transformArc_ = function(arc, scale, translate) {
|
TopoJSON.transformArc_ = function(arc, scale, translate) {
|
||||||
var x = 0;
|
var x = 0;
|
||||||
var y = 0;
|
var y = 0;
|
||||||
var vertex;
|
var vertex;
|
||||||
@@ -371,7 +371,7 @@ _ol_format_TopoJSON_.transformArc_ = function(arc, scale, translate) {
|
|||||||
y += vertex[1];
|
y += vertex[1];
|
||||||
vertex[0] = x;
|
vertex[0] = x;
|
||||||
vertex[1] = y;
|
vertex[1] = y;
|
||||||
_ol_format_TopoJSON_.transformVertex_(vertex, scale, translate);
|
TopoJSON.transformVertex_(vertex, scale, translate);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -385,7 +385,7 @@ _ol_format_TopoJSON_.transformArc_ = function(arc, scale, translate) {
|
|||||||
* @param {Array.<number>} translate Translation for each dimension.
|
* @param {Array.<number>} translate Translation for each dimension.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_ol_format_TopoJSON_.transformVertex_ = function(vertex, scale, translate) {
|
TopoJSON.transformVertex_ = function(vertex, scale, translate) {
|
||||||
vertex[0] = vertex[0] * scale[0] + translate[0];
|
vertex[0] = vertex[0] * scale[0] + translate[0];
|
||||||
vertex[1] = vertex[1] * scale[1] + translate[1];
|
vertex[1] = vertex[1] * scale[1] + translate[1];
|
||||||
};
|
};
|
||||||
@@ -399,13 +399,13 @@ _ol_format_TopoJSON_.transformVertex_ = function(vertex, scale, translate) {
|
|||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_format_TopoJSON_.prototype.readProjection;
|
TopoJSON.prototype.readProjection;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
_ol_format_TopoJSON_.prototype.readProjectionFromObject = function(object) {
|
TopoJSON.prototype.readProjectionFromObject = function(object) {
|
||||||
return this.defaultDataProjection;
|
return this.defaultDataProjection;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -415,13 +415,13 @@ _ol_format_TopoJSON_.prototype.readProjectionFromObject = function(object) {
|
|||||||
* @private
|
* @private
|
||||||
* @type {Object.<string, function(TopoJSONGeometry, Array, ...Array): ol.geom.Geometry>}
|
* @type {Object.<string, function(TopoJSONGeometry, Array, ...Array): ol.geom.Geometry>}
|
||||||
*/
|
*/
|
||||||
_ol_format_TopoJSON_.GEOMETRY_READERS_ = {
|
TopoJSON.GEOMETRY_READERS_ = {
|
||||||
'Point': _ol_format_TopoJSON_.readPointGeometry_,
|
'Point': TopoJSON.readPointGeometry_,
|
||||||
'LineString': _ol_format_TopoJSON_.readLineStringGeometry_,
|
'LineString': TopoJSON.readLineStringGeometry_,
|
||||||
'Polygon': _ol_format_TopoJSON_.readPolygonGeometry_,
|
'Polygon': TopoJSON.readPolygonGeometry_,
|
||||||
'MultiPoint': _ol_format_TopoJSON_.readMultiPointGeometry_,
|
'MultiPoint': TopoJSON.readMultiPointGeometry_,
|
||||||
'MultiLineString': _ol_format_TopoJSON_.readMultiLineStringGeometry_,
|
'MultiLineString': TopoJSON.readMultiLineStringGeometry_,
|
||||||
'MultiPolygon': _ol_format_TopoJSON_.readMultiPolygonGeometry_
|
'MultiPolygon': TopoJSON.readMultiPolygonGeometry_
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -429,33 +429,33 @@ _ol_format_TopoJSON_.GEOMETRY_READERS_ = {
|
|||||||
* Not implemented.
|
* Not implemented.
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
_ol_format_TopoJSON_.prototype.writeFeatureObject = function(feature, opt_options) {};
|
TopoJSON.prototype.writeFeatureObject = function(feature, opt_options) {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Not implemented.
|
* Not implemented.
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
_ol_format_TopoJSON_.prototype.writeFeaturesObject = function(features, opt_options) {};
|
TopoJSON.prototype.writeFeaturesObject = function(features, opt_options) {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Not implemented.
|
* Not implemented.
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
_ol_format_TopoJSON_.prototype.writeGeometryObject = function(geometry, opt_options) {};
|
TopoJSON.prototype.writeGeometryObject = function(geometry, opt_options) {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Not implemented.
|
* Not implemented.
|
||||||
* @override
|
* @override
|
||||||
*/
|
*/
|
||||||
_ol_format_TopoJSON_.prototype.readGeometryFromObject = function() {};
|
TopoJSON.prototype.readGeometryFromObject = function() {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Not implemented.
|
* Not implemented.
|
||||||
* @override
|
* @override
|
||||||
*/
|
*/
|
||||||
_ol_format_TopoJSON_.prototype.readFeatureFromObject = function() {};
|
TopoJSON.prototype.readFeatureFromObject = function() {};
|
||||||
export default _ol_format_TopoJSON_;
|
export default TopoJSON;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
|
|||||||
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
||||||
import FeatureFormat from '../../../../src/ol/format/Feature.js';
|
import FeatureFormat from '../../../../src/ol/format/Feature.js';
|
||||||
import {transform} from '../../../../src/ol/proj.js';
|
import {transform} from '../../../../src/ol/proj.js';
|
||||||
import _ol_format_TopoJSON_ from '../../../../src/ol/format/TopoJSON.js';
|
import TopoJSON from '../../../../src/ol/format/TopoJSON.js';
|
||||||
|
|
||||||
var aruba = {
|
var aruba = {
|
||||||
type: 'Topology',
|
type: 'Topology',
|
||||||
@@ -42,13 +42,13 @@ describe('ol.format.TopoJSON', function() {
|
|||||||
|
|
||||||
var format;
|
var format;
|
||||||
before(function() {
|
before(function() {
|
||||||
format = new _ol_format_TopoJSON_();
|
format = new TopoJSON();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('constructor', function() {
|
describe('constructor', function() {
|
||||||
it('creates a new format', function() {
|
it('creates a new format', function() {
|
||||||
expect(format).to.be.a(FeatureFormat);
|
expect(format).to.be.a(FeatureFormat);
|
||||||
expect(format).to.be.a(_ol_format_TopoJSON_);
|
expect(format).to.be.a(TopoJSON);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ describe('ol.format.TopoJSON', function() {
|
|||||||
|
|
||||||
it('sets the topology\'s child names as feature property', function(done) {
|
it('sets the topology\'s child names as feature property', function(done) {
|
||||||
afterLoadText('spec/ol/format/topojson/world-110m.json', function(text) {
|
afterLoadText('spec/ol/format/topojson/world-110m.json', function(text) {
|
||||||
var format = new _ol_format_TopoJSON_({
|
var format = new TopoJSON({
|
||||||
layerName: 'layer'
|
layerName: 'layer'
|
||||||
});
|
});
|
||||||
var features = format.readFeatures(text);
|
var features = format.readFeatures(text);
|
||||||
@@ -188,7 +188,7 @@ describe('ol.format.TopoJSON', function() {
|
|||||||
|
|
||||||
it('only parses features from specified topology\'s children', function(done) {
|
it('only parses features from specified topology\'s children', function(done) {
|
||||||
afterLoadText('spec/ol/format/topojson/world-110m.json', function(text) {
|
afterLoadText('spec/ol/format/topojson/world-110m.json', function(text) {
|
||||||
var format = new _ol_format_TopoJSON_({
|
var format = new TopoJSON({
|
||||||
layers: ['land']
|
layers: ['land']
|
||||||
});
|
});
|
||||||
var features = format.readFeatures(text);
|
var features = format.readFeatures(text);
|
||||||
|
|||||||
Reference in New Issue
Block a user