Zoomslider cannot be added to a map with no target
The zoom slider control's initSlider_ function requires that the control's element is inserted in the document. So if initSlider_ is called before the map have a target then the slider isn't correctly initialized. This commit fixes that by defering the slider initialization until the first handleMapPostrender call.
This commit is contained in:
@@ -68,6 +68,7 @@ describe('ol.control.ZoomSlider', function() {
|
||||
control.element.style.width = '1000px';
|
||||
control.element.style.height = '10px';
|
||||
control.setMap(map);
|
||||
control.initSlider_();
|
||||
|
||||
var horizontal = ol.control.ZoomSlider.direction.HORIZONTAL;
|
||||
expect(control.direction_).to.be(horizontal);
|
||||
|
||||
Reference in New Issue
Block a user