Rename ol/objectutil.js to ol/obj.js
This commit is contained in:
@@ -15,7 +15,7 @@ goog.require('ol.geom.MultiPolygon');
|
||||
goog.require('ol.geom.Point');
|
||||
goog.require('ol.geom.Polygon');
|
||||
goog.require('ol.geom.flat.orient');
|
||||
goog.require('ol.object');
|
||||
goog.require('ol.obj');
|
||||
goog.require('ol.proj');
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ ol.format.EsriJSON.readGeometry_ = function(object, opt_options) {
|
||||
} else if (object.rings) {
|
||||
var layout = ol.format.EsriJSON.getGeometryLayout_(object);
|
||||
var rings = ol.format.EsriJSON.convertRings_(object.rings, layout);
|
||||
object = /** @type {EsriJSONGeometry} */(ol.object.assign({}, object));
|
||||
object = /** @type {EsriJSONGeometry} */(ol.obj.assign({}, object));
|
||||
if (rings.length === 1) {
|
||||
type = ol.geom.GeometryType.POLYGON;
|
||||
object.rings = rings[0];
|
||||
@@ -635,7 +635,7 @@ ol.format.EsriJSON.prototype.writeFeatureObject = function(
|
||||
}
|
||||
var properties = feature.getProperties();
|
||||
delete properties[feature.getGeometryName()];
|
||||
if (!ol.object.isEmpty(properties)) {
|
||||
if (!ol.obj.isEmpty(properties)) {
|
||||
object['attributes'] = properties;
|
||||
} else {
|
||||
object['attributes'] = {};
|
||||
|
||||
@@ -13,7 +13,7 @@ goog.require('ol.geom.MultiPoint');
|
||||
goog.require('ol.geom.MultiPolygon');
|
||||
goog.require('ol.geom.Point');
|
||||
goog.require('ol.geom.Polygon');
|
||||
goog.require('ol.object');
|
||||
goog.require('ol.obj');
|
||||
goog.require('ol.proj');
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ ol.format.GeoJSON.writeEmptyGeometryCollectionGeometry_ = function(geometry) {
|
||||
ol.format.GeoJSON.writeGeometryCollectionGeometry_ = function(
|
||||
geometry, opt_options) {
|
||||
var geometries = geometry.getGeometriesArray().map(function(geometry) {
|
||||
var options = ol.object.assign({}, opt_options);
|
||||
var options = ol.obj.assign({}, opt_options);
|
||||
delete options.featureProjection;
|
||||
return ol.format.GeoJSON.writeGeometry_(geometry, options);
|
||||
});
|
||||
@@ -526,7 +526,7 @@ ol.format.GeoJSON.prototype.writeFeatureObject = function(feature, opt_options)
|
||||
}
|
||||
var properties = feature.getProperties();
|
||||
delete properties[feature.getGeometryName()];
|
||||
if (!ol.object.isEmpty(properties)) {
|
||||
if (!ol.obj.isEmpty(properties)) {
|
||||
object.properties = properties;
|
||||
} else {
|
||||
object.properties = null;
|
||||
|
||||
@@ -15,7 +15,7 @@ goog.require('ol.geom.MultiLineString');
|
||||
goog.require('ol.geom.MultiPolygon');
|
||||
goog.require('ol.geom.Point');
|
||||
goog.require('ol.geom.Polygon');
|
||||
goog.require('ol.object');
|
||||
goog.require('ol.obj');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.xml');
|
||||
|
||||
@@ -984,7 +984,7 @@ ol.format.GML3.prototype.writeCurveSegments_ = function(node, line, objectStack)
|
||||
*/
|
||||
ol.format.GML3.prototype.writeGeometryElement = function(node, geometry, objectStack) {
|
||||
var context = /** @type {olx.format.WriteOptions} */ (objectStack[objectStack.length - 1]);
|
||||
var item = ol.object.assign({}, context);
|
||||
var item = ol.obj.assign({}, context);
|
||||
item.node = node;
|
||||
var value;
|
||||
if (Array.isArray(geometry)) {
|
||||
@@ -1042,7 +1042,7 @@ ol.format.GML3.prototype.writeFeatureElement = function(node, feature, objectSta
|
||||
}
|
||||
}
|
||||
}
|
||||
var item = ol.object.assign({}, context);
|
||||
var item = ol.obj.assign({}, context);
|
||||
item.node = node;
|
||||
ol.xml.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
|
||||
(item), context.serializers,
|
||||
@@ -1066,7 +1066,7 @@ ol.format.GML3.prototype.writeFeatureMembers_ = function(node, features, objectS
|
||||
serializers[featureNS] = {};
|
||||
serializers[featureNS][featureType] = ol.xml.makeChildAppender(
|
||||
this.writeFeatureElement, this);
|
||||
var item = ol.object.assign({}, context);
|
||||
var item = ol.obj.assign({}, context);
|
||||
item.node = node;
|
||||
ol.xml.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
|
||||
(item),
|
||||
@@ -1243,7 +1243,7 @@ ol.format.GML3.prototype.writeGeometryNode = function(geometry, opt_options) {
|
||||
curve: this.curve_, surface: this.surface_,
|
||||
multiSurface: this.multiSurface_, multiCurve: this.multiCurve_};
|
||||
if (opt_options) {
|
||||
ol.object.assign(context, opt_options);
|
||||
ol.obj.assign(context, opt_options);
|
||||
}
|
||||
this.writeGeometryElement(geom, geometry, [context]);
|
||||
return geom;
|
||||
@@ -1286,7 +1286,7 @@ ol.format.GML3.prototype.writeFeaturesNode = function(features, opt_options) {
|
||||
featureType: this.featureType
|
||||
};
|
||||
if (opt_options) {
|
||||
ol.object.assign(context, opt_options);
|
||||
ol.obj.assign(context, opt_options);
|
||||
}
|
||||
this.writeFeatureMembers_(node, features, [context]);
|
||||
return node;
|
||||
|
||||
@@ -16,7 +16,7 @@ goog.require('ol.geom.MultiPoint');
|
||||
goog.require('ol.geom.MultiPolygon');
|
||||
goog.require('ol.geom.Point');
|
||||
goog.require('ol.geom.Polygon');
|
||||
goog.require('ol.object');
|
||||
goog.require('ol.obj');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.xml');
|
||||
|
||||
@@ -629,7 +629,7 @@ ol.format.GMLBase.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
featureNS: this.featureNS
|
||||
};
|
||||
if (opt_options) {
|
||||
ol.object.assign(options, this.getReadOptions(node, opt_options));
|
||||
ol.obj.assign(options, this.getReadOptions(node, opt_options));
|
||||
}
|
||||
var features = this.readFeaturesInternal(node, [options]);
|
||||
return features || [];
|
||||
|
||||
@@ -25,7 +25,7 @@ goog.require('ol.geom.MultiPolygon');
|
||||
goog.require('ol.geom.Point');
|
||||
goog.require('ol.geom.Polygon');
|
||||
goog.require('ol.math');
|
||||
goog.require('ol.object');
|
||||
goog.require('ol.obj');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.style.Fill');
|
||||
goog.require('ol.style.Icon');
|
||||
@@ -311,7 +311,7 @@ ol.format.KML.createNameStyleFunction_ = function(foundStyle, name) {
|
||||
textAlign = 'left';
|
||||
}
|
||||
}
|
||||
if (!ol.object.isEmpty(foundStyle.getText())) {
|
||||
if (!ol.obj.isEmpty(foundStyle.getText())) {
|
||||
textStyle = /** @type {ol.style.Text} */
|
||||
(goog.object.clone(foundStyle.getText()));
|
||||
textStyle.setText(name);
|
||||
|
||||
@@ -9,7 +9,7 @@ goog.require('ol.geom.GeometryLayout');
|
||||
goog.require('ol.geom.LineString');
|
||||
goog.require('ol.geom.Point');
|
||||
goog.require('ol.geom.Polygon');
|
||||
goog.require('ol.object');
|
||||
goog.require('ol.obj');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.xml');
|
||||
|
||||
@@ -72,7 +72,7 @@ ol.format.OSMXML.readNode_ = function(node, objectStack) {
|
||||
var values = ol.xml.pushParseAndPop({
|
||||
tags: {}
|
||||
}, ol.format.OSMXML.NODE_PARSERS_, node, objectStack);
|
||||
if (!ol.object.isEmpty(values.tags)) {
|
||||
if (!ol.obj.isEmpty(values.tags)) {
|
||||
var geometry = new ol.geom.Point(coordinates);
|
||||
ol.format.Feature.transformWithOptions(geometry, false, options);
|
||||
var feature = new ol.Feature(geometry);
|
||||
|
||||
@@ -9,7 +9,7 @@ goog.require('ol.geom.MultiPoint');
|
||||
goog.require('ol.geom.MultiPolygon');
|
||||
goog.require('ol.geom.Point');
|
||||
goog.require('ol.geom.Polygon');
|
||||
goog.require('ol.object');
|
||||
goog.require('ol.obj');
|
||||
goog.require('ol.proj');
|
||||
|
||||
|
||||
@@ -297,7 +297,7 @@ ol.format.TopoJSON.prototype.readFeaturesFromObject = function(
|
||||
}
|
||||
/** @type {Array.<ol.Feature>} */
|
||||
var features = [];
|
||||
var topoJSONFeatures = ol.object.getValues(topoJSONTopology.objects);
|
||||
var topoJSONFeatures = ol.obj.getValues(topoJSONTopology.objects);
|
||||
var i, ii;
|
||||
var feature;
|
||||
for (i = 0, ii = topoJSONFeatures.length; i < ii; ++i) {
|
||||
|
||||
@@ -15,7 +15,7 @@ goog.require('ol.format.ogc.filter.IsLike');
|
||||
goog.require('ol.format.XMLFeature');
|
||||
goog.require('ol.format.XSD');
|
||||
goog.require('ol.geom.Geometry');
|
||||
goog.require('ol.object');
|
||||
goog.require('ol.obj');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.xml');
|
||||
|
||||
@@ -109,7 +109,7 @@ ol.format.WFS.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
'featureType': this.featureType_,
|
||||
'featureNS': this.featureNS_
|
||||
});
|
||||
ol.object.assign(context, this.getReadOptions(node,
|
||||
ol.obj.assign(context, this.getReadOptions(node,
|
||||
opt_options ? opt_options : {}));
|
||||
var objectStack = [context];
|
||||
this.gmlFormat_.FEATURE_COLLECTION_PARSERS[ol.format.GMLBase.GMLNS][
|
||||
@@ -526,7 +526,7 @@ ol.format.WFS.writeQuery_ = function(node, featureType, objectStack) {
|
||||
ol.xml.setAttributeNS(node, ol.format.WFS.XMLNS, 'xmlns:' + featurePrefix,
|
||||
featureNS);
|
||||
}
|
||||
var item = /** @type {ol.XmlNodeStackItem} */ (ol.object.assign({}, context));
|
||||
var item = /** @type {ol.XmlNodeStackItem} */ (ol.obj.assign({}, context));
|
||||
item.node = node;
|
||||
ol.xml.pushSerializeAndPop(item,
|
||||
ol.format.WFS.QUERY_SERIALIZERS_,
|
||||
@@ -767,7 +767,7 @@ ol.format.WFS.GETFEATURE_SERIALIZERS_ = {
|
||||
*/
|
||||
ol.format.WFS.writeGetFeature_ = function(node, featureTypes, objectStack) {
|
||||
var context = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
var item = /** @type {ol.XmlNodeStackItem} */ (ol.object.assign({}, context));
|
||||
var item = /** @type {ol.XmlNodeStackItem} */ (ol.obj.assign({}, context));
|
||||
item.node = node;
|
||||
ol.xml.pushSerializeAndPop(item,
|
||||
ol.format.WFS.GETFEATURE_SERIALIZERS_,
|
||||
@@ -873,7 +873,7 @@ ol.format.WFS.prototype.writeTransaction = function(inserts, updates, deletes,
|
||||
obj = {node: node, 'featureNS': options.featureNS,
|
||||
'featureType': options.featureType, 'featurePrefix': options.featurePrefix,
|
||||
'srsName': options.srsName};
|
||||
ol.object.assign(obj, baseObj);
|
||||
ol.obj.assign(obj, baseObj);
|
||||
ol.xml.pushSerializeAndPop(obj,
|
||||
ol.format.WFS.TRANSACTION_SERIALIZERS_,
|
||||
ol.xml.makeSimpleNodeFactory('Insert'), inserts,
|
||||
@@ -883,7 +883,7 @@ ol.format.WFS.prototype.writeTransaction = function(inserts, updates, deletes,
|
||||
obj = {node: node, 'featureNS': options.featureNS,
|
||||
'featureType': options.featureType, 'featurePrefix': options.featurePrefix,
|
||||
'srsName': options.srsName};
|
||||
ol.object.assign(obj, baseObj);
|
||||
ol.obj.assign(obj, baseObj);
|
||||
ol.xml.pushSerializeAndPop(obj,
|
||||
ol.format.WFS.TRANSACTION_SERIALIZERS_,
|
||||
ol.xml.makeSimpleNodeFactory('Update'), updates,
|
||||
|
||||
@@ -3,7 +3,7 @@ goog.provide('ol.format.WMSGetFeatureInfo');
|
||||
goog.require('ol.array');
|
||||
goog.require('ol.format.GML2');
|
||||
goog.require('ol.format.XMLFeature');
|
||||
goog.require('ol.object');
|
||||
goog.require('ol.obj');
|
||||
goog.require('ol.xml');
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ ol.format.WMSGetFeatureInfo.prototype.readFeatures;
|
||||
ol.format.WMSGetFeatureInfo.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
var options = {};
|
||||
if (opt_options) {
|
||||
ol.object.assign(options, this.getReadOptions(node, opt_options));
|
||||
ol.obj.assign(options, this.getReadOptions(node, opt_options));
|
||||
}
|
||||
return this.readFeatures_(node, [options]);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user