Remove use of goog.isString()
This commit is contained in:
@@ -106,7 +106,7 @@ ol.color.asArray = function(color) {
|
|||||||
if (goog.isArray(color)) {
|
if (goog.isArray(color)) {
|
||||||
return color;
|
return color;
|
||||||
} else {
|
} else {
|
||||||
goog.asserts.assert(goog.isString(color), 'Color should be a string');
|
goog.asserts.assert(typeof color === 'string', 'Color should be a string');
|
||||||
return ol.color.fromString(color);
|
return ol.color.fromString(color);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -119,7 +119,7 @@ ol.color.asArray = function(color) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
ol.color.asString = function(color) {
|
ol.color.asString = function(color) {
|
||||||
if (goog.isString(color)) {
|
if (typeof color === 'string') {
|
||||||
return color;
|
return color;
|
||||||
} else {
|
} else {
|
||||||
goog.asserts.assert(goog.isArray(color), 'Color should be an array');
|
goog.asserts.assert(goog.isArray(color), 'Color should be an array');
|
||||||
@@ -322,10 +322,10 @@ ol.color.stringOrColorEquals = function(color1, color2) {
|
|||||||
if (color1 === color2 || color1 == color2) {
|
if (color1 === color2 || color1 == color2) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (goog.isString(color1)) {
|
if (typeof color1 === 'string') {
|
||||||
color1 = ol.color.fromString(color1);
|
color1 = ol.color.fromString(color1);
|
||||||
}
|
}
|
||||||
if (goog.isString(color2)) {
|
if (typeof color2 === 'string') {
|
||||||
color2 = ol.color.fromString(color2);
|
color2 = ol.color.fromString(color2);
|
||||||
}
|
}
|
||||||
return ol.color.equals(color1, color2);
|
return ol.color.equals(color1, color2);
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ ol.control.Attribution = function(opt_options) {
|
|||||||
* @private
|
* @private
|
||||||
* @type {Node}
|
* @type {Node}
|
||||||
*/
|
*/
|
||||||
this.collapseLabel_ = goog.isString(collapseLabel) ?
|
this.collapseLabel_ = typeof collapseLabel === 'string' ?
|
||||||
goog.dom.createDom('SPAN', {}, collapseLabel) :
|
goog.dom.createDom('SPAN', {}, collapseLabel) :
|
||||||
collapseLabel;
|
collapseLabel;
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ ol.control.Attribution = function(opt_options) {
|
|||||||
* @private
|
* @private
|
||||||
* @type {Node}
|
* @type {Node}
|
||||||
*/
|
*/
|
||||||
this.label_ = goog.isString(label) ?
|
this.label_ = typeof label === 'string' ?
|
||||||
goog.dom.createDom('SPAN', {}, label) :
|
goog.dom.createDom('SPAN', {}, label) :
|
||||||
label;
|
label;
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ ol.control.FullScreen = function(opt_options) {
|
|||||||
* @private
|
* @private
|
||||||
* @type {Node}
|
* @type {Node}
|
||||||
*/
|
*/
|
||||||
this.labelNode_ = goog.isString(label) ?
|
this.labelNode_ = typeof label === 'string' ?
|
||||||
document.createTextNode(label) : label;
|
document.createTextNode(label) : label;
|
||||||
|
|
||||||
var labelActive = options.labelActive ? options.labelActive : '\u00d7';
|
var labelActive = options.labelActive ? options.labelActive : '\u00d7';
|
||||||
@@ -54,7 +54,7 @@ ol.control.FullScreen = function(opt_options) {
|
|||||||
* @private
|
* @private
|
||||||
* @type {Node}
|
* @type {Node}
|
||||||
*/
|
*/
|
||||||
this.labelActiveNode_ = goog.isString(labelActive) ?
|
this.labelActiveNode_ = typeof labelActive === 'string' ?
|
||||||
document.createTextNode(labelActive) : labelActive;
|
document.createTextNode(labelActive) : labelActive;
|
||||||
|
|
||||||
var tipLabel = options.tipLabel ? options.tipLabel : 'Toggle full-screen';
|
var tipLabel = options.tipLabel ? options.tipLabel : 'Toggle full-screen';
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ ol.control.OverviewMap = function(opt_options) {
|
|||||||
* @private
|
* @private
|
||||||
* @type {Node}
|
* @type {Node}
|
||||||
*/
|
*/
|
||||||
this.collapseLabel_ = goog.isString(collapseLabel) ?
|
this.collapseLabel_ = typeof collapseLabel === 'string' ?
|
||||||
goog.dom.createDom('SPAN', {}, collapseLabel) :
|
goog.dom.createDom('SPAN', {}, collapseLabel) :
|
||||||
collapseLabel;
|
collapseLabel;
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ ol.control.OverviewMap = function(opt_options) {
|
|||||||
* @private
|
* @private
|
||||||
* @type {Node}
|
* @type {Node}
|
||||||
*/
|
*/
|
||||||
this.label_ = goog.isString(label) ?
|
this.label_ = typeof label === 'string' ?
|
||||||
goog.dom.createDom('SPAN', {}, label) :
|
goog.dom.createDom('SPAN', {}, label) :
|
||||||
label;
|
label;
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ ol.control.Rotate = function(opt_options) {
|
|||||||
*/
|
*/
|
||||||
this.label_ = null;
|
this.label_ = null;
|
||||||
|
|
||||||
if (goog.isString(label)) {
|
if (typeof label === 'string') {
|
||||||
this.label_ = goog.dom.createDom('SPAN',
|
this.label_ = goog.dom.createDom('SPAN',
|
||||||
'ol-compass', label);
|
'ol-compass', label);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ ol.events.EventTarget.prototype.addEventListener = function(type, listener) {
|
|||||||
* event object or if any of the listeners returned false.
|
* event object or if any of the listeners returned false.
|
||||||
*/
|
*/
|
||||||
ol.events.EventTarget.prototype.dispatchEvent = function(event) {
|
ol.events.EventTarget.prototype.dispatchEvent = function(event) {
|
||||||
var evt = goog.isString(event) ? new ol.events.Event(event) : event;
|
var evt = typeof event === 'string' ? new ol.events.Event(event) : event;
|
||||||
var type = evt.type;
|
var type = evt.type;
|
||||||
evt.target = this;
|
evt.target = this;
|
||||||
var listeners = this.listeners_[type];
|
var listeners = this.listeners_[type];
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
|
|||||||
context['featureType'] = featureType;
|
context['featureType'] = featureType;
|
||||||
context['featureNS'] = featureNS;
|
context['featureNS'] = featureNS;
|
||||||
}
|
}
|
||||||
if (goog.isString(featureNS)) {
|
if (typeof featureNS === 'string') {
|
||||||
var ns = featureNS;
|
var ns = featureNS;
|
||||||
featureNS = {};
|
featureNS = {};
|
||||||
featureNS[defaultPrefix] = ns;
|
featureNS[defaultPrefix] = ns;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ goog.inherits(ol.format.JSONFeature, ol.format.Feature);
|
|||||||
ol.format.JSONFeature.prototype.getObject_ = function(source) {
|
ol.format.JSONFeature.prototype.getObject_ = function(source) {
|
||||||
if (goog.isObject(source)) {
|
if (goog.isObject(source)) {
|
||||||
return source;
|
return source;
|
||||||
} else if (goog.isString(source)) {
|
} else if (typeof source === 'string') {
|
||||||
var object = goog.json.parse(source);
|
var object = goog.json.parse(source);
|
||||||
return object ? object : null;
|
return object ? object : null;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -431,7 +431,7 @@ ol.format.KML.createFeatureStyleFunction_ = function(style, styleUrl,
|
|||||||
ol.format.KML.findStyle_ = function(styleValue, defaultStyle, sharedStyles) {
|
ol.format.KML.findStyle_ = function(styleValue, defaultStyle, sharedStyles) {
|
||||||
if (goog.isArray(styleValue)) {
|
if (goog.isArray(styleValue)) {
|
||||||
return styleValue;
|
return styleValue;
|
||||||
} else if (goog.isString(styleValue)) {
|
} else if (typeof styleValue === 'string') {
|
||||||
// KML files in the wild occasionally forget the leading `#` on styleUrls
|
// KML files in the wild occasionally forget the leading `#` on styleUrls
|
||||||
// defined in the same document. Add a leading `#` if it enables to find
|
// defined in the same document. Add a leading `#` if it enables to find
|
||||||
// a style.
|
// a style.
|
||||||
@@ -1274,7 +1274,7 @@ ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
|
|||||||
'placemarkObject should be an Object');
|
'placemarkObject should be an Object');
|
||||||
if (goog.isArray(styleMapValue)) {
|
if (goog.isArray(styleMapValue)) {
|
||||||
placemarkObject['Style'] = styleMapValue;
|
placemarkObject['Style'] = styleMapValue;
|
||||||
} else if (goog.isString(styleMapValue)) {
|
} else if (typeof styleMapValue === 'string') {
|
||||||
placemarkObject['styleUrl'] = styleMapValue;
|
placemarkObject['styleUrl'] = styleMapValue;
|
||||||
} else {
|
} else {
|
||||||
goog.asserts.fail('styleMapValue has an unknown type');
|
goog.asserts.fail('styleMapValue has an unknown type');
|
||||||
@@ -1973,7 +1973,7 @@ ol.format.KML.prototype.readName = function(source) {
|
|||||||
return this.readNameFromDocument(/** @type {Document} */ (source));
|
return this.readNameFromDocument(/** @type {Document} */ (source));
|
||||||
} else if (ol.xml.isNode(source)) {
|
} else if (ol.xml.isNode(source)) {
|
||||||
return this.readNameFromNode(/** @type {Node} */ (source));
|
return this.readNameFromNode(/** @type {Node} */ (source));
|
||||||
} else if (goog.isString(source)) {
|
} else if (typeof source === 'string') {
|
||||||
var doc = ol.xml.parse(source);
|
var doc = ol.xml.parse(source);
|
||||||
return this.readNameFromDocument(doc);
|
return this.readNameFromDocument(doc);
|
||||||
} else {
|
} else {
|
||||||
@@ -2045,7 +2045,7 @@ ol.format.KML.prototype.readNetworkLinks = function(source) {
|
|||||||
} else if (ol.xml.isNode(source)) {
|
} else if (ol.xml.isNode(source)) {
|
||||||
ol.array.extend(networkLinks, this.readNetworkLinksFromNode(
|
ol.array.extend(networkLinks, this.readNetworkLinksFromNode(
|
||||||
/** @type {Node} */ (source)));
|
/** @type {Node} */ (source)));
|
||||||
} else if (goog.isString(source)) {
|
} else if (typeof source === 'string') {
|
||||||
var doc = ol.xml.parse(source);
|
var doc = ol.xml.parse(source);
|
||||||
ol.array.extend(networkLinks, this.readNetworkLinksFromDocument(doc));
|
ol.array.extend(networkLinks, this.readNetworkLinksFromDocument(doc));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ goog.inherits(ol.format.TextFeature, ol.format.Feature);
|
|||||||
* @return {string} Text.
|
* @return {string} Text.
|
||||||
*/
|
*/
|
||||||
ol.format.TextFeature.prototype.getText_ = function(source) {
|
ol.format.TextFeature.prototype.getText_ = function(source) {
|
||||||
if (goog.isString(source)) {
|
if (typeof source === 'string') {
|
||||||
return source;
|
return source;
|
||||||
} else {
|
} else {
|
||||||
goog.asserts.fail();
|
goog.asserts.fail();
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ ol.format.WFS.prototype.readTransactionResponse = function(source) {
|
|||||||
/** @type {Document} */ (source));
|
/** @type {Document} */ (source));
|
||||||
} else if (ol.xml.isNode(source)) {
|
} else if (ol.xml.isNode(source)) {
|
||||||
return this.readTransactionResponseFromNode(/** @type {Node} */ (source));
|
return this.readTransactionResponseFromNode(/** @type {Node} */ (source));
|
||||||
} else if (goog.isString(source)) {
|
} else if (typeof source === 'string') {
|
||||||
var doc = ol.xml.parse(source);
|
var doc = ol.xml.parse(source);
|
||||||
return this.readTransactionResponseFromDocument(doc);
|
return this.readTransactionResponseFromDocument(doc);
|
||||||
} else {
|
} else {
|
||||||
@@ -176,7 +176,7 @@ ol.format.WFS.prototype.readFeatureCollectionMetadata = function(source) {
|
|||||||
} else if (ol.xml.isNode(source)) {
|
} else if (ol.xml.isNode(source)) {
|
||||||
return this.readFeatureCollectionMetadataFromNode(
|
return this.readFeatureCollectionMetadataFromNode(
|
||||||
/** @type {Node} */ (source));
|
/** @type {Node} */ (source));
|
||||||
} else if (goog.isString(source)) {
|
} else if (typeof source === 'string') {
|
||||||
var doc = ol.xml.parse(source);
|
var doc = ol.xml.parse(source);
|
||||||
return this.readFeatureCollectionMetadataFromDocument(doc);
|
return this.readFeatureCollectionMetadataFromDocument(doc);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ ol.format.XMLFeature.prototype.readFeature = function(source, opt_options) {
|
|||||||
/** @type {Document} */ (source), opt_options);
|
/** @type {Document} */ (source), opt_options);
|
||||||
} else if (ol.xml.isNode(source)) {
|
} else if (ol.xml.isNode(source)) {
|
||||||
return this.readFeatureFromNode(/** @type {Node} */ (source), opt_options);
|
return this.readFeatureFromNode(/** @type {Node} */ (source), opt_options);
|
||||||
} else if (goog.isString(source)) {
|
} else if (typeof source === 'string') {
|
||||||
var doc = ol.xml.parse(source);
|
var doc = ol.xml.parse(source);
|
||||||
return this.readFeatureFromDocument(doc, opt_options);
|
return this.readFeatureFromDocument(doc, opt_options);
|
||||||
} else {
|
} else {
|
||||||
@@ -85,7 +85,7 @@ ol.format.XMLFeature.prototype.readFeatures = function(source, opt_options) {
|
|||||||
/** @type {Document} */ (source), opt_options);
|
/** @type {Document} */ (source), opt_options);
|
||||||
} else if (ol.xml.isNode(source)) {
|
} else if (ol.xml.isNode(source)) {
|
||||||
return this.readFeaturesFromNode(/** @type {Node} */ (source), opt_options);
|
return this.readFeaturesFromNode(/** @type {Node} */ (source), opt_options);
|
||||||
} else if (goog.isString(source)) {
|
} else if (typeof source === 'string') {
|
||||||
var doc = ol.xml.parse(source);
|
var doc = ol.xml.parse(source);
|
||||||
return this.readFeaturesFromDocument(doc, opt_options);
|
return this.readFeaturesFromDocument(doc, opt_options);
|
||||||
} else {
|
} else {
|
||||||
@@ -133,7 +133,7 @@ ol.format.XMLFeature.prototype.readGeometry = function(source, opt_options) {
|
|||||||
/** @type {Document} */ (source), opt_options);
|
/** @type {Document} */ (source), opt_options);
|
||||||
} else if (ol.xml.isNode(source)) {
|
} else if (ol.xml.isNode(source)) {
|
||||||
return this.readGeometryFromNode(/** @type {Node} */ (source), opt_options);
|
return this.readGeometryFromNode(/** @type {Node} */ (source), opt_options);
|
||||||
} else if (goog.isString(source)) {
|
} else if (typeof source === 'string') {
|
||||||
var doc = ol.xml.parse(source);
|
var doc = ol.xml.parse(source);
|
||||||
return this.readGeometryFromDocument(doc, opt_options);
|
return this.readGeometryFromDocument(doc, opt_options);
|
||||||
} else {
|
} else {
|
||||||
@@ -169,7 +169,7 @@ ol.format.XMLFeature.prototype.readProjection = function(source) {
|
|||||||
return this.readProjectionFromDocument(/** @type {Document} */ (source));
|
return this.readProjectionFromDocument(/** @type {Document} */ (source));
|
||||||
} else if (ol.xml.isNode(source)) {
|
} else if (ol.xml.isNode(source)) {
|
||||||
return this.readProjectionFromNode(/** @type {Node} */ (source));
|
return this.readProjectionFromNode(/** @type {Node} */ (source));
|
||||||
} else if (goog.isString(source)) {
|
} else if (typeof source === 'string') {
|
||||||
var doc = ol.xml.parse(source);
|
var doc = ol.xml.parse(source);
|
||||||
return this.readProjectionFromDocument(doc);
|
return this.readProjectionFromDocument(doc);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ ol.format.XML.prototype.read = function(source) {
|
|||||||
return this.readFromDocument(/** @type {Document} */ (source));
|
return this.readFromDocument(/** @type {Document} */ (source));
|
||||||
} else if (ol.xml.isNode(source)) {
|
} else if (ol.xml.isNode(source)) {
|
||||||
return this.readFromNode(/** @type {Node} */ (source));
|
return this.readFromNode(/** @type {Node} */ (source));
|
||||||
} else if (goog.isString(source)) {
|
} else if (typeof source === 'string') {
|
||||||
var doc = ol.xml.parse(source);
|
var doc = ol.xml.parse(source);
|
||||||
return this.readFromDocument(doc);
|
return this.readFromDocument(doc);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ ol.layer.Heatmap = function(opt_options) {
|
|||||||
|
|
||||||
var weight = options.weight ? options.weight : 'weight';
|
var weight = options.weight ? options.weight : 'weight';
|
||||||
var weightFunction;
|
var weightFunction;
|
||||||
if (goog.isString(weight)) {
|
if (typeof weight === 'string') {
|
||||||
weightFunction = function(feature) {
|
weightFunction = function(feature) {
|
||||||
return feature.get(weight);
|
return feature.get(weight);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1495,7 +1495,7 @@ ol.Map.createOptionsInternal = function(options) {
|
|||||||
if (options.keyboardEventTarget !== undefined) {
|
if (options.keyboardEventTarget !== undefined) {
|
||||||
// cannot use goog.dom.getElement because its argument cannot be
|
// cannot use goog.dom.getElement because its argument cannot be
|
||||||
// of type Document
|
// of type Document
|
||||||
keyboardEventTarget = goog.isString(options.keyboardEventTarget) ?
|
keyboardEventTarget = typeof options.keyboardEventTarget === 'string' ?
|
||||||
document.getElementById(options.keyboardEventTarget) :
|
document.getElementById(options.keyboardEventTarget) :
|
||||||
options.keyboardEventTarget;
|
options.keyboardEventTarget;
|
||||||
}
|
}
|
||||||
@@ -1511,7 +1511,7 @@ ol.Map.createOptionsInternal = function(options) {
|
|||||||
logos[ol.OL3_LOGO_URL] = ol.OL3_URL;
|
logos[ol.OL3_LOGO_URL] = ol.OL3_URL;
|
||||||
} else {
|
} else {
|
||||||
var logo = options.logo;
|
var logo = options.logo;
|
||||||
if (goog.isString(logo)) {
|
if (typeof logo === 'string') {
|
||||||
logos[logo] = '';
|
logos[logo] = '';
|
||||||
} else if (goog.isObject(logo)) {
|
} else if (goog.isObject(logo)) {
|
||||||
goog.asserts.assertString(logo.href, 'logo.href should be a string');
|
goog.asserts.assertString(logo.href, 'logo.href should be a string');
|
||||||
@@ -1541,7 +1541,7 @@ ol.Map.createOptionsInternal = function(options) {
|
|||||||
if (options.renderer !== undefined) {
|
if (options.renderer !== undefined) {
|
||||||
if (goog.isArray(options.renderer)) {
|
if (goog.isArray(options.renderer)) {
|
||||||
rendererTypes = options.renderer;
|
rendererTypes = options.renderer;
|
||||||
} else if (goog.isString(options.renderer)) {
|
} else if (typeof options.renderer === 'string') {
|
||||||
rendererTypes = [options.renderer];
|
rendererTypes = [options.renderer];
|
||||||
} else {
|
} else {
|
||||||
goog.asserts.fail('Incorrect format for renderer option');
|
goog.asserts.fail('Incorrect format for renderer option');
|
||||||
|
|||||||
@@ -520,7 +520,7 @@ ol.proj.clearAllProjections = function() {
|
|||||||
ol.proj.createProjection = function(projection, defaultCode) {
|
ol.proj.createProjection = function(projection, defaultCode) {
|
||||||
if (!projection) {
|
if (!projection) {
|
||||||
return ol.proj.get(defaultCode);
|
return ol.proj.get(defaultCode);
|
||||||
} else if (goog.isString(projection)) {
|
} else if (typeof projection === 'string') {
|
||||||
return ol.proj.get(projection);
|
return ol.proj.get(projection);
|
||||||
} else {
|
} else {
|
||||||
goog.asserts.assertInstanceof(projection, ol.proj.Projection,
|
goog.asserts.assertInstanceof(projection, ol.proj.Projection,
|
||||||
@@ -680,7 +680,7 @@ ol.proj.get = function(projectionLike) {
|
|||||||
var projection;
|
var projection;
|
||||||
if (projectionLike instanceof ol.proj.Projection) {
|
if (projectionLike instanceof ol.proj.Projection) {
|
||||||
projection = projectionLike;
|
projection = projectionLike;
|
||||||
} else if (goog.isString(projectionLike)) {
|
} else if (typeof projectionLike === 'string') {
|
||||||
var code = projectionLike;
|
var code = projectionLike;
|
||||||
projection = ol.proj.projections_[code];
|
projection = ol.proj.projections_[code];
|
||||||
if (ol.ENABLE_PROJ4JS) {
|
if (ol.ENABLE_PROJ4JS) {
|
||||||
|
|||||||
@@ -376,7 +376,7 @@ ol.render.canvas.Replay.prototype.replay_ = function(
|
|||||||
goog.asserts.assert(goog.isNumber(instruction[2]),
|
goog.asserts.assert(goog.isNumber(instruction[2]),
|
||||||
'3rd instruction should be a number');
|
'3rd instruction should be a number');
|
||||||
dd = /** @type {number} */ (instruction[2]);
|
dd = /** @type {number} */ (instruction[2]);
|
||||||
goog.asserts.assert(goog.isString(instruction[3]),
|
goog.asserts.assert(typeof instruction[3] === 'string',
|
||||||
'4th instruction should be a string');
|
'4th instruction should be a string');
|
||||||
text = /** @type {string} */ (instruction[3]);
|
text = /** @type {string} */ (instruction[3]);
|
||||||
goog.asserts.assert(goog.isNumber(instruction[4]),
|
goog.asserts.assert(goog.isNumber(instruction[4]),
|
||||||
@@ -497,19 +497,19 @@ ol.render.canvas.Replay.prototype.replay_ = function(
|
|||||||
++i;
|
++i;
|
||||||
break;
|
break;
|
||||||
case ol.render.canvas.Instruction.SET_FILL_STYLE:
|
case ol.render.canvas.Instruction.SET_FILL_STYLE:
|
||||||
goog.asserts.assert(goog.isString(instruction[1]),
|
goog.asserts.assert(typeof instruction[1] === 'string',
|
||||||
'2nd instruction should be a string');
|
'2nd instruction should be a string');
|
||||||
context.fillStyle = /** @type {string} */ (instruction[1]);
|
context.fillStyle = /** @type {string} */ (instruction[1]);
|
||||||
++i;
|
++i;
|
||||||
break;
|
break;
|
||||||
case ol.render.canvas.Instruction.SET_STROKE_STYLE:
|
case ol.render.canvas.Instruction.SET_STROKE_STYLE:
|
||||||
goog.asserts.assert(goog.isString(instruction[1]),
|
goog.asserts.assert(typeof instruction[1] === 'string',
|
||||||
'2nd instruction should be a string');
|
'2nd instruction should be a string');
|
||||||
goog.asserts.assert(goog.isNumber(instruction[2]),
|
goog.asserts.assert(goog.isNumber(instruction[2]),
|
||||||
'3rd instruction should be a number');
|
'3rd instruction should be a number');
|
||||||
goog.asserts.assert(goog.isString(instruction[3]),
|
goog.asserts.assert(typeof instruction[3] === 'string',
|
||||||
'4rd instruction should be a string');
|
'4rd instruction should be a string');
|
||||||
goog.asserts.assert(goog.isString(instruction[4]),
|
goog.asserts.assert(typeof instruction[4] === 'string',
|
||||||
'5th instruction should be a string');
|
'5th instruction should be a string');
|
||||||
goog.asserts.assert(goog.isNumber(instruction[5]),
|
goog.asserts.assert(goog.isNumber(instruction[5]),
|
||||||
'6th instruction should be a number');
|
'6th instruction should be a number');
|
||||||
@@ -531,11 +531,11 @@ ol.render.canvas.Replay.prototype.replay_ = function(
|
|||||||
++i;
|
++i;
|
||||||
break;
|
break;
|
||||||
case ol.render.canvas.Instruction.SET_TEXT_STYLE:
|
case ol.render.canvas.Instruction.SET_TEXT_STYLE:
|
||||||
goog.asserts.assert(goog.isString(instruction[1]),
|
goog.asserts.assert(typeof instruction[1] === 'string',
|
||||||
'2nd instruction should be a string');
|
'2nd instruction should be a string');
|
||||||
goog.asserts.assert(goog.isString(instruction[2]),
|
goog.asserts.assert(typeof instruction[2] === 'string',
|
||||||
'3rd instruction should be a string');
|
'3rd instruction should be a string');
|
||||||
goog.asserts.assert(goog.isString(instruction[3]),
|
goog.asserts.assert(typeof instruction[3] === 'string',
|
||||||
'4th instruction should be a string');
|
'4th instruction should be a string');
|
||||||
context.font = /** @type {string} */ (instruction[1]);
|
context.font = /** @type {string} */ (instruction[1]);
|
||||||
context.textAlign = /** @type {string} */ (instruction[2]);
|
context.textAlign = /** @type {string} */ (instruction[2]);
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ ol.renderer.Layer.prototype.updateAttributions = function(attributionsSet, attri
|
|||||||
ol.renderer.Layer.prototype.updateLogos = function(frameState, source) {
|
ol.renderer.Layer.prototype.updateLogos = function(frameState, source) {
|
||||||
var logo = source.getLogo();
|
var logo = source.getLogo();
|
||||||
if (logo !== undefined) {
|
if (logo !== undefined) {
|
||||||
if (goog.isString(logo)) {
|
if (typeof logo === 'string') {
|
||||||
frameState.logos[logo] = '';
|
frameState.logos[logo] = '';
|
||||||
} else if (goog.isObject(logo)) {
|
} else if (goog.isObject(logo)) {
|
||||||
goog.asserts.assertString(logo.href, 'logo.href is a string');
|
goog.asserts.assertString(logo.href, 'logo.href is a string');
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ ol.source.TileUTFGridTile_.prototype.getData = function(coordinate) {
|
|||||||
|
|
||||||
var row = this.grid_[Math.floor((1 - yRelative) * this.grid_.length)];
|
var row = this.grid_[Math.floor((1 - yRelative) * this.grid_.length)];
|
||||||
|
|
||||||
if (!goog.isString(row)) {
|
if (typeof row !== 'string') {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ ol.style.Style.prototype.getZIndex = function() {
|
|||||||
ol.style.Style.prototype.setGeometry = function(geometry) {
|
ol.style.Style.prototype.setGeometry = function(geometry) {
|
||||||
if (goog.isFunction(geometry)) {
|
if (goog.isFunction(geometry)) {
|
||||||
this.geometryFunction_ = geometry;
|
this.geometryFunction_ = geometry;
|
||||||
} else if (goog.isString(geometry)) {
|
} else if (typeof geometry === 'string') {
|
||||||
this.geometryFunction_ = function(feature) {
|
this.geometryFunction_ = function(feature) {
|
||||||
var result = feature.get(geometry);
|
var result = feature.get(geometry);
|
||||||
if (result) {
|
if (result) {
|
||||||
|
|||||||
Reference in New Issue
Block a user