Mark overlayContainer and overlayContainerStopEvent as non-nullable
And remove an unnecessary cast
This commit is contained in:
+4
-4
@@ -272,7 +272,7 @@ ol.Map = function(options) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Element}
|
* @type {!Element}
|
||||||
*/
|
*/
|
||||||
this.overlayContainer_ = document.createElement('DIV');
|
this.overlayContainer_ = document.createElement('DIV');
|
||||||
this.overlayContainer_.className = 'ol-overlaycontainer';
|
this.overlayContainer_.className = 'ol-overlaycontainer';
|
||||||
@@ -280,7 +280,7 @@ ol.Map = function(options) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Element}
|
* @type {!Element}
|
||||||
*/
|
*/
|
||||||
this.overlayContainerStopEvent_ = document.createElement('DIV');
|
this.overlayContainerStopEvent_ = document.createElement('DIV');
|
||||||
this.overlayContainerStopEvent_.className = 'ol-overlaycontainer-stopevent';
|
this.overlayContainerStopEvent_.className = 'ol-overlaycontainer-stopevent';
|
||||||
@@ -904,7 +904,7 @@ ol.Map.prototype.getViewport = function() {
|
|||||||
* this container will let mousedown and touchstart events through to the map,
|
* this container will let mousedown and touchstart events through to the map,
|
||||||
* so clicks and gestures on an overlay will trigger {@link ol.MapBrowserEvent}
|
* so clicks and gestures on an overlay will trigger {@link ol.MapBrowserEvent}
|
||||||
* events.
|
* events.
|
||||||
* @return {Element} The map's overlay container.
|
* @return {!Element} The map's overlay container.
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.getOverlayContainer = function() {
|
ol.Map.prototype.getOverlayContainer = function() {
|
||||||
return this.overlayContainer_;
|
return this.overlayContainer_;
|
||||||
@@ -916,7 +916,7 @@ ol.Map.prototype.getOverlayContainer = function() {
|
|||||||
* event propagation. Elements added to this container won't let mousedown and
|
* event propagation. Elements added to this container won't let mousedown and
|
||||||
* touchstart events through to the map, so clicks and gestures on an overlay
|
* touchstart events through to the map, so clicks and gestures on an overlay
|
||||||
* don't trigger any {@link ol.MapBrowserEvent}.
|
* don't trigger any {@link ol.MapBrowserEvent}.
|
||||||
* @return {Element} The map's overlay container that stops events.
|
* @return {!Element} The map's overlay container that stops events.
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.getOverlayContainerStopEvent = function() {
|
ol.Map.prototype.getOverlayContainerStopEvent = function() {
|
||||||
return this.overlayContainerStopEvent_;
|
return this.overlayContainerStopEvent_;
|
||||||
|
|||||||
+1
-2
@@ -280,8 +280,7 @@ ol.Overlay.prototype.handleMapChanged = function() {
|
|||||||
var container = this.stopEvent_ ?
|
var container = this.stopEvent_ ?
|
||||||
map.getOverlayContainerStopEvent() : map.getOverlayContainer();
|
map.getOverlayContainerStopEvent() : map.getOverlayContainer();
|
||||||
if (this.insertFirst_) {
|
if (this.insertFirst_) {
|
||||||
goog.dom.insertChildAt(/** @type {!Element} */ (
|
goog.dom.insertChildAt(container, this.element_, 0);
|
||||||
container), this.element_, 0);
|
|
||||||
} else {
|
} else {
|
||||||
container.appendChild(this.element_);
|
container.appendChild(this.element_);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user