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

Pathoverlay does not work with 512x512 tiles. #13

Closed
mdakram opened this issue Apr 1, 2014 · 7 comments
Closed

Pathoverlay does not work with 512x512 tiles. #13

mdakram opened this issue Apr 1, 2014 · 7 comments

Comments

@mdakram
Copy link
Contributor

mdakram commented Apr 1, 2014

I am trying to use

public static final OnlineTileSourceBase MAPNIK = new XYTileSource("Mapnik",
ResourceProxy.string.mapnik, 0, 18, 512, ".png", "http://tile.openstreetmap.org/");

but it seem with 512x512 size tiles.

1.Pathoverlay does not appear with 512x512 tiles.Its working fine with 256x256 though.
2. myLocationoverlay is not visible
3. if i am setting setScrollableAreaLimit it does not show any of tiles at all.
4. itemizedoverlays can be drawn.

@kurtzmarc @neilboyd any workaround??

silviokuehn added a commit to silviokuehn/osmdroid that referenced this issue Nov 19, 2014
- This does solve all your problems when using tiles with a size of
512px for example in combination with Overlays and more.
neilboyd added a commit that referenced this issue Nov 19, 2014
Issue #13 - Pathoverlay does not work with 512x512 tiles.
@neilboyd
Copy link
Contributor

Fixed in commit 22677d6

@kurtzmarc
Copy link
Contributor

I think 22677d6 is a bad idea and it will crash. If we start to use longs in MapSize() that means we support a much larger map size - one that Android's canvas does not support since it uses integers for its coordinate system. I suspect that this will break if you zoom in far and travel to the edges of the map. Also it doesn't compile with Java 8 since it appears that implicit conversions from long to int are errors now (I think that's what is happening to me).

@kurtzmarc kurtzmarc reopened this Nov 20, 2014
@neilboyd
Copy link
Contributor

What should we do instead? Argument check to prevent tiles larger than 256?

@kurtzmarc
Copy link
Contributor

I think I need to take some time to reproduce and explore the problem more, but calling TileSystem.setTileSize(512) might be all that is needed. Can OP try that and confirm?

I think most people are interested in scaling the tiles to the device's dpi which is why they are doing this (it has been proposed as a sort-of-working solution for that). Maybe that's the real problem to solve.

@ziem
Copy link
Contributor

ziem commented Nov 21, 2014

I think most people are interested in scaling the tiles to the device's dpi which is why they are doing this (it has been proposed as a sort-of-working solution for that). Maybe that's the real problem to solve.

I agree! Tiles are too small on high dpi devices like Nexus 5 and posted workaround:
#49 (comment)
is causing problems:
#13
#68

@kurtzmarc
Copy link
Contributor

Please take a look at #81 where we have a potential solution ready for testing.

silviokuehn added a commit to silviokuehn/osmdroid that referenced this issue Dec 2, 2014
- The issue is already solved, but to hold it consistent, the problem
even has to be solved in the TileSystem wrapper class of osmdroid. Now
it is alright.
@kurtzmarc
Copy link
Contributor

I have merged the fix_dpi_scaling branch. Call mMapView.setTilesScaledToDpi(true) to turn on tile scaling. Report all issues to #81.

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