我尝试使用Google地图文档中的代码在Google地图上添加我自己的图层:
extension MapViewController {
func addTiles() {
// Implement GMSTileURLConstructor
// Returns a Tile based on the x,y,zoom coordinates, and the requested floor
let urls = { (x: UInt, y: UInt, zoom: UInt) -> NSURL in
let url = "http://example.pl/ras/\(zoom)/\(x),\(y).v\(1).png";
return NSURL(string: url)!
}
// Create the GMSTileLayer
let layer = GMSURLTileLayer(URLConstructor: urls)
layer.tileSize = 512
layer.map = mapView
}}
我得到了这样的话:
我看不到地形应该在我的瓷砖下面。我的瓷砖是透明的。你知道什么是错的吗?
更新: 问题仅在iOS模拟器上发生。它正在开发真实设备。
答案 0 :(得分:4)
问题仅在iOS模拟器上发生。它正在开发真实设备。