I’m trying to do a map where depending of zoom level the plot changes. For example, if I can see the countries the data is source_1 if I zoom in to see what have inside determined country the data that will appear is another. What is the best way to do this?customJS where I identify the zoom lvl and change data dynamic?change when range changes?If there is another way…
I didn’t try anything yet but maybe something like:
filter = CustomJSFilter(args=dict(source=source), code="""
var indices = [];
var zoom_level = cb_obj.end_zoom_level;
var zoom_threshold = 10;
for (var i = 0; i < source.get_length(); i++) {
if (zoom_level <= zoom_threshold) {
indices.push(i);
}
}
return indices;
""")