Remove use of goog.dom.createDom
This commit is contained in:
+6
-5
@@ -260,7 +260,8 @@ ol.Map = function(options) {
|
|||||||
* @private
|
* @private
|
||||||
* @type {Element}
|
* @type {Element}
|
||||||
*/
|
*/
|
||||||
this.viewport_ = goog.dom.createDom('DIV', 'ol-viewport');
|
this.viewport_ = document.createElement('DIV');
|
||||||
|
this.viewport_.className = '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%';
|
||||||
@@ -276,16 +277,16 @@ ol.Map = function(options) {
|
|||||||
* @private
|
* @private
|
||||||
* @type {Element}
|
* @type {Element}
|
||||||
*/
|
*/
|
||||||
this.overlayContainer_ = goog.dom.createDom('DIV',
|
this.overlayContainer_ = document.createElement('DIV');
|
||||||
'ol-overlaycontainer');
|
this.overlayContainer_.className = 'ol-overlaycontainer';
|
||||||
this.viewport_.appendChild(this.overlayContainer_);
|
this.viewport_.appendChild(this.overlayContainer_);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Element}
|
* @type {Element}
|
||||||
*/
|
*/
|
||||||
this.overlayContainerStopEvent_ = goog.dom.createDom('DIV',
|
this.overlayContainerStopEvent_ = document.createElement('DIV');
|
||||||
'ol-overlaycontainer-stopevent');
|
this.overlayContainerStopEvent_.className = 'ol-overlaycontainer-stopevent';
|
||||||
goog.events.listen(this.overlayContainerStopEvent_, [
|
goog.events.listen(this.overlayContainerStopEvent_, [
|
||||||
goog.events.EventType.CLICK,
|
goog.events.EventType.CLICK,
|
||||||
goog.events.EventType.DBLCLICK,
|
goog.events.EventType.DBLCLICK,
|
||||||
|
|||||||
+2
-3
@@ -96,9 +96,8 @@ ol.Overlay = function(options) {
|
|||||||
* @private
|
* @private
|
||||||
* @type {Element}
|
* @type {Element}
|
||||||
*/
|
*/
|
||||||
this.element_ = goog.dom.createDom('DIV', {
|
this.element_ = document.createElement('DIV');
|
||||||
'class': 'ol-overlay-container'
|
this.element_.className = 'ol-overlay-container';
|
||||||
});
|
|
||||||
this.element_.style.position = 'absolute';
|
this.element_.style.position = 'absolute';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -18,6 +18,23 @@ describe('ol.Map', function() {
|
|||||||
expect(interactions.item(i).getMap()).to.be(map);
|
expect(interactions.item(i).getMap()).to.be(map);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('creates the viewport', function() {
|
||||||
|
var map = new ol.Map({});
|
||||||
|
var viewport = map.getViewport();
|
||||||
|
var className = 'ol-viewport' + (ol.has.TOUCH ? ' ol-touch' : '');
|
||||||
|
expect(viewport.className).to.be(className);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('creates the overlay containers', function() {
|
||||||
|
var map = new ol.Map({});
|
||||||
|
var container = map.getOverlayContainer();
|
||||||
|
expect(container.className).to.be('ol-overlaycontainer');
|
||||||
|
|
||||||
|
var containerStop = map.getOverlayContainerStopEvent();
|
||||||
|
expect(containerStop.className).to.be('ol-overlaycontainer-stopevent');
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('#addInteraction()', function() {
|
describe('#addInteraction()', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user