MoffKalast / vizanti

A mission planner and visualizer for controlling outdoor ROS robots.
https://wiki.ros.org/vizanti
BSD 3-Clause "New" or "Revised" License
145 stars 30 forks source link

Add navsat tile zoom settings #4

Closed MoffKalast closed 4 months ago

MoffKalast commented 1 year ago

The tile zoom is set to 19 (max for OSM) by default and would need an input box to set it to anything else.

kosmonauta144 commented 5 months ago

would this enhancement allow to zoom out more? I am interesting in increasing max zoom out, but I don't know how to change it yet.

MoffKalast commented 5 months ago

Max zoom is defined here if you want to experiment with changing it (MIN_SCALE to something lower, e.g. 0.5), it's mainly limited to that so it clamps accidental zoomouts, but yes also to some extent so it doesn't trigger fetching of a billion navsat tiles. Fetching is throttled to prevent spamming the OSM CDN, so if the queue fills up at that scale it'll be processing it a long time and won't be very responsive if you move to a new area.

It would be certainly good to be able to zoom out further, since it's definitely annoying when working with very large areas (especially when trying to find the base_link relative to the faraway world origin).

There are lots of ways it could be partially worked around for the navsat widget, initially maybe just blocking fetching above some zoom level, discarding too old tiles in the loading queue or limiting its size, and the best option: automatically fetching larger tiles when zoomed out further (just like any proper GIS renderer does it) and as a draft when the max accuracy level hasn't loaded in yet. Perhaps level 17 as the draft and level 15 as the max zoom out, or just have it all completely dynamic.

It's currently rather hardcoded though so it would take some refactoring. Not all tile servers offer all zoom levels either, so having some adjustable numbers would not be the worst idea either.

kosmonauta144 commented 5 months ago

@darkhannibal and I are playing with your code in this repo https://github.com/kosmonauta144/vizanti to change time zoom level. It still needs some cleanup but for the moment is seems to work not as bad as I though it would.. We are still checking for errors, but if you have some time and you could check it for possible bugs or what can need improvement, it could be great.

MoffKalast commented 5 months ago

Oh awesome, I'll turn it into a PR and we can discuss and refine it there. :+1:

MoffKalast commented 4 months ago

Closed by #79 and #80. Opened #81.