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:
@@ -486,8 +486,8 @@ ol.format.GPX.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
return [];
|
||||
}
|
||||
if (node.localName == 'gpx') {
|
||||
var features = ol.xml.pushParseAndPop(
|
||||
/** @type {Array.<ol.Feature>} */ ([]), ol.format.GPX.GPX_PARSERS_,
|
||||
/** @type {Array.<ol.Feature>} */
|
||||
var features = ol.xml.pushParseAndPop([], ol.format.GPX.GPX_PARSERS_,
|
||||
node, [this.getReadOptions(node, opt_options)]);
|
||||
if (features) {
|
||||
this.handleReadExtensions_(features);
|
||||
@@ -600,7 +600,7 @@ ol.format.GPX.writeRte_ = function(node, feature, objectStack) {
|
||||
var parentNode = objectStack[objectStack.length - 1].node;
|
||||
var orderedKeys = ol.format.GPX.RTE_SEQUENCE_[parentNode.namespaceURI];
|
||||
var values = ol.xml.makeSequence(properties, orderedKeys);
|
||||
ol.xml.pushSerializeAndPop(/** @type {ol.xml.NodeStackItem} */ (context),
|
||||
ol.xml.pushSerializeAndPop(context,
|
||||
ol.format.GPX.RTE_SERIALIZERS_, ol.xml.OBJECT_PROPERTY_NODE_FACTORY,
|
||||
values, objectStack, orderedKeys);
|
||||
};
|
||||
@@ -615,6 +615,7 @@ ol.format.GPX.writeRte_ = function(node, feature, objectStack) {
|
||||
ol.format.GPX.writeTrk_ = function(node, feature, objectStack) {
|
||||
var options = /** @type {olx.format.WriteOptions} */ (objectStack[0]);
|
||||
var properties = feature.getProperties();
|
||||
/** @type {ol.xml.NodeStackItem} */
|
||||
var context = {node: node, 'properties': properties};
|
||||
var geometry = feature.getGeometry();
|
||||
if (geometry) {
|
||||
@@ -627,7 +628,7 @@ ol.format.GPX.writeTrk_ = function(node, feature, objectStack) {
|
||||
var parentNode = objectStack[objectStack.length - 1].node;
|
||||
var orderedKeys = ol.format.GPX.TRK_SEQUENCE_[parentNode.namespaceURI];
|
||||
var values = ol.xml.makeSequence(properties, orderedKeys);
|
||||
ol.xml.pushSerializeAndPop(/** @type {ol.xml.NodeStackItem} */ (context),
|
||||
ol.xml.pushSerializeAndPop(context,
|
||||
ol.format.GPX.TRK_SERIALIZERS_, ol.xml.OBJECT_PROPERTY_NODE_FACTORY,
|
||||
values, objectStack, orderedKeys);
|
||||
};
|
||||
@@ -640,9 +641,10 @@ ol.format.GPX.writeTrk_ = function(node, feature, objectStack) {
|
||||
* @private
|
||||
*/
|
||||
ol.format.GPX.writeTrkSeg_ = function(node, lineString, objectStack) {
|
||||
/** @type {ol.xml.NodeStackItem} */
|
||||
var context = {node: node, 'geometryLayout': lineString.getLayout(),
|
||||
'properties': {}};
|
||||
ol.xml.pushSerializeAndPop(/** @type {ol.xml.NodeStackItem} */ (context),
|
||||
ol.xml.pushSerializeAndPop(context,
|
||||
ol.format.GPX.TRKSEG_SERIALIZERS_, ol.format.GPX.TRKSEG_NODE_FACTORY_,
|
||||
lineString.getCoordinates(), objectStack);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user