-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Description
When using code from sample
polylineLayer.on('mouseover', function () {
this.setText(' \u25BA ', {repeat: true, offset: 0, attributes: {'fill': 'lightblue'}});
});
polylineLayer.on('mouseout', function () {
this.setText(null);
});
setText(null) works as expected
I tried to replace this by a zoom controled version
map.on("zoomend", function() {
var zoom = this.getZoom();
console.log(zoom);
if (zoom > 10) {
console.log("show");
polylineLayer.setText(' \u25BA ', {repeat: true, offset: 0, attributes: {'fill': 'lightblue'}});
} else {
console.log("hide");
polylineLayer.setText(null);
}
})
In this case, setText shows Text after zoom level 11 is reached, but it does not remove text after zoom level decreases to 10 or lower. Anyway console.log('hide') is called
Metadata
Metadata
Assignees
Labels
No labels