mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.37k stars 1.33k forks source link

MGLRasterTileSource not being drawn for custom server #16477

Closed furysheep closed 4 years ago

furysheep commented 4 years ago

I couldn't find a problem.

Steps to reproduce

func mapView(_ mapView: MGLMapView, didFinishLoading style: MGLStyle) {
        let source = MGLRasterTileSource(identifier: "stamen", tileURLTemplates: ["http://gk200.com:3005/map_tiles/{x}/{y}/{z}"], options: [ .tileSize: 512 ])
        let rasterLayer = MGLRasterStyleLayer(identifier: "stamen", source: source)
        style.addSource(source)
        style.addLayer(rasterLayer)

        self.rasterLayer = rasterLayer
    }

I am using custom tile server to draw over the default style. https://docs.mapbox.com/ios/maps/examples/source-custom-raster/

When i use this server, the tiles are successfully drawn. https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.jpg

If i use this server url, it doesn't work. http://gk200.com:3005/map_tiles/{x}/{y}/{z}

Expected behavior

The custom tiles should be drawn.

Actual behavior

No raster style is drawn

Configuration

Mapbox SDK versions: 5.9 iOS 13.4 iPhone 11 pro simulator Xcode version: 11.4

RustamG commented 4 years ago

Hey @furysheep! How did you resolve the issue?