快速在googlemaps图层上方添加图层 [英] Add layer above googlemaps layer in swift

查看:259
本文介绍了快速在googlemaps图层上方添加图层的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试通过Google地图文档中的代码在Google地图上添加自己的图层:

I tried to add my own layer on google maps by code from google maps documentation:

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
}}

我有这样的东西:

我没有看到应该在我的瓷砖下面的地形.我的瓷砖是透明的.您知道什么地方可能出问题吗?

I don't see terrain which should be under my tile. My tiles are transparent. Do you have any idea what can be wrong?

更新: 问题仅在iOS模拟器上出现.它正在实际设备上运行.

Update: Problem is occurring only on the iOS simulator. It is working on real devices.

推荐答案

问题仅在iOS模拟器上出现.它正在实际设备上运行.

Problem is occurring only on the iOS simulator. It is working on real devices.

这篇关于快速在googlemaps图层上方添加图层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆