Factor out css.js and fix requires
This commit is contained in:
@@ -14,6 +14,7 @@ goog.require('ol.MapEvent');
|
||||
goog.require('ol.MapEventType');
|
||||
goog.require('ol.TileRange');
|
||||
goog.require('ol.control.Control');
|
||||
goog.require('ol.css');
|
||||
goog.require('ol.source.Source');
|
||||
|
||||
|
||||
@@ -34,7 +35,7 @@ ol.control.Attribution = function(opt_options) {
|
||||
this.ulElement_ = goog.dom.createElement(goog.dom.TagName.UL);
|
||||
|
||||
var element = goog.dom.createDom(goog.dom.TagName.DIV, {
|
||||
'class': 'ol-attribution ' + ol.CSS_CLASS_UNSELECTABLE
|
||||
'class': 'ol-attribution ' + ol.css.CLASS_UNSELECTABLE
|
||||
}, this.ulElement_);
|
||||
|
||||
goog.base(this, {
|
||||
|
||||
@@ -9,6 +9,7 @@ goog.require('ol.FrameState');
|
||||
goog.require('ol.MapEvent');
|
||||
goog.require('ol.MapEventType');
|
||||
goog.require('ol.control.Control');
|
||||
goog.require('ol.css');
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +29,7 @@ ol.control.Logo = function(opt_options) {
|
||||
this.ulElement_ = goog.dom.createElement(goog.dom.TagName.UL);
|
||||
|
||||
var element = goog.dom.createDom(goog.dom.TagName.DIV, {
|
||||
'class': 'ol-logo ' + ol.CSS_CLASS_UNSELECTABLE
|
||||
'class': 'ol-logo ' + ol.css.CLASS_UNSELECTABLE
|
||||
}, this.ulElement_);
|
||||
|
||||
goog.base(this, {
|
||||
|
||||
@@ -3,13 +3,13 @@ goog.provide('ol.control.ScaleLineUnits');
|
||||
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.style');
|
||||
goog.require('ol');
|
||||
goog.require('ol.FrameState');
|
||||
goog.require('ol.MapEvent');
|
||||
goog.require('ol.MapEventType');
|
||||
goog.require('ol.ProjectionUnits');
|
||||
goog.require('ol.TransformFunction');
|
||||
goog.require('ol.control.Control');
|
||||
goog.require('ol.css');
|
||||
goog.require('ol.projection');
|
||||
goog.require('ol.sphere.NORMAL');
|
||||
|
||||
@@ -49,7 +49,7 @@ ol.control.ScaleLine = function(opt_options) {
|
||||
* @type {Element}
|
||||
*/
|
||||
this.element_ = goog.dom.createDom(goog.dom.TagName.DIV, {
|
||||
'class': 'ol-scale-line ' + ol.CSS_CLASS_UNSELECTABLE
|
||||
'class': 'ol-scale-line ' + ol.css.CLASS_UNSELECTABLE
|
||||
}, this.innerElement_);
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,8 +6,8 @@ goog.require('goog.dom');
|
||||
goog.require('goog.dom.TagName');
|
||||
goog.require('goog.events');
|
||||
goog.require('goog.events.EventType');
|
||||
goog.require('ol');
|
||||
goog.require('ol.control.Control');
|
||||
goog.require('ol.css');
|
||||
|
||||
|
||||
/**
|
||||
@@ -44,7 +44,7 @@ ol.control.Zoom = function(opt_options) {
|
||||
goog.events.EventType.CLICK
|
||||
], this.handleOut_, false, this);
|
||||
|
||||
var cssClasses = 'ol-zoom ' + ol.CSS_CLASS_UNSELECTABLE;
|
||||
var cssClasses = 'ol-zoom ' + ol.css.CLASS_UNSELECTABLE;
|
||||
var element = goog.dom.createDom(goog.dom.TagName.DIV, cssClasses, inElement,
|
||||
outElement);
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ goog.require('goog.dom.TagName');
|
||||
goog.require('goog.events');
|
||||
goog.require('goog.fx.Dragger');
|
||||
goog.require('goog.style');
|
||||
goog.require('ol');
|
||||
goog.require('ol.MapEventType');
|
||||
goog.require('ol.control.Control');
|
||||
goog.require('ol.css');
|
||||
|
||||
|
||||
|
||||
@@ -363,9 +363,9 @@ ol.control.ZoomSlider.prototype.createDraggable_ = function(elem) {
|
||||
ol.control.ZoomSlider.prototype.createDom_ = function(opt_elem) {
|
||||
var elem,
|
||||
sliderCssCls = ol.control.ZoomSlider.CSS_CLASS_CONTAINER + ' ' +
|
||||
ol.CSS_CLASS_UNSELECTABLE,
|
||||
ol.css.CLASS_UNSELECTABLE,
|
||||
thumbCssCls = ol.control.ZoomSlider.CSS_CLASS_THUMB + ' ' +
|
||||
ol.CSS_CLASS_UNSELECTABLE;
|
||||
ol.css.CLASS_UNSELECTABLE;
|
||||
|
||||
elem = goog.dom.createDom(goog.dom.TagName.DIV, sliderCssCls,
|
||||
goog.dom.createDom(goog.dom.TagName.DIV, thumbCssCls));
|
||||
|
||||
9
src/ol/css.js
Normal file
9
src/ol/css.js
Normal file
@@ -0,0 +1,9 @@
|
||||
goog.provide('ol.css');
|
||||
|
||||
|
||||
/**
|
||||
* The CSS class that we'll give the DOM elements to have them unselectable.
|
||||
*
|
||||
* @const {string}
|
||||
*/
|
||||
ol.css.CLASS_UNSELECTABLE = 'ol-unselectable';
|
||||
@@ -7,11 +7,3 @@ if (goog.DEBUG) {
|
||||
var logger = goog.debug.Logger.getLogger('ol');
|
||||
logger.setLevel(goog.debug.Logger.Level.FINEST);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The CSS class that we'll give the DOM elements to have them unselectable.
|
||||
*
|
||||
* @const {string}
|
||||
*/
|
||||
ol.CSS_CLASS_UNSELECTABLE = 'ol-unselectable';
|
||||
|
||||
@@ -6,8 +6,8 @@ goog.require('goog.array');
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.style');
|
||||
goog.require('goog.vec.Mat4');
|
||||
goog.require('ol');
|
||||
goog.require('ol.Size');
|
||||
goog.require('ol.css');
|
||||
goog.require('ol.layer.ImageLayer');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.layer.Vector');
|
||||
@@ -41,7 +41,7 @@ ol.renderer.canvas.Map = function(container, map) {
|
||||
this.canvas_ = goog.dom.createElement(goog.dom.TagName.CANVAS);
|
||||
this.canvas_.height = this.canvasSize_.height;
|
||||
this.canvas_.width = this.canvasSize_.width;
|
||||
this.canvas_.className = ol.CSS_CLASS_UNSELECTABLE;
|
||||
this.canvas_.className = ol.css.CLASS_UNSELECTABLE;
|
||||
goog.dom.insertChildAt(container, this.canvas_, 0);
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,7 @@ goog.require('goog.asserts');
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.dom.TagName');
|
||||
goog.require('goog.style');
|
||||
goog.require('ol');
|
||||
goog.require('ol.css');
|
||||
goog.require('ol.layer.ImageLayer');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.renderer.Map');
|
||||
@@ -29,7 +29,7 @@ ol.renderer.dom.Map = function(container, map) {
|
||||
* @private
|
||||
*/
|
||||
this.layersPane_ = goog.dom.createElement(goog.dom.TagName.DIV);
|
||||
this.layersPane_.className = 'ol-layers ' + ol.CSS_CLASS_UNSELECTABLE;
|
||||
this.layersPane_.className = 'ol-layers ' + ol.css.CLASS_UNSELECTABLE;
|
||||
var style = this.layersPane_.style;
|
||||
style.position = 'absolute';
|
||||
style.width = '100%';
|
||||
|
||||
@@ -10,10 +10,10 @@ goog.require('goog.events');
|
||||
goog.require('goog.events.Event');
|
||||
goog.require('goog.style');
|
||||
goog.require('goog.webgl');
|
||||
goog.require('ol');
|
||||
goog.require('ol.FrameState');
|
||||
goog.require('ol.Size');
|
||||
goog.require('ol.Tile');
|
||||
goog.require('ol.css');
|
||||
goog.require('ol.layer.ImageLayer');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.renderer.Map');
|
||||
@@ -75,7 +75,7 @@ ol.renderer.webgl.Map = function(container, map) {
|
||||
this.canvas_ = goog.dom.createElement(goog.dom.TagName.CANVAS);
|
||||
this.canvas_.height = container.clientHeight;
|
||||
this.canvas_.width = container.clientWidth;
|
||||
this.canvas_.className = ol.CSS_CLASS_UNSELECTABLE;
|
||||
this.canvas_.className = ol.css.CLASS_UNSELECTABLE;
|
||||
goog.dom.insertChildAt(container, this.canvas_, 0);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user