Add layer above googlemaps layer in swift

梦想与她 提交于 2019-12-10 19:23:42

问题


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 got smth like this:

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

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


回答1:


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



来源:https://stackoverflow.com/questions/34986994/add-layer-above-googlemaps-layer-in-swift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!