jxmapviewer2
jxmapviewer2 copied to clipboard
Feature suggestion: Overzoom
It would be great to have the option to zoom in to a higher zoom level than there are actually tiles in a map, showing the tiles of the highest real zoom levels enlarged (and fuzzy) without any requests being sent to the tile server for the (nonexistent) zoom level.
Currently the maximum detail that can be shown in overlays on the map is limited by the totalMapZoom value where actual tiles are present.
Hmm ... what would be a use case for this? I personally find it fairly hard to read the pre-rendered text if scaled too much.
An interesting alternative could be using vector graphics (svg) files. Maybe OSM supports that?
The use case is the following: I am using your library in a GPS track editor application, TrackGuru. Sometimes there are very small artefacts and errors in such tracks, possibly as small as 1 meter. So you want to be able to zoom in very closely to those things to examine them. With the map being limited to the highest real tile level, it is very hard to impossible to figure out what is going on in such details. That you can't read the map at that time does not matter as you are just working with the overlay painters. It would also be an option to simply show an empty background while you're overzooming.
Interesting! Maybe you could apply an AffineTransform on top of the existing JxMapviewer component to achieve the over-zoom. Not sure if it works easy enough for you.
Hello.. Same request here. I have to draw precise paths on the terrain (for autonomous drones), so I have to zoom at the detail of meters.. I'd like a zoom level 0.1 :)
I was able to override this method to overzoom, but the problem is the pixel to geo and geo to pixel methods will no longer work. I think the feature would need to be integrated into the library to work properly.
@Override
protected void drawMapTiles(final Graphics g, final int zoom, Rectangle viewportBounds) {
Graphics2D g2d = (Graphics2D)g;
AffineTransform transform = g2d.getTransform();
g2d.translate(getWidth()/2, getHeight()/2);
g2d.scale(2.0, 2.0);
g2d.translate(-getWidth()/2, -getHeight()/2);
super.drawMapTiles(g, zoom, viewportBounds);
g2d.setTransform(transform);
}