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

时间:2018-08-29 07:13:20

标签: 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地图根据要素图层中接收到的数据集填充颜色。有什么方法可以保留边界宽度增加的要素图层颜色。 但是,如果我们尝试使用以下代码增加边界的宽度,则颜色将从地图中消失。

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

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

1 个答案:

答案 0 :(得分:0)

您尝试使用此代码。

private void trackBar2_Scroll(object sender, EventArgs e)
{
    if (myport.IsOpen)
    {
        myport.WriteLine(trackBar2.Value.ToString());
    }
}