Open randydapogi opened 3 weeks ago
currently it's implemented like this:
props.layerList?.forEach((layer, index) => {
control.value.addLayer(layer, index === 1);
});
Which means, that the second passed layer is always added to the right, others to the left.
Original implementation from ol-ext:
https://github.com/Viglino/ol-ext/blob/master/src/control/Swipe.js#L43-L46
This would be more explicit but changing it to align the API would introduce also a breaking change.
Hello. How do we control in which side of the Swipe Control the layer renders when layer is added to
layerList
. From my observation when adding multiple layers inlayerList
, the odd index layer are rendered in the left while the even index layers are rendered in the right. Is there a way to control the position of the layer similar toctrl.addLayer(osm, true)
of the ol-ext where passingtrue
renders the layer to the right while not passing a parameter default renders the layer to the left?