ios - 如何在应用增加边界宽度的自定义渲染时保留 ArcGIS map 中填充的颜色

标签 ios swift arcgis

@IBOutlet weak var mapView: AGSMapView!
private var map:AGSMap!
private var featureLayer:AGSFeatureLayer!

func loadAirQuality()
{
        if self.featureLayer == nil 
        {
            //create feature table using a url
            self.featureTable = AGSServiceFeatureTable(url: URL(string: hourlyMapURL)!)
            //create feature layer using this feature table
            self.featureLayer = AGSFeatureLayer(featureTable: self.featureTable)
            //create feature table using a url. This is the CSV table hosted on ESRI Online
            //self.zipSRACityTable = AGSServiceFeatureTable(url: URL(string: self.zipSRACityURL)!)
            self.featureLayer.labelsEnabled = false
            // set opacity of SRA regions
            self.featureLayer.opacity = Constant.mapOpacity
            self.mapView.graphicsOverlays.add(graphicsOverlay)
        }

        //add feature layer to the map
        self.map.operationalLayers.add(self.featureLayer)

        //add graphics overlay to the map view

        self.mapView.locationDisplay.autoPanMode = 
        AGSLocationDisplayAutoPanMode.recenter
}

以上是正在使用的默认代码,ArcGIS map 根据从要素层收到的数据集填充颜色。有没有办法在边界宽度增加的情况下保留特征层颜色。 但是如果我们尝试使用下面的代码增加边界的宽度,那么 map 上的颜色就会消失。

let lineSymbol = AGSSimpleLineSymbol(style: .solid, color: UIColor.black, width: 1)

    self.featureLayer.renderer = AGSSimpleRenderer(symbol: lineSymbol)

最佳答案

你试试这段代码。

 // Create a outline symbol
        let outlineSymbol = AGSSimpleLineSymbol(style: .solid, color: .green, width: 2)

        // Create a fill symbol for polygon graphic
        let fillSymbol = AGSSimpleFillSymbol(style: .forwardDiagonal, color: .green, outline: outlineSymbol)

关于ios - 如何在应用增加边界宽度的自定义渲染时保留 ArcGIS map 中填充的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52071564/

相关文章:

ios - ARCGIS 自动在 map 上显示标注

ios - 如何用swift在折线图中显示json数据

ios - 导航栏在 segue 后消失

swift - 通过 Firebase Swift 显示和更新注释

ios - 如何在UIView中调用UITextFieldDelegate

javascript - onChange 不足以触发 Dojo Combobox 的查询

ios - 如何以编程方式为非 ARC xcode 项目中的特定文件启用 ARC?

ios - 获取高速公路名称 - Skobbler

ios - preferredStatusBarStyle 不工作

python - 使用字典将 python 数据类型转换为其他语言的数据类型