Export render from ol/control/Rotate

This commit is contained in:
Tim Schaub
2018-02-18 22:42:32 -07:00
parent fc0af19b59
commit 8e69393ddd
+4 -5
View File
@@ -59,13 +59,11 @@ const Rotate = function(opt_options) {
element.className = cssClasses; element.className = cssClasses;
element.appendChild(button); element.appendChild(button);
const render = options.render ? options.render : Rotate.render;
this.callResetNorth_ = options.resetNorth ? options.resetNorth : undefined; this.callResetNorth_ = options.resetNorth ? options.resetNorth : undefined;
Control.call(this, { Control.call(this, {
element: element, element: element,
render: render, render: options.render || render,
target: options.target target: options.target
}); });
@@ -141,7 +139,7 @@ Rotate.prototype.resetNorth_ = function() {
* @this {ol.control.Rotate} * @this {ol.control.Rotate}
* @api * @api
*/ */
Rotate.render = function(mapEvent) { export function render(mapEvent) {
const frameState = mapEvent.frameState; const frameState = mapEvent.frameState;
if (!frameState) { if (!frameState) {
return; return;
@@ -162,5 +160,6 @@ Rotate.render = function(mapEvent) {
this.label_.style.transform = transform; this.label_.style.transform = transform;
} }
this.rotation_ = rotation; this.rotation_ = rotation;
}; }
export default Rotate; export default Rotate;