Select to view content in your preferred language

How to disable transparency on AGSTiledMapServiceLayer.

3069
1
Jump to solution
12-08-2015 07:35 AM
ilkerYILMAM
Deactivated User

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.

    }

}

0 Kudos
1 Solution

Accepted Solutions
ilkerYILMAM
Deactivated User

Ok

I solved.

Solution:

  self.mapView.gridLineWidth=0

      

  self.mapView.backgroundColor=UIColor .whiteColor()

View solution in original post

1 Reply
ilkerYILMAM
Deactivated User

Ok

I solved.

Solution:

  self.mapView.gridLineWidth=0

      

  self.mapView.backgroundColor=UIColor .whiteColor()