I'm trying to make use of the SVGTileProvider
that is found in the Google IO 2013 app. I can't figure out exactly how to position an image on the Google Map though. I've narrowed it down to this section of the class. These aren't lat/long coordinates however somehow they must be coming from lat/long coordinates. Does anyone know what these are or where they come from?
mBaseMatrix.setPolyToPoly(
new float[]{
0, 0,
limits.width(), 0,
limits.width(), limits.height()
}, 0,
new float[]{
40.95635986328125f, 98.94217824936158f,
40.95730018615723f, 98.94123077396628f,
40.95791244506836f, 98.94186019897214f
}, 0, 3);
Update
The first set of mystery numbers roughly translates to lat/long 37.783887,-122.405107.
Update 2
These methods help me convert latitude to a y value and vice versa. How can I do this for X and Longitude?
public static double y2lat(double aY) {
return Math.toDegrees(2 * Math.atan(Math.exp(Math.toRadians(aY))) - Math.PI / 2);
}
public static double lat2y(double aLat) {
return Math.toDegrees(Math.log(Math.tan(Math.PI / 4 + Math.toRadians(aLat) / 2)));
}