Rename _ol_OverlayPositioning_ to OverlayPositioning
This commit is contained in:
+14
-14
@@ -4,7 +4,7 @@
|
|||||||
import {inherits} from './index.js';
|
import {inherits} from './index.js';
|
||||||
import MapEventType from './MapEventType.js';
|
import MapEventType from './MapEventType.js';
|
||||||
import _ol_Object_ from './Object.js';
|
import _ol_Object_ from './Object.js';
|
||||||
import _ol_OverlayPositioning_ from './OverlayPositioning.js';
|
import OverlayPositioning from './OverlayPositioning.js';
|
||||||
import _ol_css_ from './css.js';
|
import _ol_css_ from './css.js';
|
||||||
import {removeNode, removeChildren, outerWidth, outerHeight} from './dom.js';
|
import {removeNode, removeChildren, outerWidth, outerHeight} from './dom.js';
|
||||||
import _ol_events_ from './events.js';
|
import _ol_events_ from './events.js';
|
||||||
@@ -139,7 +139,7 @@ var _ol_Overlay_ = function(options) {
|
|||||||
|
|
||||||
this.setPositioning(options.positioning !== undefined ?
|
this.setPositioning(options.positioning !== undefined ?
|
||||||
/** @type {ol.OverlayPositioning} */ (options.positioning) :
|
/** @type {ol.OverlayPositioning} */ (options.positioning) :
|
||||||
_ol_OverlayPositioning_.TOP_LEFT);
|
OverlayPositioning.TOP_LEFT);
|
||||||
|
|
||||||
if (options.position !== undefined) {
|
if (options.position !== undefined) {
|
||||||
this.setPosition(options.position);
|
this.setPosition(options.position);
|
||||||
@@ -481,9 +481,9 @@ _ol_Overlay_.prototype.updateRenderedPosition = function(pixel, mapSize) {
|
|||||||
|
|
||||||
var offsetX = offset[0];
|
var offsetX = offset[0];
|
||||||
var offsetY = offset[1];
|
var offsetY = offset[1];
|
||||||
if (positioning == _ol_OverlayPositioning_.BOTTOM_RIGHT ||
|
if (positioning == OverlayPositioning.BOTTOM_RIGHT ||
|
||||||
positioning == _ol_OverlayPositioning_.CENTER_RIGHT ||
|
positioning == OverlayPositioning.CENTER_RIGHT ||
|
||||||
positioning == _ol_OverlayPositioning_.TOP_RIGHT) {
|
positioning == OverlayPositioning.TOP_RIGHT) {
|
||||||
if (this.rendered.left_ !== '') {
|
if (this.rendered.left_ !== '') {
|
||||||
this.rendered.left_ = style.left = '';
|
this.rendered.left_ = style.left = '';
|
||||||
}
|
}
|
||||||
@@ -495,9 +495,9 @@ _ol_Overlay_.prototype.updateRenderedPosition = function(pixel, mapSize) {
|
|||||||
if (this.rendered.right_ !== '') {
|
if (this.rendered.right_ !== '') {
|
||||||
this.rendered.right_ = style.right = '';
|
this.rendered.right_ = style.right = '';
|
||||||
}
|
}
|
||||||
if (positioning == _ol_OverlayPositioning_.BOTTOM_CENTER ||
|
if (positioning == OverlayPositioning.BOTTOM_CENTER ||
|
||||||
positioning == _ol_OverlayPositioning_.CENTER_CENTER ||
|
positioning == OverlayPositioning.CENTER_CENTER ||
|
||||||
positioning == _ol_OverlayPositioning_.TOP_CENTER) {
|
positioning == OverlayPositioning.TOP_CENTER) {
|
||||||
offsetX -= this.element.offsetWidth / 2;
|
offsetX -= this.element.offsetWidth / 2;
|
||||||
}
|
}
|
||||||
var left = Math.round(pixel[0] + offsetX) + 'px';
|
var left = Math.round(pixel[0] + offsetX) + 'px';
|
||||||
@@ -505,9 +505,9 @@ _ol_Overlay_.prototype.updateRenderedPosition = function(pixel, mapSize) {
|
|||||||
this.rendered.left_ = style.left = left;
|
this.rendered.left_ = style.left = left;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (positioning == _ol_OverlayPositioning_.BOTTOM_LEFT ||
|
if (positioning == OverlayPositioning.BOTTOM_LEFT ||
|
||||||
positioning == _ol_OverlayPositioning_.BOTTOM_CENTER ||
|
positioning == OverlayPositioning.BOTTOM_CENTER ||
|
||||||
positioning == _ol_OverlayPositioning_.BOTTOM_RIGHT) {
|
positioning == OverlayPositioning.BOTTOM_RIGHT) {
|
||||||
if (this.rendered.top_ !== '') {
|
if (this.rendered.top_ !== '') {
|
||||||
this.rendered.top_ = style.top = '';
|
this.rendered.top_ = style.top = '';
|
||||||
}
|
}
|
||||||
@@ -519,9 +519,9 @@ _ol_Overlay_.prototype.updateRenderedPosition = function(pixel, mapSize) {
|
|||||||
if (this.rendered.bottom_ !== '') {
|
if (this.rendered.bottom_ !== '') {
|
||||||
this.rendered.bottom_ = style.bottom = '';
|
this.rendered.bottom_ = style.bottom = '';
|
||||||
}
|
}
|
||||||
if (positioning == _ol_OverlayPositioning_.CENTER_LEFT ||
|
if (positioning == OverlayPositioning.CENTER_LEFT ||
|
||||||
positioning == _ol_OverlayPositioning_.CENTER_CENTER ||
|
positioning == OverlayPositioning.CENTER_CENTER ||
|
||||||
positioning == _ol_OverlayPositioning_.CENTER_RIGHT) {
|
positioning == OverlayPositioning.CENTER_RIGHT) {
|
||||||
offsetY -= this.element.offsetHeight / 2;
|
offsetY -= this.element.offsetHeight / 2;
|
||||||
}
|
}
|
||||||
var top = Math.round(pixel[1] + offsetY) + 'px';
|
var top = Math.round(pixel[1] + offsetY) + 'px';
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import _ol_MapProperty_ from '../MapProperty.js';
|
|||||||
import _ol_Object_ from '../Object.js';
|
import _ol_Object_ from '../Object.js';
|
||||||
import ObjectEventType from '../ObjectEventType.js';
|
import ObjectEventType from '../ObjectEventType.js';
|
||||||
import _ol_Overlay_ from '../Overlay.js';
|
import _ol_Overlay_ from '../Overlay.js';
|
||||||
import _ol_OverlayPositioning_ from '../OverlayPositioning.js';
|
import OverlayPositioning from '../OverlayPositioning.js';
|
||||||
import _ol_ViewProperty_ from '../ViewProperty.js';
|
import _ol_ViewProperty_ from '../ViewProperty.js';
|
||||||
import Control from '../control/Control.js';
|
import Control from '../control/Control.js';
|
||||||
import _ol_coordinate_ from '../coordinate.js';
|
import _ol_coordinate_ from '../coordinate.js';
|
||||||
@@ -142,7 +142,7 @@ var OverviewMap = function(opt_options) {
|
|||||||
*/
|
*/
|
||||||
this.boxOverlay_ = new _ol_Overlay_({
|
this.boxOverlay_ = new _ol_Overlay_({
|
||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
positioning: _ol_OverlayPositioning_.BOTTOM_LEFT,
|
positioning: OverlayPositioning.BOTTOM_LEFT,
|
||||||
element: box
|
element: box
|
||||||
});
|
});
|
||||||
this.ovmap_.addOverlay(this.boxOverlay_);
|
this.ovmap_.addOverlay(this.boxOverlay_);
|
||||||
|
|||||||
Reference in New Issue
Block a user