Select to view content in your preferred language

How to get Color Ramps from .stylx file using Maps SDK.net 200.x

158
1
07-22-2024 07:56 AM
Muhammadkhalid
Emerging Contributor

I have a .stylx file which I have created in ArcGIS pro. Its a Mobile Style file in which I have copied some color ramps from Color Brewer schemes (system style of ArcGIS pro) into my style.

If I open that style file in ArcGIS Pro then it shows the color ramps Accurately.

I want to get all the Color Ramps programmatically from that style file using ArcGIS Maps SDK .Net (200.x)

I am using following code to get symbology. But when I query to get color ramps the query result (colorRampResults) has zero items. 

private void TestMethod()
{

SymbolStyleSearchParameters searchParameters = new SymbolStyleSearchParameters();
string pathToStlyx = @"D:\TestColorRamps.stylx";
SymbolStyle symbolstyle = SymbolStyle.OpenAsync(pathToStlyx).GetAwaiter().GetResult();

var colorRampResults = symbolstyle.SearchSymbolsAsync(searchParameters).GetAwaiter().GetResult();

//colorRampResults resulting enumeration has zero result items

}

How can I get Color Ramps from style file?

for reference I am attaching the .stylx file as well.

NOTE: Style file only has color ramps, it has no symbols in it.

 

0 Kudos
1 Reply
PreetiMaske
Esri Regular Contributor

ArcGIS Maps SDK for Native apps only support stylx with symbols. Stylx containing other types of elements are currently not supported and is expected to return empty results.

0 Kudos