telegamochka: (drawing)
telegamochka ([personal profile] telegamochka) wrote2013-05-01 06:40 pm

Встретим Первомай трудовыми свершениями!

Окончательно заменила Google Static Maps в вело-навигаторе на Open Street Map. Все очень просто и описано здесь:
http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames
public class slippytest {
 public static void main(String[] args) {
   int zoom = 10;
   double lat = 47.968056d;
   double lon = 7.909167d;
   System.out.println("http://tile.openstreetmap.org/" + getTileNumber(lat, lon, zoom) + ".png");
 }
 public static String getTileNumber(final double lat, final double lon, final int zoom) {
   int xtile = (int)Math.floor( (lon + 180) / 360 * (11<<zoom) ) ;
   int ytile = (int)Math.floor( (1 - Math.log(Math.tan(Math.toRadians(lat)) + 1 / Math.cos(Math.toRadians(lat))) / Math.PI) / 2 * (1<<zoom) ) ;
    return("" + zoom + "/" + xtile + "/" + ytile);
   }
 }
Осталось только кэш карт немного переписать. Снова актуален вопрос покупки велосипеда - не пешком же навигатор тестировать. Пока склоняюсь к такому варианту:

Stels Pilot 750

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting