【发布时间】:2018-12-20 05:56:11
【问题描述】:
我的代码在下面
mapView.setTileSource(new OnlineTileSourceBase("USGS Topo", 0, 18, 256, ".png",
new String[] { "https://maps.tilehosting.com/c/48533dee-0f32-42a2-a6db-315bbc7ecca8/styles/bdbasic/{z}/{x}/{y}.png?key=xxxxxxxxxx" }) {
@Override
public String getTileURLString(long pMapTileIndex) {
return getBaseUrl()
+ MapTileIndex.getZoom(pMapTileIndex)
+ "/" + MapTileIndex.getY(pMapTileIndex)
+ "/" + MapTileIndex.getX(pMapTileIndex)
+ mImageFilenameEnding;
}
});
https://github.com/osmdroid/osmdroid/wiki/Map-Sources
我的版本是 6.0.3
【问题讨论】:
-
您是否在 Google Developer Console 上配置了您的地图?您必须提供加载地图的密钥。
-
我正在使用 osm(开放街道地图),他们的默认瓦片源工厂运行良好,并在我的应用程序中显示地图,但对于生产,我使用自己的瓦片源,其中键由“xxx”隐藏,但它没有工作..我找不到问题在哪里..
-
您需要为生产生成不同的密钥。调试工具不起作用。
-
它是我们的生产密钥,在我们的 Web 应用程序中运行良好。 @Jaymin
-
你检查过你的 LogCat 了吗?