Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature suggestion: Overzoom #74

Open
NopMap opened this issue Apr 14, 2019 · 5 comments
Open

Feature suggestion: Overzoom #74

NopMap opened this issue Apr 14, 2019 · 5 comments

Comments

@NopMap
Copy link

NopMap commented Apr 14, 2019

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.

@msteiger
Copy link
Owner

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?

@NopMap
Copy link
Author

NopMap commented Apr 16, 2019

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.

@msteiger
Copy link
Owner

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.

@marioarrigonineri
Copy link

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 :)

@kkieffer
Copy link
Contributor

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);
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants