On Jan 1, 2016, at 3:22 AM, Rutger Kassies <[email protected]> wrote:
I cloned your gist and made a few simple edits, for me this zooms to the center of the 'current' extent, whereas yours drifted a bit (1/4th?) towards the edge. Here is my gist:
This a great step towards what i had in mind. Zooming with 'double click' works, but dragging afterwards again introduces resampling because it changes to zoom a little. This could probably fixed also adding a similar callback for that case. I haven't looked into it yet.
Additionally the zooming might be a bit more intuitive by zooming to the mouse x/y instead of the window center. I made a first attempt, the modified gist is here:
I'm not sure about the last gist, so be careful. It makes some assumptions about the origin of the projection for example, so i wouldn't be surprised if it fails for projections with a different origin then PseudoMercator. Unless the ".get_resolution()" call includes a sign with respect to the origin. Also, after a few times zooming in, it seems to skip increasing the zoom level at one step, zooming in further works again but it stays one level 'behind'.
Thanks again, and a bokehlicious 2016 to everyone!
On Thursday, December 31, 2015 at 4:27:05 AM UTC+1, [email protected] wrote:
Yes, makes complete sense. I myself have a use case for maintain the true resolutions of tiles. Shouldn't be a problem but will probably need to wait for next release for something formal. I think it would be nice to have smooth zoom with the wheel_zoom, and fixed resolution zoom with a double click or some other gesture.
One thing you can do for now is create a User Defined Model which extends TileRenderer. This would be a runtime extension of bokeh to include this functionality you desire. In this gist below, I demonstrate how to extend TileRenderer to do a fixed resolution zoom on double-click of the map. If you hold shift, then it will zoom out. This is NOT how it should be done long term, but may help for now. Note this is quick and dirty, but should work with the 0.11 release:
On Wednesday, December 23, 2015 at 9:21:11 AM UTC-6, Rutger Kassies wrote:
Is it possible to use a tile_source and having the zoom/extent snap to certain steps so that the original tiles aren't re-sampled in anyway? For example when using the tile_source example at:
The example works great, and performance is really good. But when you zoom, you can set it at arbitrary levels, causing the tiles to be re-sampled to a something different than their native resolution. I realize this is often convenient, but being a bit of a pixel-peeper myself I'd rather avoid 'uncontrolled' re-sampling unless i specify it myself. I'm not always using online TMS sources, but sometimes also locally created tiles with something like 'gdal2tiles.py' to break up really large rasters, like satellite images or stitched photo's (panoramas etc). But i think the source of the tiles is irrelevant in this case.
I'm not sure where to implement this. I imagine the zoom-related tools trigger some callback which sets the figure extent, this might be the place to round the extent to a multiple of 256 (in pixel units) when using 256px tiles. But when looking at the models, i can see the classes defining the tools, but there is hardly any code. So whats the location where i should be looking to achieve something like this? I'm currently working on 0.11.0dev5.
Any help is appreciated.
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/411ed69f-37f5-48a6-a530-67f08dbf7708%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.