Skip to content
Browse files

Merge branch 'master' of github.com:openlayers/ol3 into vector

  • Loading branch information...
2 parents acd4f50 + f75d3ab commit 84154d7bb2291c49dae1bf41adfb08848f483a6f @ahocevar ahocevar committed Mar 12, 2013
View
3 src/ol/control/attributioncontrol.js
@@ -8,6 +8,7 @@ goog.require('goog.dom.TagName');
goog.require('goog.events');
goog.require('goog.object');
goog.require('goog.style');
+goog.require('ol');
goog.require('ol.Attribution');
goog.require('ol.FrameState');
goog.require('ol.MapEvent');
@@ -30,7 +31,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-unselectable'
+ 'class': 'ol-attribution ' + ol.CSS_CLASS_UNSELECTABLE
}, this.ulElement_);
goog.base(this, {
View
3 src/ol/control/scalelinecontrol.js
@@ -3,6 +3,7 @@ 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');
@@ -48,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-unselectable'
+ 'class': 'ol-scale-line ' + ol.CSS_CLASS_UNSELECTABLE
}, this.innerElement_);
/**
View
6 src/ol/control/zoomcontrol.js
@@ -6,6 +6,7 @@ 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');
@@ -43,8 +44,9 @@ ol.control.Zoom = function(opt_options) {
goog.events.EventType.CLICK
], this.handleOut_, false, this);
- var element = goog.dom.createDom(
- goog.dom.TagName.DIV, 'ol-zoom ol-unselectable', inElement, outElement);
+ var cssClasses = 'ol-zoom ' + ol.CSS_CLASS_UNSELECTABLE;
+ var element = goog.dom.createDom(goog.dom.TagName.DIV, cssClasses, inElement,
+ outElement);
goog.base(this, {
element: element,
View
8 src/ol/ol.js
@@ -7,3 +7,11 @@ 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';
View
3 src/ol/renderer/canvas/canvasmaprenderer.js
@@ -6,6 +6,7 @@ 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.layer.ImageLayer');
goog.require('ol.layer.TileLayer');
@@ -40,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-unselectable';
+ this.canvas_.className = ol.CSS_CLASS_UNSELECTABLE;
goog.dom.insertChildAt(container, this.canvas_, 0);
/**
View
12 src/ol/renderer/dom/dommaprenderer.js
@@ -5,6 +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.layer.ImageLayer');
goog.require('ol.layer.TileLayer');
goog.require('ol.renderer.Map');
@@ -28,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-unselectable';
+ this.layersPane_.className = 'ol-layers ' + ol.CSS_CLASS_UNSELECTABLE;
var style = this.layersPane_.style;
style.position = 'absolute';
style.width = '100%';
@@ -49,15 +50,6 @@ goog.inherits(ol.renderer.dom.Map, ol.renderer.Map);
/**
* @inheritDoc
*/
-ol.renderer.dom.Map.prototype.addLayer = function(layer) {
- goog.base(this, 'addLayer', layer);
- this.getMap().render();
-};
-
-
-/**
- * @inheritDoc
- */
ol.renderer.dom.Map.prototype.createLayerRenderer = function(layer) {
var layerRenderer;
if (layer instanceof ol.layer.TileLayer) {
View
2 src/ol/renderer/maprenderer.js
@@ -79,6 +79,7 @@ goog.inherits(ol.renderer.Map, goog.Disposable);
ol.renderer.Map.prototype.addLayer = function(layer) {
var layerRenderer = this.createLayerRenderer(layer);
this.setLayerRenderer(layer, layerRenderer);
+ this.getMap().render();
};
@@ -224,6 +225,7 @@ ol.renderer.Map.prototype.handleLayersRemove = function(collectionEvent) {
*/
ol.renderer.Map.prototype.removeLayer = function(layer) {
goog.dispose(this.removeLayerRenderer(layer));
+ this.getMap().render();
};
View
25 src/ol/renderer/webgl/webglmaprenderer.js
@@ -11,6 +11,7 @@ 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');
@@ -122,7 +123,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-unselectable';
+ this.canvas_.className = ol.CSS_CLASS_UNSELECTABLE;
goog.dom.insertChildAt(container, this.canvas_, 0);
/**
@@ -216,17 +217,6 @@ goog.inherits(ol.renderer.webgl.Map, ol.renderer.Map);
/**
- * @inheritDoc
- */
-ol.renderer.webgl.Map.prototype.addLayer = function(layer) {
- goog.base(this, 'addLayer', layer);
- if (layer.getVisible()) {
- this.getMap().render();
- }
-};
-
-
-/**
* @param {ol.Tile} tile Tile.
* @param {number} magFilter Mag filter.
* @param {number} minFilter Min filter.
@@ -467,17 +457,6 @@ ol.renderer.webgl.Map.prototype.isTileTextureLoaded = function(tile) {
/**
* @inheritDoc
*/
-ol.renderer.webgl.Map.prototype.removeLayer = function(layer) {
- goog.base(this, 'removeLayer', layer);
- if (layer.getVisible()) {
- this.getMap().render();
- }
-};
-
-
-/**
- * @inheritDoc
- */
ol.renderer.webgl.Map.prototype.renderFrame = function(frameState) {
var gl = this.getGL();

0 comments on commit 84154d7

Please sign in to comment.
Something went wrong with that request. Please try again.