telegamochka: (drawing)
[personal profile] telegamochka
Окончательно заменила 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
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

Profile

telegamochka: (Default)
telegamochka

April 2017

S M T W T F S
      1
234 567 8
9101112 131415
16171819202122
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 24th, 2025 04:29 am
Powered by Dreamwidth Studios