I am building a map with OpenLayers and I want to display a custom ZoomSlider outside of the map.
I know that displaying controls outside of the map goes like this:
JavaScript:
var ctrl= new ol.control.Zoom({
target: document.getElementById('ctrl')
});
map.addControl(ctrl);
Html:
<div id="ctrl"></div>
But it doesn't work with the ZoomSlider Control…
Any ideas?
Here is a Fiddle which shows the problem
Best Answer
Looks like
target
is not an option for zoom slider according to the api doc. UsesetTarget()
method as shown below.Updated your jsfiddle.