Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

Symbology is copied successfully but symbology rotation is not

$
0
0
Hi all,

I tried to copy symbologies from a layer to another layer. And this is my code:

Code:

Dim symbolFLayer As IFeatureLayer
symbolFLayer = pMxDoc.FocusMap.Layer(indexSourceLayer)
Dim pGeoFLayer As IGeoFeatureLayer
pGeoFLayer = symbolFLayer

Dim targetGeoFLayer As IGeoFeatureLayer
targetGeoFLayer = outputFeatLayer
targetGeoFLayer.Renderer = pGeoFLayer.Renderer

The source layer and the target layers are point layers and they have exactly the same attributes. The source layer has a catogorised symbology with unique values. And the code above copied all the Unique value symbologies to the target layer successfully.

Now the problem comes when I need to copy the rotated symbologies. Both the source and the target layers have a field with a double data type called "Heading" that store the various angle values of the rotation. The source layer has a symbology that is rotated according to the value of the field "Heading". And I still cannot copy the rotated symbology. This is my trial code (continuation from above code):

Code:

Dim pRotationRenderer As IRotationRenderer
pRotationRenderer = targetGeoFLayer.Renderer
pRotationRenderer.RotationField = "Heading"
pRotationRenderer.RotationType = esriSymbolRotationType.esriRotateSymbolGeographic
pMxDoc.ActiveView.Refresh()

The result of the code above is only showing normal unique symbologies with normal angle (on the target layer). All symbologies
have the same angle (on the target layer). There is no error, but why it does not work?

I hope someone has a solution for this. Thank you.

Viewing all articles
Browse latest Browse all 1374

Trending Articles