Open GoogleCodeExporter opened 9 years ago
Work around:
double scale = getResources().getDisplayMetrics().density;
new GoogleSatelliteTileSource("GM", null, 7, 17, (int)(256 * scale), "" );
The scale will be the css pixel ratio (for example: Old Galaxy Mini Scale =
0.75, Normal Scale = 1.0, Google Nexus 7 2013 Scale = 2.0 and Galaxy Note 3
Scale = 3.0)
The tiles will now have the same 'size' on every screen density. However: when
setting a scale bigger than 1.9999 the CurrentLocationOverlay is overlay is not
working anymore! The pegman is not showing and the traveled path is not drawn
anymore.
I didn't find a fix for this issue yet...
Original comment by jveldh...@gmail.com
on 12 Feb 2014 at 12:28
Issue 525 has been merged into this issue.
Original comment by kurtzm...@gmail.com
on 12 Feb 2014 at 3:54
The reason for this is located in MapViewConstants:
public static final int MAXIMUM_ZOOMLEVEL = 22;
The MyLocationNewOverlay uses TileSystem.LatLongToPixelXY() with levelOfDetail
set to MapViewConstants.MAXIMUM_ZOOMLEVEL. The LatLongToPixelXY() method itself
uses TileSystem.MapSize():
public static int MapSize(final int levelOfDetail) {
return mTileSize << levelOfDetail;
}
Since 512 << 22 gives -2147483648, the coordinate is set to 0/0 after being
Clip()ped to the map boundaries in LatLongToPixelXY/().
A possible solution: Set MAXIMUM_ZOOMLEVEL to 21, then the bitshift won't give
a negative result and the pegman should be back there on the map.
Original comment by lorenz.s...@gmail.com
on 25 Mar 2014 at 7:50
Great! Changing the MAXIMUM_ZOOMLEVEL to 21 fixed the problem!
Original comment by jveldh...@gmail.com
on 4 Apr 2014 at 12:52
double scale = getResources().getDisplayMetrics().density;
new GoogleSatelliteTileSource("GM", null, 7, 17, (int)(256 * scale), "" );
I wonder how do osmdroid calculate the tile coordinate with a different tile
size?
Original comment by apachema...@gmail.com
on 25 Apr 2014 at 5:00
Original issue reported on code.google.com by
osei...@gmail.com
on 6 Feb 2014 at 8:09