Fix TopoJSON return type and line string parsing
This commit is contained in:
committed by
Frederic Junod
parent
429a256fff
commit
9e6f35c62e
@@ -51,10 +51,11 @@ ol.format.TopoJSON.EXTENSIONS_ = ['.topojson'];
|
|||||||
* values indicate arcs need to be reversed.
|
* values indicate arcs need to be reversed.
|
||||||
* @param {Array.<Array.<ol.Coordinate>>} arcs Array of arcs (already
|
* @param {Array.<Array.<ol.Coordinate>>} arcs Array of arcs (already
|
||||||
* transformed).
|
* transformed).
|
||||||
* @return {Array.<Array.<ol.Coordinate>>} Coordinates array.
|
* @return {Array.<ol.Coordinate>} Coordinates array.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.TopoJSON.concatenateArcs_ = function(indices, arcs) {
|
ol.format.TopoJSON.concatenateArcs_ = function(indices, arcs) {
|
||||||
|
/** @type {Array.<ol.Coordinate>} */
|
||||||
var coordinates = [];
|
var coordinates = [];
|
||||||
var index, arc;
|
var index, arc;
|
||||||
var i, ii;
|
var i, ii;
|
||||||
@@ -133,7 +134,7 @@ ol.format.TopoJSON.readMultiPointGeometry_ = function(object, scale,
|
|||||||
*/
|
*/
|
||||||
ol.format.TopoJSON.readLineStringGeometry_ = function(object, arcs) {
|
ol.format.TopoJSON.readLineStringGeometry_ = function(object, arcs) {
|
||||||
var coordinates = ol.format.TopoJSON.concatenateArcs_(object.arcs, arcs);
|
var coordinates = ol.format.TopoJSON.concatenateArcs_(object.arcs, arcs);
|
||||||
return new ol.geom.LineString(goog.array.flatten(coordinates));
|
return new ol.geom.LineString(coordinates);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user