Hoist var declaration
This commit is contained in:
@@ -89,13 +89,14 @@ ol.format.OSMXML.readWay_ = function(node, objectStack) {
|
||||
var point = goog.object.get(state.nodes, values.ndrefs[i]);
|
||||
goog.array.extend(flatCoordinates, point);
|
||||
}
|
||||
var geometry;
|
||||
if (values.ndrefs[0] == values.ndrefs[values.ndrefs.length - 1]) {
|
||||
// closed way
|
||||
var geometry = new ol.geom.Polygon(null);
|
||||
geometry = new ol.geom.Polygon(null);
|
||||
geometry.setFlatCoordinates(ol.geom.GeometryLayout.XY, flatCoordinates,
|
||||
[flatCoordinates.length]);
|
||||
} else {
|
||||
var geometry = new ol.geom.LineString(null);
|
||||
geometry = new ol.geom.LineString(null);
|
||||
geometry.setFlatCoordinates(ol.geom.GeometryLayout.XY, flatCoordinates);
|
||||
}
|
||||
var feature = new ol.Feature(geometry);
|
||||
|
||||
Reference in New Issue
Block a user