Remove use of goog.dom.createElement
This commit is contained in:
@@ -37,13 +37,13 @@ ol.control.Attribution = function(opt_options) {
|
|||||||
* @private
|
* @private
|
||||||
* @type {Element}
|
* @type {Element}
|
||||||
*/
|
*/
|
||||||
this.ulElement_ = goog.dom.createElement('UL');
|
this.ulElement_ = document.createElement('UL');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Element}
|
* @type {Element}
|
||||||
*/
|
*/
|
||||||
this.logoLi_ = goog.dom.createElement('LI');
|
this.logoLi_ = document.createElement('LI');
|
||||||
|
|
||||||
this.ulElement_.appendChild(this.logoLi_);
|
this.ulElement_.appendChild(this.logoLi_);
|
||||||
goog.style.setElementShown(this.logoLi_, false);
|
goog.style.setElementShown(this.logoLi_, false);
|
||||||
@@ -261,7 +261,7 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (attributionKey in visibleAttributions) {
|
for (attributionKey in visibleAttributions) {
|
||||||
attributionElement = goog.dom.createElement('LI');
|
attributionElement = document.createElement('LI');
|
||||||
attributionElement.innerHTML =
|
attributionElement.innerHTML =
|
||||||
visibleAttributions[attributionKey].getHTML();
|
visibleAttributions[attributionKey].getHTML();
|
||||||
this.ulElement_.appendChild(attributionElement);
|
this.ulElement_.appendChild(attributionElement);
|
||||||
@@ -269,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('LI');
|
attributionElement = document.createElement('LI');
|
||||||
attributionElement.innerHTML =
|
attributionElement.innerHTML =
|
||||||
hiddenAttributions[attributionKey].getHTML();
|
hiddenAttributions[attributionKey].getHTML();
|
||||||
goog.style.setElementShown(attributionElement, false);
|
goog.style.setElementShown(attributionElement, false);
|
||||||
|
|||||||
@@ -17,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('CANVAS');
|
var canvas = document.createElement('CANVAS');
|
||||||
if (opt_width) {
|
if (opt_width) {
|
||||||
canvas.width = opt_width;
|
canvas.width = opt_width;
|
||||||
}
|
}
|
||||||
@@ -44,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('P'),
|
var el = document.createElement('P'),
|
||||||
has2d,
|
has2d,
|
||||||
transforms = {
|
transforms = {
|
||||||
'webkitTransform': '-webkit-transform',
|
'webkitTransform': '-webkit-transform',
|
||||||
@@ -87,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('P'),
|
var el = document.createElement('P'),
|
||||||
has3d,
|
has3d,
|
||||||
transforms = {
|
transforms = {
|
||||||
'webkitTransform': '-webkit-transform',
|
'webkitTransform': '-webkit-transform',
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
goog.provide('ol.has');
|
goog.provide('ol.has');
|
||||||
|
|
||||||
goog.require('goog.dom');
|
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
goog.require('ol.dom');
|
goog.require('ol.dom');
|
||||||
goog.require('ol.webgl');
|
goog.require('ol.webgl');
|
||||||
@@ -124,7 +123,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('CANVAS'));
|
(document.createElement('CANVAS'));
|
||||||
var gl = ol.webgl.getContext(canvas, {
|
var gl = ol.webgl.getContext(canvas, {
|
||||||
failIfMajorPerformanceCaveat: true
|
failIfMajorPerformanceCaveat: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -20,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('DIV');
|
var target = document.createElement('DIV');
|
||||||
target.style.position = 'absolute';
|
target.style.position = 'absolute';
|
||||||
|
|
||||||
goog.base(this, imageLayer, target);
|
goog.base(this, imageLayer, target);
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ ol.renderer.dom.Map = function(container, map) {
|
|||||||
* @type {!Element}
|
* @type {!Element}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.layersPane_ = goog.dom.createElement('DIV');
|
this.layersPane_ = document.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';
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ goog.require('ol.vec.Mat4');
|
|||||||
*/
|
*/
|
||||||
ol.renderer.dom.TileLayer = function(tileLayer) {
|
ol.renderer.dom.TileLayer = function(tileLayer) {
|
||||||
|
|
||||||
var target = goog.dom.createElement('DIV');
|
var target = document.createElement('DIV');
|
||||||
target.style.position = 'absolute';
|
target.style.position = 'absolute';
|
||||||
|
|
||||||
goog.base(this, tileLayer, target);
|
goog.base(this, tileLayer, target);
|
||||||
@@ -276,7 +276,7 @@ ol.renderer.dom.TileLayerZ_ = function(tileGrid, tileCoordOrigin) {
|
|||||||
/**
|
/**
|
||||||
* @type {!Element}
|
* @type {!Element}
|
||||||
*/
|
*/
|
||||||
this.target = goog.dom.createElement('DIV');
|
this.target = document.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%';
|
||||||
@@ -359,7 +359,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('DIV');
|
tileElement = document.createElement('DIV');
|
||||||
tileElementStyle = tileElement.style;
|
tileElementStyle = tileElement.style;
|
||||||
tileElementStyle.overflow = 'hidden';
|
tileElementStyle.overflow = 'hidden';
|
||||||
tileElementStyle.width = tileSize[0] + 'px';
|
tileElementStyle.width = tileSize[0] + 'px';
|
||||||
|
|||||||
@@ -58,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('CANVAS'));
|
(document.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;
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ goog.provide('ol.style.Atlas');
|
|||||||
goog.provide('ol.style.AtlasManager');
|
goog.provide('ol.style.AtlasManager');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom');
|
|
||||||
goog.require('goog.functions');
|
goog.require('goog.functions');
|
||||||
goog.require('goog.object');
|
goog.require('goog.object');
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
@@ -297,7 +296,7 @@ ol.style.Atlas = function(size, space) {
|
|||||||
* @type {HTMLCanvasElement}
|
* @type {HTMLCanvasElement}
|
||||||
*/
|
*/
|
||||||
this.canvas_ = /** @type {HTMLCanvasElement} */
|
this.canvas_ = /** @type {HTMLCanvasElement} */
|
||||||
(goog.dom.createElement('CANVAS'));
|
(document.createElement('CANVAS'));
|
||||||
this.canvas_.width = size;
|
this.canvas_.width = size;
|
||||||
this.canvas_.height = size;
|
this.canvas_.height = size;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
goog.provide('ol.style.Circle');
|
goog.provide('ol.style.Circle');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom');
|
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
goog.require('ol.color');
|
goog.require('ol.color');
|
||||||
goog.require('ol.has');
|
goog.require('ol.has');
|
||||||
@@ -272,7 +271,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('CANVAS'));
|
(document.createElement('CANVAS'));
|
||||||
this.canvas_.height = size;
|
this.canvas_.height = size;
|
||||||
this.canvas_.width = size;
|
this.canvas_.width = size;
|
||||||
|
|
||||||
@@ -373,7 +372,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('CANVAS'));
|
(document.createElement('CANVAS'));
|
||||||
var canvas = this.hitDetectionCanvas_;
|
var canvas = this.hitDetectionCanvas_;
|
||||||
|
|
||||||
canvas.height = renderOptions.size;
|
canvas.height = renderOptions.size;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
goog.provide('ol.style.RegularShape');
|
goog.provide('ol.style.RegularShape');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom');
|
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
goog.require('ol.color');
|
goog.require('ol.color');
|
||||||
goog.require('ol.has');
|
goog.require('ol.has');
|
||||||
@@ -352,7 +351,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('CANVAS'));
|
(document.createElement('CANVAS'));
|
||||||
|
|
||||||
this.canvas_.height = size;
|
this.canvas_.height = size;
|
||||||
this.canvas_.width = size;
|
this.canvas_.width = size;
|
||||||
@@ -464,7 +463,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('CANVAS'));
|
(document.createElement('CANVAS'));
|
||||||
var canvas = this.hitDetectionCanvas_;
|
var canvas = this.hitDetectionCanvas_;
|
||||||
|
|
||||||
canvas.height = renderOptions.size;
|
canvas.height = renderOptions.size;
|
||||||
|
|||||||
Reference in New Issue
Block a user