docs
This commit is contained in:
parent
76e1dcae7c
commit
fb1b0d4087
@ -82,6 +82,12 @@ public final class MercatorProjection {
|
|||||||
* ((long) Tile.TILE_SIZE << mapPosition.zoomLevel);
|
* ((long) Tile.TILE_SIZE << mapPosition.zoomLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Projects a longitude coordinate (in degrees) to the range [0.0,1.0]
|
||||||
|
* @param latitude
|
||||||
|
* the latitude coordinate that should be converted.
|
||||||
|
* @return the position .
|
||||||
|
*/
|
||||||
public static double latitudeToY(double latitude) {
|
public static double latitudeToY(double latitude) {
|
||||||
double sinLatitude = Math.sin(latitude * (Math.PI / 180));
|
double sinLatitude = Math.sin(latitude * (Math.PI / 180));
|
||||||
return 0.5 - Math.log((1 + sinLatitude) / (1 - sinLatitude)) / (4 * Math.PI);
|
return 0.5 - Math.log((1 + sinLatitude) / (1 - sinLatitude)) / (4 * Math.PI);
|
||||||
@ -147,6 +153,12 @@ public final class MercatorProjection {
|
|||||||
* ((long) Tile.TILE_SIZE << mapPosition.zoomLevel);
|
* ((long) Tile.TILE_SIZE << mapPosition.zoomLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Projects a longitude coordinate (in degrees) to the range [0.0,1.0]
|
||||||
|
* @param longitude
|
||||||
|
* the longitude coordinate that should be converted.
|
||||||
|
* @return the position .
|
||||||
|
*/
|
||||||
public static double longitudeToX(double longitude) {
|
public static double longitudeToX(double longitude) {
|
||||||
return (longitude + 180) / 360;
|
return (longitude + 180) / 360;
|
||||||
}
|
}
|
||||||
|
@ -26,8 +26,12 @@ import org.oscim.view.MapView;
|
|||||||
import android.opengl.GLES20;
|
import android.opengl.GLES20;
|
||||||
import android.opengl.Matrix;
|
import android.opengl.Matrix;
|
||||||
|
|
||||||
// http://safari.informit.com/9780321563835
|
/*
|
||||||
// http://www.opengles-book.com
|
* This is an example how to integrate custom OpenGL drawing routines as map overlay
|
||||||
|
*
|
||||||
|
* based on chapter 2 from:
|
||||||
|
* https://github.com/dalinaum/opengl-es-book-samples/tree/master/Android
|
||||||
|
* */
|
||||||
|
|
||||||
public class CustomOverlay extends RenderOverlay {
|
public class CustomOverlay extends RenderOverlay {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user