gpt4 book ai didi

android - 如何在用户端下载 osmdroid tiles?

转载 作者:太空宇宙 更新时间:2023-11-03 11:13:10 25 4
gpt4 key购买 nike

我已经成功地从 osmdroid (Mapnik) 的 SD 卡加载 map block

但现在我想在我的 Android 应用程序中提供一个选项来下载用户想要使用的 map 图 block mean map show online 用户选择特定区域并兑现供他使用我不知道该怎么做请帮忙谢谢

最佳答案

我不确定问题指向哪里。据我了解,您让用户选择一个区域 - 用地理坐标表示 - 然后使用这些坐标来计算要检索的图 block 。

Slippy map tilenames在 OSM wiki 中有一个很好的解释如何做到这一点:

  • Reproject the coordinates to the Mercator projection (from EPSG:4326 to EPSG:3857):

    x = lon
    y = arsinh(tan(lat)) = log[tan(lat) + sec(lat)]

    (lat and lon are in radians)

  • Transform range of x and y to 01 and shift origin to top left corner:

    x = [1 + (x / π)] / 2
    y = [1 − (y / π)] / 2
  • Calculate the number of tiles across the map, n, using 2^zoom
  • Multiply x and y by n. Round results down to give tilex and tiley.

关于android - 如何在用户端下载 osmdroid tiles?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21406825/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com