Merge pull request #4258 from marcjansen/no-tagname-enum

Remove usage of goog.dom.TagName enum
This commit is contained in:
Marc Jansen
2015-10-12 21:18:11 +02:00
27 changed files with 58 additions and 85 deletions
+9 -10
View File
@@ -4,7 +4,6 @@ goog.provide('ol.control.Attribution');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.dom.classlist'); goog.require('goog.dom.classlist');
goog.require('goog.events'); goog.require('goog.events');
goog.require('goog.events.EventType'); goog.require('goog.events.EventType');
@@ -38,13 +37,13 @@ ol.control.Attribution = function(opt_options) {
* @private * @private
* @type {Element} * @type {Element}
*/ */
this.ulElement_ = goog.dom.createElement(goog.dom.TagName.UL); this.ulElement_ = goog.dom.createElement('UL');
/** /**
* @private * @private
* @type {Element} * @type {Element}
*/ */
this.logoLi_ = goog.dom.createElement(goog.dom.TagName.LI); this.logoLi_ = goog.dom.createElement('LI');
this.ulElement_.appendChild(this.logoLi_); this.ulElement_.appendChild(this.logoLi_);
goog.style.setElementShown(this.logoLi_, false); goog.style.setElementShown(this.logoLi_, false);
@@ -77,7 +76,7 @@ ol.control.Attribution = function(opt_options) {
* @type {Node} * @type {Node}
*/ */
this.collapseLabel_ = goog.isString(collapseLabel) ? this.collapseLabel_ = goog.isString(collapseLabel) ?
goog.dom.createDom(goog.dom.TagName.SPAN, {}, collapseLabel) : goog.dom.createDom('SPAN', {}, collapseLabel) :
collapseLabel; collapseLabel;
var label = options.label ? options.label : 'i'; var label = options.label ? options.label : 'i';
@@ -87,12 +86,12 @@ ol.control.Attribution = function(opt_options) {
* @type {Node} * @type {Node}
*/ */
this.label_ = goog.isString(label) ? this.label_ = goog.isString(label) ?
goog.dom.createDom(goog.dom.TagName.SPAN, {}, label) : goog.dom.createDom('SPAN', {}, label) :
label; label;
var activeLabel = (this.collapsible_ && !this.collapsed_) ? var activeLabel = (this.collapsible_ && !this.collapsed_) ?
this.collapseLabel_ : this.label_; this.collapseLabel_ : this.label_;
var button = goog.dom.createDom(goog.dom.TagName.BUTTON, { var button = goog.dom.createDom('BUTTON', {
'type': 'button', 'type': 'button',
'title': tipLabel 'title': tipLabel
}, activeLabel); }, activeLabel);
@@ -111,7 +110,7 @@ ol.control.Attribution = function(opt_options) {
ol.css.CLASS_CONTROL + ol.css.CLASS_CONTROL +
(this.collapsed_ && this.collapsible_ ? ' ol-collapsed' : '') + (this.collapsed_ && this.collapsible_ ? ' ol-collapsed' : '') +
(this.collapsible_ ? '' : ' ol-uncollapsible'); (this.collapsible_ ? '' : ' ol-uncollapsible');
var element = goog.dom.createDom(goog.dom.TagName.DIV, var element = goog.dom.createDom('DIV',
cssClasses, this.ulElement_, button); cssClasses, this.ulElement_, button);
var render = options.render ? options.render : ol.control.Attribution.render; var render = options.render ? options.render : ol.control.Attribution.render;
@@ -262,7 +261,7 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
} }
} }
for (attributionKey in visibleAttributions) { for (attributionKey in visibleAttributions) {
attributionElement = goog.dom.createElement(goog.dom.TagName.LI); attributionElement = goog.dom.createElement('LI');
attributionElement.innerHTML = attributionElement.innerHTML =
visibleAttributions[attributionKey].getHTML(); visibleAttributions[attributionKey].getHTML();
this.ulElement_.appendChild(attributionElement); this.ulElement_.appendChild(attributionElement);
@@ -270,7 +269,7 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
this.attributionElementRenderedVisible_[attributionKey] = true; this.attributionElementRenderedVisible_[attributionKey] = true;
} }
for (attributionKey in hiddenAttributions) { for (attributionKey in hiddenAttributions) {
attributionElement = goog.dom.createElement(goog.dom.TagName.LI); attributionElement = goog.dom.createElement('LI');
attributionElement.innerHTML = attributionElement.innerHTML =
hiddenAttributions[attributionKey].getHTML(); hiddenAttributions[attributionKey].getHTML();
goog.style.setElementShown(attributionElement, false); goog.style.setElementShown(attributionElement, false);
@@ -323,7 +322,7 @@ ol.control.Attribution.prototype.insertLogos_ = function(frameState) {
if (logoValue === '') { if (logoValue === '') {
logoElement = image; logoElement = image;
} else { } else {
logoElement = goog.dom.createDom(goog.dom.TagName.A, { logoElement = goog.dom.createDom('A', {
'href': logoValue 'href': logoValue
}); });
logoElement.appendChild(image); logoElement.appendChild(image);
+2 -3
View File
@@ -2,7 +2,6 @@ goog.provide('ol.control.FullScreen');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.dom.classlist'); goog.require('goog.dom.classlist');
goog.require('goog.dom.fullscreen'); goog.require('goog.dom.fullscreen');
goog.require('goog.dom.fullscreen.EventType'); goog.require('goog.dom.fullscreen.EventType');
@@ -56,7 +55,7 @@ ol.control.FullScreen = function(opt_options) {
goog.dom.createTextNode(labelActive) : labelActive; goog.dom.createTextNode(labelActive) : labelActive;
var tipLabel = options.tipLabel ? options.tipLabel : 'Toggle full-screen'; var tipLabel = options.tipLabel ? options.tipLabel : 'Toggle full-screen';
var button = goog.dom.createDom(goog.dom.TagName.BUTTON, { var button = goog.dom.createDom('BUTTON', {
'class': this.cssClassName_ + '-' + goog.dom.fullscreen.isFullScreen(), 'class': this.cssClassName_ + '-' + goog.dom.fullscreen.isFullScreen(),
'type': 'button', 'type': 'button',
'title': tipLabel 'title': tipLabel
@@ -72,7 +71,7 @@ ol.control.FullScreen = function(opt_options) {
var cssClasses = this.cssClassName_ + ' ' + ol.css.CLASS_UNSELECTABLE + var cssClasses = this.cssClassName_ + ' ' + ol.css.CLASS_UNSELECTABLE +
' ' + ol.css.CLASS_CONTROL + ' ' + ' ' + ol.css.CLASS_CONTROL + ' ' +
(!goog.dom.fullscreen.isSupported() ? ol.css.CLASS_UNSUPPORTED : ''); (!goog.dom.fullscreen.isSupported() ? ol.css.CLASS_UNSUPPORTED : '');
var element = goog.dom.createDom(goog.dom.TagName.DIV, cssClasses, button); var element = goog.dom.createDom('DIV', cssClasses, button);
goog.base(this, { goog.base(this, {
element: element, element: element,
+1 -2
View File
@@ -3,7 +3,6 @@
goog.provide('ol.control.MousePosition'); goog.provide('ol.control.MousePosition');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.events'); goog.require('goog.events');
goog.require('goog.events.EventType'); goog.require('goog.events.EventType');
goog.require('ol.CoordinateFormatType'); goog.require('ol.CoordinateFormatType');
@@ -44,7 +43,7 @@ ol.control.MousePosition = function(opt_options) {
var className = options.className ? options.className : 'ol-mouse-position'; var className = options.className ? options.className : 'ol-mouse-position';
var element = goog.dom.createDom(goog.dom.TagName.DIV, className); var element = goog.dom.createDom('DIV', className);
var render = options.render ? var render = options.render ?
options.render : ol.control.MousePosition.render; options.render : ol.control.MousePosition.render;
+6 -7
View File
@@ -2,7 +2,6 @@ goog.provide('ol.control.OverviewMap');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.dom.classlist'); goog.require('goog.dom.classlist');
goog.require('goog.events'); goog.require('goog.events');
goog.require('goog.events.EventType'); goog.require('goog.events.EventType');
@@ -65,7 +64,7 @@ ol.control.OverviewMap = function(opt_options) {
* @type {Node} * @type {Node}
*/ */
this.collapseLabel_ = goog.isString(collapseLabel) ? this.collapseLabel_ = goog.isString(collapseLabel) ?
goog.dom.createDom(goog.dom.TagName.SPAN, {}, collapseLabel) : goog.dom.createDom('SPAN', {}, collapseLabel) :
collapseLabel; collapseLabel;
var label = options.label ? options.label : '\u00BB'; var label = options.label ? options.label : '\u00BB';
@@ -75,12 +74,12 @@ ol.control.OverviewMap = function(opt_options) {
* @type {Node} * @type {Node}
*/ */
this.label_ = goog.isString(label) ? this.label_ = goog.isString(label) ?
goog.dom.createDom(goog.dom.TagName.SPAN, {}, label) : goog.dom.createDom('SPAN', {}, label) :
label; label;
var activeLabel = (this.collapsible_ && !this.collapsed_) ? var activeLabel = (this.collapsible_ && !this.collapsed_) ?
this.collapseLabel_ : this.label_; this.collapseLabel_ : this.label_;
var button = goog.dom.createDom(goog.dom.TagName.BUTTON, { var button = goog.dom.createDom('BUTTON', {
'type': 'button', 'type': 'button',
'title': tipLabel 'title': tipLabel
}, activeLabel); }, activeLabel);
@@ -88,7 +87,7 @@ ol.control.OverviewMap = function(opt_options) {
goog.events.listen(button, goog.events.EventType.CLICK, goog.events.listen(button, goog.events.EventType.CLICK,
this.handleClick_, false, this); this.handleClick_, false, this);
var ovmapDiv = goog.dom.createDom(goog.dom.TagName.DIV, 'ol-overviewmap-map'); var ovmapDiv = goog.dom.createDom('DIV', 'ol-overviewmap-map');
/** /**
* @type {ol.Map} * @type {ol.Map}
@@ -112,7 +111,7 @@ ol.control.OverviewMap = function(opt_options) {
}, this); }, this);
} }
var box = goog.dom.createDom(goog.dom.TagName.DIV, 'ol-overviewmap-box'); var box = goog.dom.createDom('DIV', 'ol-overviewmap-box');
/** /**
* @type {ol.Overlay} * @type {ol.Overlay}
@@ -129,7 +128,7 @@ ol.control.OverviewMap = function(opt_options) {
ol.css.CLASS_CONTROL + ol.css.CLASS_CONTROL +
(this.collapsed_ && this.collapsible_ ? ' ol-collapsed' : '') + (this.collapsed_ && this.collapsible_ ? ' ol-collapsed' : '') +
(this.collapsible_ ? '' : ' ol-uncollapsible'); (this.collapsible_ ? '' : ' ol-uncollapsible');
var element = goog.dom.createDom(goog.dom.TagName.DIV, var element = goog.dom.createDom('DIV',
cssClasses, ovmapDiv, button); cssClasses, ovmapDiv, button);
var render = options.render ? options.render : ol.control.OverviewMap.render; var render = options.render ? options.render : ol.control.OverviewMap.render;
+3 -4
View File
@@ -1,7 +1,6 @@
goog.provide('ol.control.Rotate'); goog.provide('ol.control.Rotate');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.dom.classlist'); goog.require('goog.dom.classlist');
goog.require('goog.events'); goog.require('goog.events');
goog.require('goog.events.EventType'); goog.require('goog.events.EventType');
@@ -40,7 +39,7 @@ ol.control.Rotate = function(opt_options) {
this.label_ = null; this.label_ = null;
if (goog.isString(label)) { if (goog.isString(label)) {
this.label_ = goog.dom.createDom(goog.dom.TagName.SPAN, this.label_ = goog.dom.createDom('SPAN',
'ol-compass', label); 'ol-compass', label);
} else { } else {
this.label_ = label; this.label_ = label;
@@ -49,7 +48,7 @@ ol.control.Rotate = function(opt_options) {
var tipLabel = options.tipLabel ? options.tipLabel : 'Reset rotation'; var tipLabel = options.tipLabel ? options.tipLabel : 'Reset rotation';
var button = goog.dom.createDom(goog.dom.TagName.BUTTON, { var button = goog.dom.createDom('BUTTON', {
'class': className + '-reset', 'class': className + '-reset',
'type' : 'button', 'type' : 'button',
'title': tipLabel 'title': tipLabel
@@ -60,7 +59,7 @@ ol.control.Rotate = function(opt_options) {
var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' + var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' +
ol.css.CLASS_CONTROL; ol.css.CLASS_CONTROL;
var element = goog.dom.createDom(goog.dom.TagName.DIV, cssClasses, button); var element = goog.dom.createDom('DIV', cssClasses, button);
var render = options.render ? options.render : ol.control.Rotate.render; var render = options.render ? options.render : ol.control.Rotate.render;
+2 -3
View File
@@ -4,7 +4,6 @@ goog.provide('ol.control.ScaleLineUnits');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.events'); goog.require('goog.events');
goog.require('goog.math'); goog.require('goog.math');
goog.require('goog.style'); goog.require('goog.style');
@@ -67,14 +66,14 @@ ol.control.ScaleLine = function(opt_options) {
* @private * @private
* @type {Element} * @type {Element}
*/ */
this.innerElement_ = goog.dom.createDom(goog.dom.TagName.DIV, this.innerElement_ = goog.dom.createDom('DIV',
className + '-inner'); className + '-inner');
/** /**
* @private * @private
* @type {Element} * @type {Element}
*/ */
this.element_ = goog.dom.createDom(goog.dom.TagName.DIV, this.element_ = goog.dom.createDom('DIV',
className + ' ' + ol.css.CLASS_UNSELECTABLE, this.innerElement_); className + ' ' + ol.css.CLASS_UNSELECTABLE, this.innerElement_);
/** /**
+3 -4
View File
@@ -1,7 +1,6 @@
goog.provide('ol.control.Zoom'); goog.provide('ol.control.Zoom');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.events'); goog.require('goog.events');
goog.require('goog.events.EventType'); goog.require('goog.events.EventType');
goog.require('ol.animation'); goog.require('ol.animation');
@@ -38,7 +37,7 @@ ol.control.Zoom = function(opt_options) {
var zoomOutTipLabel = options.zoomOutTipLabel ? var zoomOutTipLabel = options.zoomOutTipLabel ?
options.zoomOutTipLabel : 'Zoom out'; options.zoomOutTipLabel : 'Zoom out';
var inElement = goog.dom.createDom(goog.dom.TagName.BUTTON, { var inElement = goog.dom.createDom('BUTTON', {
'class': className + '-in', 'class': className + '-in',
'type' : 'button', 'type' : 'button',
'title': zoomInTipLabel 'title': zoomInTipLabel
@@ -48,7 +47,7 @@ ol.control.Zoom = function(opt_options) {
goog.events.EventType.CLICK, goog.partial( goog.events.EventType.CLICK, goog.partial(
ol.control.Zoom.prototype.handleClick_, delta), false, this); ol.control.Zoom.prototype.handleClick_, delta), false, this);
var outElement = goog.dom.createDom(goog.dom.TagName.BUTTON, { var outElement = goog.dom.createDom('BUTTON', {
'class': className + '-out', 'class': className + '-out',
'type' : 'button', 'type' : 'button',
'title': zoomOutTipLabel 'title': zoomOutTipLabel
@@ -60,7 +59,7 @@ ol.control.Zoom = function(opt_options) {
var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' + var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' +
ol.css.CLASS_CONTROL; ol.css.CLASS_CONTROL;
var element = goog.dom.createDom(goog.dom.TagName.DIV, cssClasses, inElement, var element = goog.dom.createDom('DIV', cssClasses, inElement,
outElement); outElement);
goog.base(this, { goog.base(this, {
+2 -3
View File
@@ -4,7 +4,6 @@ goog.provide('ol.control.ZoomSlider');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.events'); goog.require('goog.events');
goog.require('goog.events.Event'); goog.require('goog.events.Event');
goog.require('goog.events.EventType'); goog.require('goog.events.EventType');
@@ -79,11 +78,11 @@ ol.control.ZoomSlider = function(opt_options) {
this.duration_ = options.duration ? options.duration : 200; this.duration_ = options.duration ? options.duration : 200;
var className = options.className ? options.className : 'ol-zoomslider'; var className = options.className ? options.className : 'ol-zoomslider';
var thumbElement = goog.dom.createDom(goog.dom.TagName.BUTTON, { var thumbElement = goog.dom.createDom('BUTTON', {
'type': 'button', 'type': 'button',
'class': className + '-thumb ' + ol.css.CLASS_UNSELECTABLE 'class': className + '-thumb ' + ol.css.CLASS_UNSELECTABLE
}); });
var containerElement = goog.dom.createDom(goog.dom.TagName.DIV, var containerElement = goog.dom.createDom('DIV',
[className, ol.css.CLASS_UNSELECTABLE, ol.css.CLASS_CONTROL], [className, ol.css.CLASS_UNSELECTABLE, ol.css.CLASS_CONTROL],
thumbElement); thumbElement);
+2 -3
View File
@@ -2,7 +2,6 @@ goog.provide('ol.control.ZoomToExtent');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.events'); goog.require('goog.events');
goog.require('goog.events.EventType'); goog.require('goog.events.EventType');
goog.require('ol.control.Control'); goog.require('ol.control.Control');
@@ -35,7 +34,7 @@ ol.control.ZoomToExtent = function(opt_options) {
var label = options.label ? options.label : 'E'; var label = options.label ? options.label : 'E';
var tipLabel = options.tipLabel ? var tipLabel = options.tipLabel ?
options.tipLabel : 'Fit to extent'; options.tipLabel : 'Fit to extent';
var button = goog.dom.createDom(goog.dom.TagName.BUTTON, { var button = goog.dom.createDom('BUTTON', {
'type': 'button', 'type': 'button',
'title': tipLabel 'title': tipLabel
}, label); }, label);
@@ -45,7 +44,7 @@ ol.control.ZoomToExtent = function(opt_options) {
var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' + var cssClasses = className + ' ' + ol.css.CLASS_UNSELECTABLE + ' ' +
ol.css.CLASS_CONTROL; ol.css.CLASS_CONTROL;
var element = goog.dom.createDom(goog.dom.TagName.DIV, cssClasses, button); var element = goog.dom.createDom('DIV', cssClasses, button);
goog.base(this, { goog.base(this, {
element: element, element: element,
+3 -4
View File
@@ -5,7 +5,6 @@ goog.provide('ol.dom.BrowserFeature');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.userAgent'); goog.require('goog.userAgent');
goog.require('goog.vec.Mat4'); goog.require('goog.vec.Mat4');
goog.require('ol'); goog.require('ol');
@@ -18,7 +17,7 @@ goog.require('ol');
* @return {CanvasRenderingContext2D} * @return {CanvasRenderingContext2D}
*/ */
ol.dom.createCanvasContext2D = function(opt_width, opt_height) { ol.dom.createCanvasContext2D = function(opt_width, opt_height) {
var canvas = goog.dom.createElement(goog.dom.TagName.CANVAS); var canvas = goog.dom.createElement('CANVAS');
if (opt_width) { if (opt_width) {
canvas.width = opt_width; canvas.width = opt_width;
} }
@@ -45,7 +44,7 @@ ol.dom.canUseCssTransform = (function() {
// this browser is ancient // this browser is ancient
canUseCssTransform = false; canUseCssTransform = false;
} else { } else {
var el = goog.dom.createElement(goog.dom.TagName.P), var el = goog.dom.createElement('P'),
has2d, has2d,
transforms = { transforms = {
'webkitTransform': '-webkit-transform', 'webkitTransform': '-webkit-transform',
@@ -88,7 +87,7 @@ ol.dom.canUseCssTransform3D = (function() {
// this browser is ancient // this browser is ancient
canUseCssTransform3D = false; canUseCssTransform3D = false;
} else { } else {
var el = goog.dom.createElement(goog.dom.TagName.P), var el = goog.dom.createElement('P'),
has3d, has3d,
transforms = { transforms = {
'webkitTransform': '-webkit-transform', 'webkitTransform': '-webkit-transform',
+3 -4
View File
@@ -2,7 +2,6 @@ goog.provide('ol.events.ConditionType');
goog.provide('ol.events.condition'); goog.provide('ol.events.condition');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.dom.TagName');
goog.require('goog.functions'); goog.require('goog.functions');
goog.require('ol.MapBrowserEvent.EventType'); goog.require('ol.MapBrowserEvent.EventType');
goog.require('ol.MapBrowserPointerEvent'); goog.require('ol.MapBrowserPointerEvent');
@@ -188,9 +187,9 @@ ol.events.condition.targetNotEditable = function(mapBrowserEvent) {
'target should be an Element'); 'target should be an Element');
var tagName = target.tagName; var tagName = target.tagName;
return ( return (
tagName !== goog.dom.TagName.INPUT && tagName !== 'INPUT' &&
tagName !== goog.dom.TagName.SELECT && tagName !== 'SELECT' &&
tagName !== goog.dom.TagName.TEXTAREA); tagName !== 'TEXTAREA');
}; };
+1 -2
View File
@@ -1,7 +1,6 @@
goog.provide('ol.has'); goog.provide('ol.has');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('ol'); goog.require('ol');
goog.require('ol.dom'); goog.require('ol.dom');
goog.require('ol.webgl'); goog.require('ol.webgl');
@@ -125,7 +124,7 @@ ol.has.WEBGL;
if ('WebGLRenderingContext' in goog.global) { if ('WebGLRenderingContext' in goog.global) {
try { try {
var canvas = /** @type {HTMLCanvasElement} */ var canvas = /** @type {HTMLCanvasElement} */
(goog.dom.createElement(goog.dom.TagName.CANVAS)); (goog.dom.createElement('CANVAS'));
var gl = ol.webgl.getContext(canvas, { var gl = ol.webgl.getContext(canvas, {
failIfMajorPerformanceCaveat: true failIfMajorPerformanceCaveat: true
}); });
+3 -4
View File
@@ -11,7 +11,6 @@ goog.require('goog.async.AnimationDelay');
goog.require('goog.async.nextTick'); goog.require('goog.async.nextTick');
goog.require('goog.debug.Console'); goog.require('goog.debug.Console');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.dom.ViewportSizeMonitor'); goog.require('goog.dom.ViewportSizeMonitor');
goog.require('goog.dom.classlist'); goog.require('goog.dom.classlist');
goog.require('goog.events'); goog.require('goog.events');
@@ -261,7 +260,7 @@ ol.Map = function(options) {
* @private * @private
* @type {Element} * @type {Element}
*/ */
this.viewport_ = goog.dom.createDom(goog.dom.TagName.DIV, 'ol-viewport'); this.viewport_ = goog.dom.createDom('DIV', 'ol-viewport');
this.viewport_.style.position = 'relative'; this.viewport_.style.position = 'relative';
this.viewport_.style.overflow = 'hidden'; this.viewport_.style.overflow = 'hidden';
this.viewport_.style.width = '100%'; this.viewport_.style.width = '100%';
@@ -277,7 +276,7 @@ ol.Map = function(options) {
* @private * @private
* @type {Element} * @type {Element}
*/ */
this.overlayContainer_ = goog.dom.createDom(goog.dom.TagName.DIV, this.overlayContainer_ = goog.dom.createDom('DIV',
'ol-overlaycontainer'); 'ol-overlaycontainer');
this.viewport_.appendChild(this.overlayContainer_); this.viewport_.appendChild(this.overlayContainer_);
@@ -285,7 +284,7 @@ ol.Map = function(options) {
* @private * @private
* @type {Element} * @type {Element}
*/ */
this.overlayContainerStopEvent_ = goog.dom.createDom(goog.dom.TagName.DIV, this.overlayContainerStopEvent_ = goog.dom.createDom('DIV',
'ol-overlaycontainer-stopevent'); 'ol-overlaycontainer-stopevent');
goog.events.listen(this.overlayContainerStopEvent_, [ goog.events.listen(this.overlayContainerStopEvent_, [
goog.events.EventType.CLICK, goog.events.EventType.CLICK,
+1 -2
View File
@@ -4,7 +4,6 @@ goog.provide('ol.OverlayProperty');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.events'); goog.require('goog.events');
goog.require('goog.style'); goog.require('goog.style');
goog.require('ol.Coordinate'); goog.require('ol.Coordinate');
@@ -91,7 +90,7 @@ ol.Overlay = function(options) {
* @private * @private
* @type {Element} * @type {Element}
*/ */
this.element_ = goog.dom.createDom(goog.dom.TagName.DIV, { this.element_ = goog.dom.createDom('DIV', {
'class': 'ol-overlay-container' 'class': 'ol-overlay-container'
}); });
this.element_.style.position = 'absolute'; this.element_.style.position = 'absolute';
+1 -2
View File
@@ -2,7 +2,6 @@ goog.provide('ol.renderer.dom.ImageLayer');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.vec.Mat4'); goog.require('goog.vec.Mat4');
goog.require('ol.ImageBase'); goog.require('ol.ImageBase');
goog.require('ol.ViewHint'); goog.require('ol.ViewHint');
@@ -21,7 +20,7 @@ goog.require('ol.vec.Mat4');
* @param {ol.layer.Image} imageLayer Image layer. * @param {ol.layer.Image} imageLayer Image layer.
*/ */
ol.renderer.dom.ImageLayer = function(imageLayer) { ol.renderer.dom.ImageLayer = function(imageLayer) {
var target = goog.dom.createElement(goog.dom.TagName.DIV); var target = goog.dom.createElement('DIV');
target.style.position = 'absolute'; target.style.position = 'absolute';
goog.base(this, imageLayer, target); goog.base(this, imageLayer, target);
+1 -2
View File
@@ -3,7 +3,6 @@ goog.provide('ol.renderer.dom.Map');
goog.require('goog.array'); goog.require('goog.array');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.events'); goog.require('goog.events');
goog.require('goog.events.Event'); goog.require('goog.events.Event');
goog.require('goog.events.EventType'); goog.require('goog.events.EventType');
@@ -62,7 +61,7 @@ ol.renderer.dom.Map = function(container, map) {
* @type {!Element} * @type {!Element}
* @private * @private
*/ */
this.layersPane_ = goog.dom.createElement(goog.dom.TagName.DIV); this.layersPane_ = goog.dom.createElement('DIV');
this.layersPane_.className = ol.css.CLASS_UNSELECTABLE; this.layersPane_.className = ol.css.CLASS_UNSELECTABLE;
var style = this.layersPane_.style; var style = this.layersPane_.style;
style.position = 'absolute'; style.position = 'absolute';
+3 -4
View File
@@ -6,7 +6,6 @@ goog.provide('ol.renderer.dom.TileLayer');
goog.require('goog.array'); goog.require('goog.array');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.style'); goog.require('goog.style');
goog.require('goog.vec.Mat4'); goog.require('goog.vec.Mat4');
goog.require('ol'); goog.require('ol');
@@ -33,7 +32,7 @@ goog.require('ol.vec.Mat4');
*/ */
ol.renderer.dom.TileLayer = function(tileLayer) { ol.renderer.dom.TileLayer = function(tileLayer) {
var target = goog.dom.createElement(goog.dom.TagName.DIV); var target = goog.dom.createElement('DIV');
target.style.position = 'absolute'; target.style.position = 'absolute';
goog.base(this, tileLayer, target); goog.base(this, tileLayer, target);
@@ -271,7 +270,7 @@ ol.renderer.dom.TileLayerZ_ = function(tileGrid, tileCoordOrigin) {
/** /**
* @type {!Element} * @type {!Element}
*/ */
this.target = goog.dom.createElement(goog.dom.TagName.DIV); this.target = goog.dom.createElement('DIV');
this.target.style.position = 'absolute'; this.target.style.position = 'absolute';
this.target.style.width = '100%'; this.target.style.width = '100%';
this.target.style.height = '100%'; this.target.style.height = '100%';
@@ -354,7 +353,7 @@ ol.renderer.dom.TileLayerZ_.prototype.addTile = function(tile, tileGutter) {
var tileElement; var tileElement;
var tileElementStyle; var tileElementStyle;
if (tileGutter > 0) { if (tileGutter > 0) {
tileElement = goog.dom.createElement(goog.dom.TagName.DIV); tileElement = goog.dom.createElement('DIV');
tileElementStyle = tileElement.style; tileElementStyle = tileElement.style;
tileElementStyle.overflow = 'hidden'; tileElementStyle.overflow = 'hidden';
tileElementStyle.width = tileSize[0] + 'px'; tileElementStyle.width = tileSize[0] + 'px';
+1 -2
View File
@@ -5,7 +5,6 @@ goog.provide('ol.renderer.webgl.Map');
goog.require('goog.array'); goog.require('goog.array');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.events'); goog.require('goog.events');
goog.require('goog.events.Event'); goog.require('goog.events.Event');
goog.require('goog.log'); goog.require('goog.log');
@@ -59,7 +58,7 @@ ol.renderer.webgl.Map = function(container, map) {
* @type {HTMLCanvasElement} * @type {HTMLCanvasElement}
*/ */
this.canvas_ = /** @type {HTMLCanvasElement} */ this.canvas_ = /** @type {HTMLCanvasElement} */
(goog.dom.createElement(goog.dom.TagName.CANVAS)); (goog.dom.createElement('CANVAS'));
this.canvas_.style.width = '100%'; this.canvas_.style.width = '100%';
this.canvas_.style.height = '100%'; this.canvas_.style.height = '100%';
this.canvas_.className = ol.css.CLASS_UNSELECTABLE; this.canvas_.className = ol.css.CLASS_UNSELECTABLE;
+1 -2
View File
@@ -3,7 +3,6 @@ goog.provide('ol.style.AtlasManager');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.functions'); goog.require('goog.functions');
goog.require('goog.object'); goog.require('goog.object');
goog.require('ol'); goog.require('ol');
@@ -298,7 +297,7 @@ ol.style.Atlas = function(size, space) {
* @type {HTMLCanvasElement} * @type {HTMLCanvasElement}
*/ */
this.canvas_ = /** @type {HTMLCanvasElement} */ this.canvas_ = /** @type {HTMLCanvasElement} */
(goog.dom.createElement(goog.dom.TagName.CANVAS)); (goog.dom.createElement('CANVAS'));
this.canvas_.width = size; this.canvas_.width = size;
this.canvas_.height = size; this.canvas_.height = size;
+2 -3
View File
@@ -2,7 +2,6 @@ goog.provide('ol.style.Circle');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('ol'); goog.require('ol');
goog.require('ol.color'); goog.require('ol.color');
goog.require('ol.has'); goog.require('ol.has');
@@ -273,7 +272,7 @@ ol.style.Circle.prototype.render_ = function(atlasManager) {
if (atlasManager === undefined) { if (atlasManager === undefined) {
// no atlas manager is used, create a new canvas // no atlas manager is used, create a new canvas
this.canvas_ = /** @type {HTMLCanvasElement} */ this.canvas_ = /** @type {HTMLCanvasElement} */
(goog.dom.createElement(goog.dom.TagName.CANVAS)); (goog.dom.createElement('CANVAS'));
this.canvas_.height = size; this.canvas_.height = size;
this.canvas_.width = size; this.canvas_.width = size;
@@ -374,7 +373,7 @@ ol.style.Circle.prototype.createHitDetectionCanvas_ = function(renderOptions) {
// if no fill style is set, create an extra hit-detection image with a // if no fill style is set, create an extra hit-detection image with a
// default fill style // default fill style
this.hitDetectionCanvas_ = /** @type {HTMLCanvasElement} */ this.hitDetectionCanvas_ = /** @type {HTMLCanvasElement} */
(goog.dom.createElement(goog.dom.TagName.CANVAS)); (goog.dom.createElement('CANVAS'));
var canvas = this.hitDetectionCanvas_; var canvas = this.hitDetectionCanvas_;
canvas.height = renderOptions.size; canvas.height = renderOptions.size;
+2 -3
View File
@@ -2,7 +2,6 @@ goog.provide('ol.style.RegularShape');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('ol'); goog.require('ol');
goog.require('ol.color'); goog.require('ol.color');
goog.require('ol.has'); goog.require('ol.has');
@@ -353,7 +352,7 @@ ol.style.RegularShape.prototype.render_ = function(atlasManager) {
if (atlasManager === undefined) { if (atlasManager === undefined) {
// no atlas manager is used, create a new canvas // no atlas manager is used, create a new canvas
this.canvas_ = /** @type {HTMLCanvasElement} */ this.canvas_ = /** @type {HTMLCanvasElement} */
(goog.dom.createElement(goog.dom.TagName.CANVAS)); (goog.dom.createElement('CANVAS'));
this.canvas_.height = size; this.canvas_.height = size;
this.canvas_.width = size; this.canvas_.width = size;
@@ -465,7 +464,7 @@ ol.style.RegularShape.prototype.createHitDetectionCanvas_ =
// if no fill style is set, create an extra hit-detection image with a // if no fill style is set, create an extra hit-detection image with a
// default fill style // default fill style
this.hitDetectionCanvas_ = /** @type {HTMLCanvasElement} */ this.hitDetectionCanvas_ = /** @type {HTMLCanvasElement} */
(goog.dom.createElement(goog.dom.TagName.CANVAS)); (goog.dom.createElement('CANVAS'));
var canvas = this.hitDetectionCanvas_; var canvas = this.hitDetectionCanvas_;
canvas.height = renderOptions.size; canvas.height = renderOptions.size;
+1 -2
View File
@@ -7,7 +7,7 @@ describe('ol.control.Control', function() {
map = new ol.Map({ map = new ol.Map({
target: document.createElement('div') target: document.createElement('div')
}); });
var element = goog.dom.createDom(goog.dom.TagName.DIV); var element = goog.dom.createDom('DIV');
control = new ol.control.Control({element: element}); control = new ol.control.Control({element: element});
control.setMap(map); control.setMap(map);
}); });
@@ -50,6 +50,5 @@ describe('ol.control.Control\'s target', function() {
goog.require('goog.dispose'); goog.require('goog.dispose');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('ol.Map'); goog.require('ol.Map');
goog.require('ol.control.Control'); goog.require('ol.control.Control');
+1 -2
View File
@@ -3,7 +3,7 @@ goog.provide('ol.test.format.GML');
var readGeometry = function(format, text, opt_options) { var readGeometry = function(format, text, opt_options) {
var doc = ol.xml.parse(text); var doc = ol.xml.parse(text);
// we need an intermediate node for testing purposes // we need an intermediate node for testing purposes
var node = goog.dom.createElement(goog.dom.TagName.PRE); var node = goog.dom.createElement('PRE');
node.appendChild(doc.documentElement); node.appendChild(doc.documentElement);
return format.readGeometryFromNode(node, opt_options); return format.readGeometryFromNode(node, opt_options);
}; };
@@ -1261,7 +1261,6 @@ describe('ol.format.GML3', function() {
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('ol.format.GML'); goog.require('ol.format.GML');
goog.require('ol.format.GML2'); goog.require('ol.format.GML2');
goog.require('ol.format.GML3'); goog.require('ol.format.GML3');
+1 -2
View File
@@ -11,7 +11,7 @@ describe('ol.MapBrowserEventHandler', function() {
beforeEach(function() { beforeEach(function() {
clock = sinon.useFakeTimers(); clock = sinon.useFakeTimers();
target = goog.dom.createElement(goog.dom.TagName.DIV); target = goog.dom.createElement('DIV');
handler = new ol.MapBrowserEventHandler(new ol.Map({ handler = new ol.MapBrowserEventHandler(new ol.Map({
target: target target: target
})); }));
@@ -118,7 +118,6 @@ describe('ol.MapBrowserEventHandler', function() {
}); });
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.events'); goog.require('goog.events');
goog.require('goog.events.BrowserEvent'); goog.require('goog.events.BrowserEvent');
goog.require('ol.Map'); goog.require('ol.Map');
+1 -2
View File
@@ -8,7 +8,7 @@ describe('ol.pointer.MouseSource', function() {
beforeEach(function() { beforeEach(function() {
clock = sinon.useFakeTimers(); clock = sinon.useFakeTimers();
target = goog.dom.createElement(goog.dom.TagName.DIV); target = goog.dom.createElement('DIV');
// make sure that a mouse and touch event source is used // make sure that a mouse and touch event source is used
ol.has.POINTER = false; ol.has.POINTER = false;
@@ -92,7 +92,6 @@ describe('ol.pointer.MouseSource', function() {
}); });
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.events'); goog.require('goog.events');
goog.require('goog.events.BrowserEvent'); goog.require('goog.events.BrowserEvent');
goog.require('ol.has'); goog.require('ol.has');
@@ -6,7 +6,7 @@ describe('ol.pointer.PointerEventHandler', function() {
var eventSpy; var eventSpy;
beforeEach(function() { beforeEach(function() {
target = goog.dom.createElement(goog.dom.TagName.DIV); target = goog.dom.createElement('DIV');
// make sure that a mouse event source is used // make sure that a mouse event source is used
ol.has.POINTER = false; ol.has.POINTER = false;
@@ -161,7 +161,6 @@ describe('ol.pointer.PointerEventHandler', function() {
}); });
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.events'); goog.require('goog.events');
goog.require('goog.events.BrowserEvent'); goog.require('goog.events.BrowserEvent');
goog.require('ol.has'); goog.require('ol.has');
+1 -2
View File
@@ -8,7 +8,7 @@ describe('ol.pointer.TouchSource', function() {
var eventSpy; var eventSpy;
beforeEach(function() { beforeEach(function() {
target = goog.dom.createElement(goog.dom.TagName.DIV); target = goog.dom.createElement('DIV');
// make sure that a mouse and touch event source is used // make sure that a mouse and touch event source is used
ol.has.POINTER = false; ol.has.POINTER = false;
@@ -130,7 +130,6 @@ describe('ol.pointer.TouchSource', function() {
}); });
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.events'); goog.require('goog.events');
goog.require('goog.events.BrowserEvent'); goog.require('goog.events.BrowserEvent');
goog.require('ol.has'); goog.require('ol.has');