Remove all remaining unnecessary casts
There is still such a cast in the goog library itself. See https://github.com/google/closure-library/pull/637
This commit is contained in:
@@ -105,8 +105,8 @@ ol.format.GML2.prototype.readBox_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Box', 'localName should be Box');
|
||||
var flatCoordinates = ol.xml.pushParseAndPop(
|
||||
/** @type {Array.<number>} */ ([null]),
|
||||
/** @type {Array.<number>} */
|
||||
var flatCoordinates = ol.xml.pushParseAndPop([null],
|
||||
this.BOX_PARSERS_, node, objectStack, this);
|
||||
return ol.extent.createOrUpdate(flatCoordinates[1][0],
|
||||
flatCoordinates[1][1], flatCoordinates[1][3],
|
||||
@@ -124,8 +124,8 @@ ol.format.GML2.prototype.innerBoundaryIsParser_ = function(node, objectStack) {
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'innerBoundaryIs',
|
||||
'localName should be innerBoundaryIs');
|
||||
var flatLinearRing = ol.xml.pushParseAndPop(
|
||||
/** @type {Array.<number>|undefined} */ (undefined),
|
||||
/** @type {Array.<number>|undefined} */
|
||||
var flatLinearRing = ol.xml.pushParseAndPop(undefined,
|
||||
this.RING_PARSERS, node, objectStack, this);
|
||||
if (flatLinearRing) {
|
||||
var flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||
@@ -149,8 +149,8 @@ ol.format.GML2.prototype.outerBoundaryIsParser_ = function(node, objectStack) {
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'outerBoundaryIs',
|
||||
'localName should be outerBoundaryIs');
|
||||
var flatLinearRing = ol.xml.pushParseAndPop(
|
||||
/** @type {Array.<number>|undefined} */ (undefined),
|
||||
/** @type {Array.<number>|undefined} */
|
||||
var flatLinearRing = ol.xml.pushParseAndPop(undefined,
|
||||
this.RING_PARSERS, node, objectStack, this);
|
||||
if (flatLinearRing) {
|
||||
var flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||
|
||||
@@ -98,8 +98,8 @@ ol.format.GML3.prototype.readMultiCurve_ = function(node, objectStack) {
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'MultiCurve',
|
||||
'localName should be MultiCurve');
|
||||
var lineStrings = ol.xml.pushParseAndPop(
|
||||
/** @type {Array.<ol.geom.LineString>} */ ([]),
|
||||
/** @type {Array.<ol.geom.LineString>} */
|
||||
var lineStrings = ol.xml.pushParseAndPop([],
|
||||
this.MULTICURVE_PARSERS_, node, objectStack, this);
|
||||
if (lineStrings) {
|
||||
var multiLineString = new ol.geom.MultiLineString(null);
|
||||
@@ -122,8 +122,8 @@ ol.format.GML3.prototype.readMultiSurface_ = function(node, objectStack) {
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'MultiSurface',
|
||||
'localName should be MultiSurface');
|
||||
var polygons = ol.xml.pushParseAndPop(
|
||||
/** @type {Array.<ol.geom.Polygon>} */ ([]),
|
||||
/** @type {Array.<ol.geom.Polygon>} */
|
||||
var polygons = ol.xml.pushParseAndPop([],
|
||||
this.MULTISURFACE_PARSERS_, node, objectStack, this);
|
||||
if (polygons) {
|
||||
var multiPolygon = new ol.geom.MultiPolygon(null);
|
||||
@@ -177,8 +177,7 @@ ol.format.GML3.prototype.readPatch_ = function(node, objectStack) {
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'patches',
|
||||
'localName should be patches');
|
||||
return ol.xml.pushParseAndPop(
|
||||
/** @type {Array.<Array.<number>>} */ ([null]),
|
||||
return ol.xml.pushParseAndPop([null],
|
||||
this.PATCHES_PARSERS_, node, objectStack, this);
|
||||
};
|
||||
|
||||
@@ -194,8 +193,7 @@ ol.format.GML3.prototype.readSegment_ = function(node, objectStack) {
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'segments',
|
||||
'localName should be segments');
|
||||
return ol.xml.pushParseAndPop(
|
||||
/** @type {Array.<number>} */ ([null]),
|
||||
return ol.xml.pushParseAndPop([null],
|
||||
this.SEGMENTS_PARSERS_, node, objectStack, this);
|
||||
};
|
||||
|
||||
@@ -211,8 +209,7 @@ ol.format.GML3.prototype.readPolygonPatch_ = function(node, objectStack) {
|
||||
'npde.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'PolygonPatch',
|
||||
'localName should be PolygonPatch');
|
||||
return ol.xml.pushParseAndPop(
|
||||
/** @type {Array.<Array.<number>>} */ ([null]),
|
||||
return ol.xml.pushParseAndPop([null],
|
||||
this.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack, this);
|
||||
};
|
||||
|
||||
@@ -228,8 +225,7 @@ ol.format.GML3.prototype.readLineStringSegment_ = function(node, objectStack) {
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'LineStringSegment',
|
||||
'localName should be LineStringSegment');
|
||||
return ol.xml.pushParseAndPop(
|
||||
/** @type {Array.<number>} */ ([null]),
|
||||
return ol.xml.pushParseAndPop([null],
|
||||
this.GEOMETRY_FLAT_COORDINATES_PARSERS_,
|
||||
node, objectStack, this);
|
||||
};
|
||||
@@ -245,8 +241,8 @@ ol.format.GML3.prototype.interiorParser_ = function(node, objectStack) {
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'interior',
|
||||
'localName should be interior');
|
||||
var flatLinearRing = ol.xml.pushParseAndPop(
|
||||
/** @type {Array.<number>|undefined} */ (undefined),
|
||||
/** @type {Array.<number>|undefined} */
|
||||
var flatLinearRing = ol.xml.pushParseAndPop(undefined,
|
||||
this.RING_PARSERS, node, objectStack, this);
|
||||
if (flatLinearRing) {
|
||||
var flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||
@@ -270,8 +266,8 @@ ol.format.GML3.prototype.exteriorParser_ = function(node, objectStack) {
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'exterior',
|
||||
'localName should be exterior');
|
||||
var flatLinearRing = ol.xml.pushParseAndPop(
|
||||
/** @type {Array.<number>|undefined} */ (undefined),
|
||||
/** @type {Array.<number>|undefined} */
|
||||
var flatLinearRing = ol.xml.pushParseAndPop(undefined,
|
||||
this.RING_PARSERS, node, objectStack, this);
|
||||
if (flatLinearRing) {
|
||||
var flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||
@@ -296,8 +292,8 @@ ol.format.GML3.prototype.readSurface_ = function(node, objectStack) {
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Surface',
|
||||
'localName should be Surface');
|
||||
var flatLinearRings = ol.xml.pushParseAndPop(
|
||||
/** @type {Array.<Array.<number>>} */ ([null]),
|
||||
/** @type {Array.<Array.<number>>} */
|
||||
var flatLinearRings = ol.xml.pushParseAndPop([null],
|
||||
this.SURFACE_PARSERS_, node, objectStack, this);
|
||||
if (flatLinearRings && flatLinearRings[0]) {
|
||||
var polygon = new ol.geom.Polygon(null);
|
||||
@@ -327,8 +323,8 @@ ol.format.GML3.prototype.readCurve_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Curve', 'localName should be Curve');
|
||||
var flatCoordinates = ol.xml.pushParseAndPop(
|
||||
/** @type {Array.<number>} */ ([null]),
|
||||
/** @type {Array.<number>} */
|
||||
var flatCoordinates = ol.xml.pushParseAndPop([null],
|
||||
this.CURVE_PARSERS_, node, objectStack, this);
|
||||
if (flatCoordinates) {
|
||||
var lineString = new ol.geom.LineString(null);
|
||||
@@ -351,8 +347,8 @@ ol.format.GML3.prototype.readEnvelope_ = function(node, objectStack) {
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Envelope',
|
||||
'localName should be Envelope');
|
||||
var flatCoordinates = ol.xml.pushParseAndPop(
|
||||
/** @type {Array.<number>} */ ([null]),
|
||||
/** @type {Array.<number>} */
|
||||
var flatCoordinates = ol.xml.pushParseAndPop([null],
|
||||
this.ENVELOPE_PARSERS_, node, objectStack, this);
|
||||
return ol.extent.createOrUpdate(flatCoordinates[1][0],
|
||||
flatCoordinates[1][1], flatCoordinates[2][0],
|
||||
|
||||
@@ -177,7 +177,8 @@ ol.format.GMLBase.prototype.readGeometryElement = function(node, objectStack) {
|
||||
var context = objectStack[0];
|
||||
goog.asserts.assert(goog.isObject(context), 'context should be an Object');
|
||||
context['srsName'] = node.firstElementChild.getAttribute('srsName');
|
||||
var geometry = ol.xml.pushParseAndPop(/** @type {ol.geom.Geometry} */(null),
|
||||
/** @type {ol.geom.Geometry} */
|
||||
var geometry = ol.xml.pushParseAndPop(null,
|
||||
this.GEOMETRY_PARSERS_, node, objectStack, this);
|
||||
if (geometry) {
|
||||
return /** @type {ol.geom.Geometry} */ (
|
||||
@@ -261,8 +262,8 @@ ol.format.GMLBase.prototype.readMultiPoint = function(node, objectStack) {
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'MultiPoint',
|
||||
'localName should be MultiPoint');
|
||||
var coordinates = ol.xml.pushParseAndPop(
|
||||
/** @type {Array.<Array.<number>>} */ ([]),
|
||||
/** @type {Array.<Array.<number>>} */
|
||||
var coordinates = ol.xml.pushParseAndPop([],
|
||||
this.MULTIPOINT_PARSERS_, node, objectStack, this);
|
||||
if (coordinates) {
|
||||
return new ol.geom.MultiPoint(coordinates);
|
||||
@@ -282,8 +283,8 @@ ol.format.GMLBase.prototype.readMultiLineString = function(node, objectStack) {
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'MultiLineString',
|
||||
'localName should be MultiLineString');
|
||||
var lineStrings = ol.xml.pushParseAndPop(
|
||||
/** @type {Array.<ol.geom.LineString>} */ ([]),
|
||||
/** @type {Array.<ol.geom.LineString>} */
|
||||
var lineStrings = ol.xml.pushParseAndPop([],
|
||||
this.MULTILINESTRING_PARSERS_, node, objectStack, this);
|
||||
if (lineStrings) {
|
||||
var multiLineString = new ol.geom.MultiLineString(null);
|
||||
@@ -305,8 +306,8 @@ ol.format.GMLBase.prototype.readMultiPolygon = function(node, objectStack) {
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'MultiPolygon',
|
||||
'localName should be MultiPolygon');
|
||||
var polygons = ol.xml.pushParseAndPop(
|
||||
/** @type {Array.<ol.geom.Polygon>} */ ([]),
|
||||
/** @type {Array.<ol.geom.Polygon>} */
|
||||
var polygons = ol.xml.pushParseAndPop([],
|
||||
this.MULTIPOLYGON_PARSERS_, node, objectStack, this);
|
||||
if (polygons) {
|
||||
var multiPolygon = new ol.geom.MultiPolygon(null);
|
||||
@@ -399,7 +400,7 @@ ol.format.GMLBase.prototype.readFlatLinearRing_ = function(node, objectStack) {
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'LinearRing',
|
||||
'localName should be LinearRing');
|
||||
var ring = ol.xml.pushParseAndPop(/** @type {Array.<number>} */(null),
|
||||
var ring = ol.xml.pushParseAndPop(null,
|
||||
this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node,
|
||||
objectStack, this);
|
||||
if (ring) {
|
||||
@@ -442,8 +443,8 @@ ol.format.GMLBase.prototype.readPolygon = function(node, objectStack) {
|
||||
'node.nodeType should be ELEMENT');
|
||||
goog.asserts.assert(node.localName == 'Polygon',
|
||||
'localName should be Polygon');
|
||||
var flatLinearRings = ol.xml.pushParseAndPop(
|
||||
/** @type {Array.<Array.<number>>} */ ([null]),
|
||||
/** @type {Array.<Array.<number>>} */
|
||||
var flatLinearRings = ol.xml.pushParseAndPop([null],
|
||||
this.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack, this);
|
||||
if (flatLinearRings && flatLinearRings[0]) {
|
||||
var polygon = new ol.geom.Polygon(null);
|
||||
@@ -472,10 +473,9 @@ ol.format.GMLBase.prototype.readPolygon = function(node, objectStack) {
|
||||
ol.format.GMLBase.prototype.readFlatCoordinatesFromNode_ = function(node, objectStack) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
'node.nodeType should be ELEMENT');
|
||||
return /** @type {Array.<number>} */ (ol.xml.pushParseAndPop(
|
||||
null,
|
||||
return ol.xml.pushParseAndPop(null,
|
||||
this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node,
|
||||
objectStack, this));
|
||||
objectStack, this);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user