AnsweredAssumed Answered

How to disable transparency on AGSTiledMapServiceLayer.

Question asked by iyilmam on Dec 8, 2015
Latest reply on Dec 9, 2015 by iyilmam

Hi Everyone

 

i'm beginner on this sdk.

 

My question is:

i'm using swift language

I have arcgis server tiled web service.Tile format is PNG

i'm adding this layer to my project.

But white colours are transparency.

how can i fix this.

Thanks

 

İmage Sample (road must be white)

and

Code Sample:

 

import UIKit

import ArcGIS

 

 

class ViewController: UIViewController, AGSMapViewLayerDelegate{

 

    @IBOutlet weak var mapView: AGSMapView!

 

   

    override func viewDidLoad() {

        super.viewDidLoad()

        let cred = AGSCredential(user: "userblabla", password: "pasblabla")

        let url = NSURL(string: "http://domain.compnay.com/arcgis/rest/services/layername/MapServer")

        let layer = AGSTiledMapServiceLayer(URL: url, credential: cred)

        layer.opacity=1

       

        self.mapView.addMapLayer(layer, withName: "Base")

        self.mapView.layerDelegate = self

     

    }

   

    func mapViewDidLoad(mapView: AGSMapView!) {

    

        //do something now that the map is loaded

        //for example, show the current location on the map

        mapView.locationDisplay.startDataSource()

    }

 

    override func didReceiveMemoryWarning() {

        super.didReceiveMemoryWarning()

        // Dispose of any resources that can be recreated.

    }

 

 

}

Outcomes